# 如何运作的?
如果要在代理后面使用爬取API,请参考文档 Smart AI Proxy (打开新窗口) (opens new window) product. If you do not want to purchase a Smart AI Proxy subscription or you want to use all the features of the Crawling API 没有限制和更高的速率限制,那么请继续阅读下一段。
全部内容 Crawling API 在代理模式下调用应该转到 smartproxy.crawlbase.com using your access token as a proxy username. You can use either HTTPS (port 8001, recommended) or HTTP (port 8000) depending on your needs. Notice that these ports are different than the ports used in the Smart AI Proxy, so make sure to use the correct ports. Everything else that is referred in the Smart AI Proxy documentation stays the same.
因此,你的第一个通话非常简单,只需在终端中运行以下几行代码之一即可。快来尝试一下吧!
使用 HTTPS(推荐):
curl -x "https://[email protected]:8001" -k "https://httpbin.org/ip"
使用 HTTP 替代方案:
curl -x "http://[email protected]:8000" -k "https://httpbin.org/ip"
要执行 JavaScript 请求(无头浏览器)而不是普通请求,请继续在终端中尝试以下操作:
使用 HTTPS(推荐):
curl -x "https://[email protected]:8001" -k "https://httpbin.org/ip"
使用 HTTP 替代方案:
curl -x "http://[email protected]:8000" -k "https://httpbin.org/ip"
# 速率限制
默认情况下 Crawling API 代理模式下的速率限制为每秒 20 个请求(每天 1.728M 个请求)。如果您的代理管理解决方案使用的是并发请求/线程而不是每秒请求,则需要注意的是,每秒 20 个请求通常会转换为更多的并发请求。例如,如果您使用 crawlbase 爬取亚马逊,平均请求需要大约 4 秒,因此每秒 20 个请求会转换为 80 个并发线程。如果您正在爬取的网站响应很快,那么您需要的并发请求就更少。如果您达到并发请求的限制,请 联系支持 (打开新窗口) (opens new window) 与您的用例一起增加您的并发性。
← 数据刮板 尝试 Crawling API →