Skip to content
登录 注册

基本请求

最简单的 Web Scraping API 调用只需要两个参数:您的 api_key 和目标 url。API 会返回该页面的原始 HTML,并附带一些描述该请求的自定义响应头。

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
参数类型是否必填说明
api_keystring您的 Web Scraping API 密钥
urlstring要抓取的目标 URL

API 会在每次成功抓取时添加一些以 WSA- 为前缀的响应头。

请求头说明
WSA-Client-Cookies目标页面加载完成后由 JavaScript 生成的 cookies。
WSA-Scraped-Headers被抓取的 URL 返回的响应头。
WSA-Scraped-Resolved-Url经过任何重定向后的最终 URL。
WSA-Call-Credit-Usage本次请求消耗的额度。
WSA-Current-Credit-Usage本次请求后您的总额度使用量。
Terminal window
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com"
<!doctype html>
<html>
<head>
<title>Example Domain</title>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>