For the complete documentation index, see llms.txt. This page is also available as Markdown.

网页爬虫API

学习使用 网页爬虫API,并抓取你需要的任何公开网站。查找代码示例、参数用法、本地化、目标等更多内容。

网页爬虫API 是一个 一体化网页数据采集解决方案 专为从任何公开网站大规模提取实时数据而设计。它覆盖网页抓取的每个阶段,从爬取 URL 和绕过 IP 封锁,到数据解析以及交付到你首选的存储,因此你无需管理代理、解封或基础设施。

该工具的构建符合企业安全标准,包括 SOC 2 Type II 合规,并提供可快速适应的基础设施,能够动态调整以适配目标网站,确保在搜索引擎、电商网站、旅游平台等场景中具有高成功率和可靠的数据提取。

开始使用

创建你的 API 用户凭证:在 Oxylabs 仪表盘 中注册免费试用或购买产品,以创建你的 API 用户凭证(USERNAMEPASSWORD).

请求示例

该 API 作为其集成基础设施的一部分,会自动处理代理轮换、请求重试和反爬绕过,因此只需一次请求即可检索所有结构化数据。

下面你会找到示例 cURL 请求。其他编程语言的示例,请参考相关章节: 亚马逊, 谷歌, 其他网站.

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
    }'

我们的示例使用同步 Realtime 集成方式。如果你想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参考 集成方式 部分。

请求参数值

  1. source - 该参数设置用于处理请求的爬虫。

  2. URLquery - 为你想抓取的页面类型提供 URLquery 。请参考下表及对应的目标子页面,了解各参数的使用场景。

  3. 你也可以选择添加其他参数,例如 geo_location, user_agent_type, parse (我们的解析器列表见 这里), render 等,以自定义你的抓取请求。了解更多: 功能.

- 必填参数

使用 URL 或参数化输入进行抓取

Oxylabs 支持两类通用输入:URL 和参数化输入,例如查询、产品 ID 或视频 ID。 通用目标 如果没有专用 source,可以使用 universal source 进行抓取。

目标
来源(抓取 URL)
来源(使用查询、产品或视频 ID)

亚马逊

amazon_product,

amazon_search,

amazon_pricing,

amazon_sellers,

amazon_bestsellers

谷歌

google_search,

google_ads,

google_ai_mode,

google_lens,

google_maps,

google_travel_hotels,

google_trends_explore,

google_shopping_product,

google_shopping_search

bing

bing_search

universal

youtube_search,

youtube_search_max,

youtube_video_trainability,

youtube_download,

youtube_transcript,

youtube_subtitles,

youtube_metadata,

youtube_channel,

youtube_autocomplete

universal

chatgpt

universal

perplexity

walmart

walmart_search,

walmart_product

universal

tiktok_shop_search,

tiktok_shop_product

ebay

ebay_search,

ebay_product

etsy

etsy_search,

etsy_product

universal

bestbuy_search,

bestbuy_product

bedbathandbeyond

bedbathandbeyond_search, bedbathandbeyond_product

bodegaaurrera

bodegaaurrera_search, bodegaaurrera_product

instacart

instacart_search, instacart_product

kroger

kroger_search,

kroger_product

lowes

lowes_search,

lowes_product

publix

publix_search, publix_product

target

target_search,

target_product,

target_category

grainger

grainger_search, grainger_product

costco

costco_search,

costco_product

menards

menards_search, menards_product

universal

petco_search

universal

staples_search

universal

allegro_search,

allegro_product

universal

idealo_search

mediamarkt

mediamarkt_search, mediamarkt_product

cdiscount

cdiscount_search, cdiscount_product

alibaba

alibaba_search, alibaba_product

aliexpress

aliexpress_search, aliexpress_product

indiamart

indiamart_search, indiamart_product

universal

avnet_search

lazada

lazada_search, lazada_product

universal

rakuten_search

universal

tokopedia_search

flipkart

flipkart_search, flipkart_product

universal

mercadolibre_search

universal

mercadolivre_search

magazineluiza

magazineluiza_search, magazineluiza_product

falabella

falabella_search, falabella_product

universal

dcard_search

airbnb

airbnb_product

zillow

使用 query 不支持参数

universal

使用 query 不支持参数

如果您需要帮助进行首次请求或优化配置,我们的 24/7 专家支持团队可通过在线聊天提供服务。

通过 Web Scraper API Playground 进行测试

试用 网页爬虫APIOxyCopilotWeb Scraper API Playground.

通过 Postman 测试

使用 Postman 开始使用我们的 API,Postman 是一个用于发起 HTTP 请求的便捷工具。下载我们的 网页爬虫API Postman 集合 并导入它。此集合包含演示爬虫功能的示例。可根据你的需求自定义这些示例,或立即开始抓取。

如需逐步说明,请观看下面的视频教程。如果你是 Postman 新手,请查看这个简短的 指南.

本文所含所有信息均按“原样”提供,仅供参考。对于您使用本页所含任何信息,我们不作任何声明,并且不承担任何责任。在进行任何形式的抓取活动之前,您应咨询法律顾问,并仔细阅读相关网站的服务条款或获取抓取许可。

最后更新于

这有帮助吗?