网页爬虫 API (Web Scraper API)
网页爬虫API 是一个 一体化网页数据采集平台。它涵盖了网页爬取的各个阶段,从抓取URL和绕过IP封锁到精确的数据解析并交付到您首选的云存储。可从以下来源提取数据: 搜索引擎, 电商网站, 旅游平台,以及 任何其他网站。
快速开始
创建您的 API 用户凭证:在 Oxylabs 仪表板 注册试用或购买产品以创建您的 API 用户凭证(USERNAME 和 PASSWORD).
如果您的账户需要不止一个 API 用户,请联系我们的 客户支持 或通过我们的 24/7 在线聊天支持留言。
请求示例
下面是示例的 cURL 请求。有关其他编程语言的示例,请参阅相关部分: Amazon, Google, 其他网站.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user "USERNAME:PASSWORD" \
-H "Content-Type: application/json" \
-d '{
"source": "amazon_product",
"query": "B07FZ8S74R",
"geo_location": "90210",
"parse": true
}'curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "google_search",
"query": "adidas",
"geo_location": "California,United States",
"parse": true
}'curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "universal",
"url": "https://sandbox.oxylabs.io/"
}'在我们的示例中,我们使用同步的 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步的 Push-Pull 集成,请参阅 集成方法 部分。
请求参数值
source - 此参数设置将用于处理您的请求的爬虫。
URL 或 query - 提供
URL或query以指定您想要抓取页面的类型。请参阅下表及相应的目标子页面,了解何时使用每个参数的详细指南。
- 必填参数
使用 URL 或参数化输入进行抓取
Oxylabs 支持两类通用输入 — URL 和参数化输入,例如查询、商品或视频 ID。 通用目标 没有专用来源的可使用 universal 源进行抓取。
google
google_search,
google_ads,
google_ai_mode,
google_lens,
google_maps,
google_travel_hotels,
google_suggest,
google_trends_explore,
google_shopping_product,
google_shopping_search
universal
youtube_search,
youtube_search_max,
youtube_video_trainability,
youtube_download,
youtube_transcript,
youtube_subtitles,
youtube_metadata,
youtube_channel,
youtube_autocomplete
通过 Scraper APIs Playground 进行测试
尝试 网页爬虫API 和 OxyCopilot 在 Scraper APIs Playground.
通过 Postman 进行测试
使用 Postman 开始使用我们的 API,Postman 是一个用于发起 HTTP 请求的便捷工具。下载我们的 网页爬虫 API Postman 集合 并导入。该集合包含演示爬虫功能的示例。根据需要自定义示例或直接开始抓取。
有关逐步说明,请观看下面的视频教程。如果您是 Postman 新手,请查看这篇简短的 指南.
最后更新于
这有帮助吗?

