Search code examples
githubgithub-apigist

When does the GitHub Gist API rate limit reset?


I'm making unauthenticated calls to the GitHub Gist API, and I've exceeded the rate limit. Trying to browse to https://api.github.com/users/seisvelas/gists?page=1&per_page=100, I receive:

{
  "message": "API rate limit exceeded for 187.188.105.159. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}

I browsed to the suggested documentation, and it suggested I take a look at the X-RateLimit-Reset: response header, so I did. My response headers look like this:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1566344009

Okay, so I'm allowed 60 requests. But the time for the Rate Limit Reset is given as 1566344009...units. I'm not sure what these units are measured in. Milliseconds? If so, that would mean I'm allowed 60 requests every ~18 days. Which seems a bit conservative but not out of the question, but I'd prefer to know for sure what unit the rate limit time is being measured in.

I didn't see any suggestions on the documentation, so any help is immensely appreciated! Thanks!


Solution

  • The answer did turn out to be on the docs, don't know how I missed it! It represents the Unix epoch time in seconds. When the time reaches that epoch time, you're rate limit resets. In my case, 1566344009 in Unix Epoch Time represents Tuesday, August 20, 2019 11:33:29 PM, GMT.

    If you have a time given in Unix Epoch Time and want to convert it to GMT or local time, here is the tool I used to do so:

    https://www.epochconverter.com/