The Movie Database サポート

Hi All,

This is more of a development question than a general API question.

I can see in the documentation there is limiting - "Our current limits are 40 requests every 10 seconds and are limited by IP address", i have been using the API for years now and have never tapped into the full processing power of the API.

Im currently developing (almost finished) a windows store application that will manage my extensive library of movies, however ive run into a little annoying issue with processing the collection (SPEED).

I have taken a sequential approach to processing the collection but its slow, im trying to move away from this and hit the max limit of the API every 10 seconds. The only trouble is that i need some direction on the approach from a c# perspective.

With Windows store applications i can use "Tasks" which are basically the same as background threads, however even with kicking off 10 Tasks (3 web calls per task (movie by name, movie by id and download 1 poster) im not seeing the substantial improvements i was expecting. I have reduced the image quality to the lowest but still the same performance issue.

Regardless of how many Tasks i kick off i never appear to hit the limit which suggests im not doing this correctly.

I have search the web on many occasions with little to no response this matter.

Does anyone have an idea / approach to improve the speed of querying the data from the API?

Thank you Kevin

6 replies (on page 1 of 1)

Jump to last post

Hi Kevin,

Just a few things to mention that may help.

First, the image call won't count towards the limit, only direct calls to api.themoviedb.org do.

Second, if you decide to not worry about hitting the limit for a second, do your test runtimes get faster with more tasks, or are they staying flat?

Third, you can also use the API stats page in your account and do some comparisons of how many calls are being registered just for a sanity check. Ie. if you're testing 50 movies, there should be 100 calls.

Cheers.

Hi Travis,

I forgot about the stats page, soon as i return from work ill give this a go and post back. As usual thanks for the quick response :)

Hi Travis,

So I stripped back my code and managed the Tasks more efficiently and can confirm that it running super quick.

I ran 100 tasks that made one simple request each(query movie name) that completed in 2.09 seconds, although this is fantastic it leads me to think that the 40 requests every 10 seconds is not working or disabled.

Can you confirm this is the case, I was expecting to see errors where I could manage this in my code.

Also, I can only see some very basic stats from my calls, are you able to drill down into a users requests to confirm that I exceeded the 40 calls?

Kevin

Hi Kevin,

I can confirm the limits are working but if you would like to see the status of your IP in the rate limiter you can inspect the headers of a request. An example:

Traviss-iMac:~ travisbell$ curl -vv "http://api.themoviedb.org/3/search/movie?api_key=###&query=the+martian"
*   Trying 75.101.138.13...
* Connected to api.themoviedb.org (75.101.138.13) port 80 (#0)
> GET /3/search/movie?api_key=###&query=the+martian HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: public, max-age=21600
< Content-Type: application/json;charset=utf-8
< Date: Thu, 03 Dec 2015 15:13:11 GMT
< ETag: f812291e86e5d515984dc44cf9d41ac3
< Server: openresty
< Vary: Accept-Encoding
< X-RateLimit-Limit: 40
< X-RateLimit-Remaining: 39
< X-RateLimit-Reset: 1449155601
< Content-Length: 9548
< Connection: keep-alive

You can see the X-RateLimit-* headers report the current status of your IP.

Hi Travis,

Thank you, ill look into this and post back as soon as ive tested :)

Hi Travis,

Thank you for your help with this, I drilled down into the header and indeed seen the x-rate limit deducting each request.

all good now :)

映画やテレビ番組が見つかりませんか?ログインして作成してください。

全般

s 検索バーに移動する
p プロファイルメニューを開く
esc 開いているウィンドウを閉じる
? キーボードショートカットウィンドウを開く

メディアのページ

b 戻る(または該当する場合は親に)
e 編集ページに行く

テレビ番組のシーズンのページ

(右矢印)次のシーズンに行く
(左矢印)前のシーズンに戻る

テレビ番組のエピソードのページ

(右矢印)次のエピソードに進む
(左矢印)前のエピソードに戻る

全ての画像のページ

a 画像追加ウィンドウを開く

全ての編集ページ

t 翻訳選択を開く
ctrl+ s フォームを送信する

ディスカッションのページ

n 新しいディスカッションを作成する
w 監視ステータスを切り替える
p 公開/非公開を切り替える
c 閉じる/開くを切り替える
a アクティビティを開く
r ディスカッションに返信
l 最後の返事に行く
ctrl+ enter メッセージを送信する
(右矢印)次のページ
(左矢印)前のページ

設定

このアイテムを評価したり、リストに追加したりしたいですか?

ログイン

メンバーではありませんか?

登録してコミュニティに参加