查询免费API,IP阻止

查询免费API,IP阻止

问题描述:

I am using some API which is free. I am using PHP script which is using fopen to download JSON from API. When I make to many requests(eg. 2 requests every minute) API is blocking my PHP server IP. Is there a way to solve it and possibility to make more requests (I don't want to DDoS attack)? Is there better solution than use of many PHP servers with different IP's?

我正在使用一些免费的API。 我正在使用PHP脚本,它使用fopen从API下载JSON。 当我发出许多请求(例如,每分钟2个请求)时,API阻止了我的PHP服务器IP。 有没有办法解决它和可能性 提出更多请求(我不想进行DDoS攻击)? 有没有比使用不同IP的许多PHP服务器更好的解决方案? p> div>

This is a quite abstract question as we don't know the actual api you are talking about.

But, usually, if an api implement a rate limit, it shows this kind of header in it's answer:

  • X-Rate-Limit-Limit: the rate limit ceiling for that given request
  • X-Rate-Limit-Remaining: the number of requests left for the 15 minute window
  • X-Rate-Limit-Reset: the remaining window before the rate limit resets in UTC epoch seconds

Please check the docs (this one is from twitter, https://dev.twitter.com/rest/public/rate-limiting).