简体   繁体   English

Github API 速率限制细节

[英]Github API rate limit specifics

I am trying to find some specific details on the Github API rate limit.我正在尝试查找有关 Github API 速率限制的一些具体细节。 I have seen many different places suggesting 5000 requests per hour, but I have been limited to 30 according to my response headers .我见过许多不同的地方建议每小时 5000 个请求,但根据我的响应标头,我被限制为 30 个。 I have looked at a couple other questions related to github rate limits but haven't found any specifics on them.我查看了与 github 速率限制相关的其他几个问题,但没有找到任何细节。

I authenticate my requests with OAUTH in the headers .在 headers 中使用 OAUTH验证我的请求。

I recieve Error: Request failed with status code 403 which according to the docs means I'm authenticated.我收到Error: Request failed with status code 403 ,根据文档,这意味着我已通过身份验证。

What I would like to know is:我想知道的是:

  • What are the different rate limits?有哪些不同的速率限制?
  • Why would I receive 30/hour while someone else may have 5000/hour?为什么我会收到 30/小时,而其他人可能有 5000/小时?
  • How do I increase it?我该如何增加它?

You are likely seeing a reduced rate limit because you are not successfully authenticating.由于您未成功进行身份验证,您可能会看到降低的速率限制。 You may be providing credentials, but those credentials are not correct, don't have the right scopes, or are otherwise not valid for the resources you're requesting.您可能提供了凭据,但这些凭据不正确,没有正确的范围,或者对您请求的资源无效。 If you're accessing public information, then you'd get access to that data anyway even without authenticating, so your invalid credentials wouldn't matter but would result in a reduced rate limit.如果您正在访问公共信息,那么即使没有进行身份验证,您也可以访问该数据,因此您的无效凭据无关紧要,但会导致速率限制降低。

The reason GitHub provides different rate limits for authenticated and unauthenticated users is to prevent abuse and make it possible to contact users who are engaging in excessive or unacceptable behaviors. GitHub 为经过身份验证和未经身份验证的用户提供不同速率限制的原因是为了防止滥用,并可以联系从事过度或不可接受行为的用户。 For example, if a bot account or OAuth app is causing problems, the maintainer of that service can be contacted, and in an emergency, that account can be prevented from accessing the API until it can be fixed so as not to impact other users.例如,如果机器人帐户或 OAuth 应用程序出现问题,则可以联系该服务的维护者,并且在紧急情况下,可以阻止该帐户访问 API,直到可以修复它以免影响其他用户。

You can, as the documentation mentions, get an increased rate limit for the API by successfully authenticating.如文档所述,您可以通过成功验证来提高 API 的速率限制。 You haven't provided any details about what you're requesting or what scopes you've asked for, so we can't help there;您尚未提供有关您所要求的内容或所要求的范围的任何详细信息,因此我们无法提供帮助; you'll probably want to ask another question with more details.您可能想问另一个更详细的问题。 Beyond the limit of 5000 requests, you'd have to ask GitHub Support, although that is a relatively generous limit.超过 5000 个请求的限制,您必须询问 GitHub 支持,尽管这是一个相对宽松的限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM