Oembed. Rate Limited

rate-limits
oembed
api

#1

I am using Twitter Oembed API from the server side. Their docs https://dev.twitter.com/rest/reference/get/statuses/oembed specify that there isn’t any rate limits imposed on this particular API. But I am keep getting “Rate limit exceeded” with code 88 in my requests. FYI, I cache my results. Am I missing anything?


#2

Hi there! I’m looking into this now.

Are you calling api.twitter.com or publish.twitter.com?

I believe there could be an error in the docs - if you check the rate-limiting documentation it states that endpoints not listed in the chart default to 180 requests in a standard 15 minute window.


#3

Hi Andy,

I believe I am calling it from api.twitter.com.
’/1.1/statuses/oembed.json?id=740914017766514690&maxwidth=550&omit_script=true’
And not the publish.twitter.com using url params as stated on your docs.

Will it make a difference?

Regards,
Zhongcai


#4

If you check the headers, you will see that on api.twitter.com, the statuses/oembed endpoint is indeed subject to the default rate limit of 180 calls in 15 minutes, e.g.

-> "x-rate-limit-limit: 180\r\n"
-> "x-rate-limit-remaining: 176\r\n"
-> "x-rate-limit-reset: 1465549655\r\n"

If you’re still using that endpoint, but want to switch over, you should note that the format of the oEmbed response from the newer publish.twitter.com oembed endpoint is different.

I’m making a note that we should clarify the documentation around this recent change to the API.


#5

Hi Andy,

Can I find out from you what is the rate limit if its from ‘publish.twitter.com’ endpoint?
Sorry to trouble. Thanks!

Regards,
Zhongcai


#6

I believe that if there is no explicit rate-limit specified for an endpoint, it should be the default 180 calls in 15 minutes per the rate limit documentation. I will work with the team to clarify and confirm, but you should assume that is the case otherwise.