Getting error: User Rate Limit Exceeded

11,047 views
Skip to first unread message

RG

unread,
May 1, 2012, 8:58:34 AM5/1/12
to Google APIs Client Library for Objective-C
Hi,

One of my users can't connect to his Google Analytics account from my
Cocoa app. He always gets the error "User Rate Limit Exceeded".

From what he tells me I think the authentication goes through, but
when my app tries to fetch the number of website profiles the error is
returned.

I have increased the Per-User Limit from 1 to 20 requests per second,
but that didn't help. Also, he is the only one with that error. All
other users have been fine even with requests limited to 1 per second.

Daily requests are far below daily quota.

Is there any other reason why the above error could be returned?

Thanks,
Rico

Greg Robbins

unread,
May 1, 2012, 9:52:58 AM5/1/12
to google-api-obj...@googlegroups.com
That error typically reflects a quota limit being exceeded, or a client sending too many unbatcheded requests at once.  

This is an appropriate question for the Analytics API developer forums, at https://developers.google.com/analytics/community/

RG

unread,
May 9, 2012, 5:27:14 AM5/9/12
to google-api-obj...@googlegroups.com
Hi Greg,

Thanks for the link. I posted a question to the management API group, but no response yet.

In the meantime I refactored my code to use batched requests. However, a few queries in the batch still fail with "User Rate Limit Exceeded".

I must be missing something, because the setup seems straight forward:

(1) Run normal (unbatched) query for the management account list

  Sleep 5 seconds (for testing)

(2) Run a second query, batched, for all web properties (in my case just one sub-query)

  Sleep another 5 seconds (for testing)

(3) Run a third query, batched, for all website profiles (20 sub-queries in my case)

-> A few sub-queries in the batch fail each time


I don't understand why the rate limit would be exceeded. The way I understand the above is that I'm executing a total of only 3 queries, each with a 5 second break in-between. Rate limit in the API console is 20 requests per second (I also tried 2000 per second).

Thanks,
Rico

Greg Robbins

unread,
May 9, 2012, 11:25:02 AM5/9/12
to google-api-obj...@googlegroups.com
A mis-configured client (in the Google API console) or requests without the ID required by the API (the API key, or the OAuth 2 client ID) can also cause quota failures. 

Be sure to check the requests in the http logs generated by the library to verify that an appropriate request header is included.

RG

unread,
May 10, 2012, 7:05:56 AM5/10/12
to google-api-obj...@googlegroups.com
I'm using OAuth 2 authentication. The logs show that the request includes the Authorization header:

2012-05-10 10:53:47 +0000      batch: analytics.management.profiles.list (20 queries) 
request: POST https://www.googleapis.com/rpc?prettyPrint=false
   headers: 5    authorized
   data: 3236 bytes, application/json-rpc; charset=utf-8
response:  status 200
   headers: 11 
   data: 258032 bytes, application/json 

Details:

batch: analytics.management.profiles.list (20 queries)

2012-05-10 10:53:47 +0000
Request: POST https://www.googleapis.com/rpc?prettyPrint=false
Request headers:
  Accept: application/json-rpc
  Authorization: Bearer _snip_
  Cache-Control: no-cache
  Content-Type: application/json-rpc; charset=utf-8
  User-Agent: com.example.app/1.0.1 google-api-objc-client/2.0 MacOSX/10.7.3 (gzip)

Does this look good to you or is there something missing?

-Rico

Greg Robbins

unread,
May 10, 2012, 9:44:48 PM5/10/12
to google-api-obj...@googlegroups.com
That looks normal for an OAuth 2 authorized request. Perhaps the Client ID no longer has any associated quota allowed for the service.

Daniel Pérez Rada

unread,
Jan 7, 2013, 9:10:14 AM1/7/13
to google-api-obj...@googlegroups.com
Hi,
I have the same problem, and I realize from the documentation (https://developers.google.com/analytics/devguides/reporting/core/v3/coreErrors) there is a request per second limit.
The default request per second limit is 1.
You can change it up to 10 in this url (you have to put your <PROJECT_ID>:
https://code.google.com/apis/console/b/0/#project:<PROJECT_ID>:quotas
Reply all
Reply to author
Forward
0 new messages