网页爬虫API

了解如何使用网页爬虫API爬取你需要的任何公开网站。查找代码示例、参数用法、地域化、目标站点等更多内容。

网页爬虫APIarrow-up-right 是一个 一体化网页数据采集平台。它涵盖网页爬取的每个阶段,从抓取 URL 和绕过 IP 封锁,到精确解析数据并将其传送到您偏好的云存储。从 搜索引擎, 电商网站, 旅行平台,以及 任何其他网站中提取数据。

开始使用

创建您的 API 用户凭证:注册免费试用,或在 Oxylabs 控制台arrow-up-right 中购买产品,以创建您的 API 用户凭证(USERNAMEPASSWORD).

circle-exclamation

请求示例

下面您会找到 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
    }'

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

请求参数值

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

  2. URLquery - 请提供 URLquery ,以对应您想要爬取的页面类型。请参阅下表及对应的目标子页面,了解何时使用每个参数的详细说明。

  3. 可选地,您还可以包含其他参数,例如 geo_location, user_agent_type, parse (查看我们的解析器列表 这里), render 以及更多参数,以自定义您的爬取请求。了解更多: 功能.

- 必填参数

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

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

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

amazon

amazon_product,

amazon_search,

amazon_pricing,

amazon_sellers,

amazon_bestsellers

google

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 参数不受支持

circle-info

如果您在发起第一次请求时需要任何帮助,欢迎通过全天候在线聊天联系我们。

通过 Scraper APIs Playground 进行测试

网页爬虫APIarrow-up-rightOxyCopilotarrow-up-right 中尝试 Web Scraper API Playgroundarrow-up-right.

通过 Postman 进行测试

使用 Postman 开始使用我们的 API,这是一款用于发送 HTTP 请求的便捷工具。下载我们的 Web Scraper API Postman 集合arrow-up-right 并导入。该集合包含演示爬虫功能的示例。您可以根据需要自定义示例,或立即开始爬取。

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

circle-info

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

最后更新于

这有帮助吗?