Twitter Ads API Rate limiting question


#1

Hi guys!

On the rate limiting page the rate limits have been documented (https://dev.twitter.com/ads/basics/rate-limiting#rate-limits), however when requesting data from the GET /1/stats/accounts/:account_id endpoint I see a completely different rate limit in the headers. Could you confirm whether this is an error in the documentation or an error on your side?

The rate limit I see in the headers is 250 requests per 15 minutes:

'x-rate-limit-limit': '250'

With a reset 15 minutes later.

Thanks!

Tiana


#2

Hi,

I believe the document is incorrect in this case unfortunately. It was lowered to 250 after we released the async endpoint with the assumption that partners could move most of the bandwidth / traffic of syncing onto async. The synchronous endpoint is the only option for real-time optimization scenarios, so if you follow best practices to offload most of syncing to async and still have scenarios where 250 is not enough, please sync with your API program contact about this.

Thanks,

John


#3

Hi @JBabichJapan,

Thank you very much for the clarification! It would be great if the documentation could be updated soon then, as we’ve been using this for reference the entire time during development. (Also, I see this page also states the asynchronous endpoint uses the write rate limit: https://dev.twitter.com/ads/analytics#RateLimiting (which should be 300 requests / 1 minute) ).

So this rate limit of 250 requests / 15 minutes is both for the synchronous and asynchronous endpoints?

We’re currently in development phase and making sure to use the asynchronous endpoint as much as possible. During this we continuously use and test the API like one of our users would (and would be able to), but we’re noticing we’re running into the rate limit during development already. So, we will need to contact our API program contact about this, because I definitely expect this would become an issue when our users start using it. Perhaps you know, if we contact our API program contact, what would be a rate limit increase we could expect? That way we can take this into account with further development while we await response.

Thanks,

Tiana


#4

@Tianape: Thanks again for the question and for letting us know there is a discrepancy in the documentation. We will update them soon.

In terms of the rate limits and endpoints:

  • GET /1/stats/accounts/:account_id (synchronous): 250 requests per 15-minute window
  • POST /1/stats/jobs/accounts/:account_id (asynchronous): 300 requests per 1-minute window
    • this is part of the general Ads API write limit for any POST, PUT, or DELETE request
  • GET /1/stats/jobs/accounts/:account_id: 2000 requests per 15-minute window
    • this is an account read (GET endpoints with :account_id) and is subject to those limits

That’s great that you’re relying on the asynchronous endpoint—that’s what we recommend. We suggest only using the sync endpoint for real-time optimization.


#5

Thanks @juanshishido! That was exactly what I was looking for. :slight_smile:

We’ll make sure to take into account those rate limits!