Author Topic: fanart.tv API v3  (Read 4474 times)

Kode

  • Newbie
  • *
  • Posts: 10
Hi, any chance you could change to the v3 version of th API?  Docs are at http://docs.fanarttv.apiary.io/ the new API is significantly less resource intensive.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
sure, i will try and upgrade this weekend

Kode

  • Newbie
  • *
  • Posts: 10
Great stuff, in case you are interested, I set up an SSD server just to test the differenced between the 2 APIs using ab settings of ab -k -n 8000 -c 100

So thats 100 concurrent requests running 8000 times gave the following results:

Old API:
Time taken for tests: 52.556 seconds
Requests per second: 152.22 [#/sec] (mean)
Load: Over 20 and rising while the test was running

New API:
Time taken for tests: 6.260 seconds
Requests per second: 1278.01 [#/sec] (mean)
Load: No appreciable increase

Obviously real world usage is different as thats just hitting a single URL but it's still a useful comparison

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
this is done for the next v2.4 beta update. I expect v2.4 would go live around the end of august.
It looks like your users will get a lot of benefit from the new api.

Kode

  • Newbie
  • *
  • Posts: 10
To be honest I had to roll v3 out before I finished it as we had a massive increase in traffic and the old one couldn't handle it, fortunately the vast majority of the extra traffic is now on the new API so that sorted the immediate issue.

Kode

  • Newbie
  • *
  • Posts: 10
Hi,

Is there any chance that you could add a field or option where users can add a personal API key https://fanart.tv/get-an-api-key/ and send that as a client_key?

An example url would be http://webservice.fanart.tv/v3/movies/120?api_key=6fa42b0ef3b5f3aab6a7edaa78675ac2&client_key=cc8d7705c777f0b5ac7133b5cd363bff

You can also send both of these keys as headers so the url to hit would be http://webservice.fanart.tv/v3/movies/120
with headers of:
api-key: 6fa42b0ef3b5f3aab6a7edaa78675ac2
client-key: cc8d7705c777f0b5ac7133b5cd363bff

(note the hyphen - instead on an underscore_ in the key names)

The benefit of people doing that is v2 requests get images that were approved 14 days+, v3 requests get images approved 7+ days, v3 + client_key gets images 48hours+

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
its too late to include this enhancement in the v2.4 release but its easy enough to add into the next release