Unexpected Error with stats cost limit


#1

Hello,

We have started to detect issues obtaining stats in promoted_tweet and line_items levels.

We’re getting this error message:

{
"errors":[
{
    "code":"COST_LIMIT_EXCEEDED",
    "message":"Cost limit exceeded"
}
],
"request":{
    "params":[
    ]
}

}

But we have this response headers:

{
"content_disposition":"attachment; filename=json.json",
"content_encoding":"gzip",
"content_length":"121",
"content_type":"application\/json;charset=utf-8",
"date":"Thu, 15 Oct 2015 10:32:45 GMT",
"server":"tsa_f",
"set_cookie":"guest_id=v1%3A144490516501237443; Domain=.twitter.com; Path=\/; Expires=Sat, 14-Oct-2017 10:32:45 UTC",
"strict_transport_security":"max-age=631138519",
"x_access_level":"read-write-directmessages",
"x_connection_hash":"2691e49f9672e03bee9eae3c230fa559",
"x_content_type_options":"nosniff",
"x_cost_rate_limit_limit":"5000",
"x_cost_rate_limit_remaining":"14",
"x_cost_rate_limit_reset":"1444905181",
"x_frame_options":"SAMEORIGIN",
"x_rate_limit_limit":"2000",
"x_rate_limit_remaining":"1914",
"x_rate_limit_reset":"1444905422",
"x_request_cost":"16",
"x_response_time":"509",
"x_runtime":"0.401761",
"x_transaction":"1bd4f4663ccfb6e0",
"x_xss_protection":"1; mode=block"
},

Could you check this?

Regards


#2

Hello Hector,

The error message indicates that you have no more ‘cost’ remaining for this rate limit window based upon our cost rate limiting scheme for analytics endpoints.

Please see https://dev.twitter.com/ads/analytics/best-practices and implement an algorithm for appropriately waiting and breaking up analytics calls in order to comply with the rate limiting, and double check that you are appropriately not oversharing tokens which will also make rate limiting much more difficult to deal with.

Thanks,

John


#3

Hi John.

Thanks for you response.

Of course! You’re right. I don’t know whi but I was reading “x_rate_limit_remaining” instead of “x_cost_rate_limit_remaining”

Sorry

Regards.