crawlbase文档
登录

用法

将 OLX 搜索或类目 URL 连同 scraper=olx-serp 参数发送到 Crawling API。该 scraper 覆盖 OLX 共享的前端,因此同一个 scraper 名称可用于所有市场 - 仅请求 URL 中的域名不同。

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.olx.pl/motoryzacja/samochody/' \
  --data-urlencode 'scraper=olx-serp' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.olx.pl/motoryzacja/samochody/',
    {'scraper': 'olx-serp'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://www.olx.pl/motoryzacja/samochody/',
  { scraper: 'olx-serp' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.olx.pl/motoryzacja/samochody/', scraper: 'olx-serp')
data = JSON.parse(res.body)

示例输入 URL

任意 OLX 搜索、类目或查询结果页。以下是跨 OLX 市场的若干示例:

https://www.olx.pl/motoryzacja/samochody/
https://www.olx.pl/nieruchomosci/mieszkania/wynajem/
https://www.olx.pl/oferty/q-iphone-15/
https://www.olx.ua/uk/list/
https://www.olx.pt/imoveis/
https://www.olx.ro/auto-masini-moto-ambarcatiuni/

olx-serp scraper 适用于 OLX 共享的前端,涵盖 olx.plolx.uaolx.ptolx.roolx.bgolx.kzolx.uz - 仅请求 URL 中的 TLD 不同。OLX 会对数据中心 IP 限速,但代理池无需你自行选择 - Crawling API 默认通过其住宅网络路由,并为每个请求自动选择最佳出口节点。仅当你需要特定市场的地理定位时,才传入 country=(例如 olx.pl 使用 country=PL)。

响应

scraper 返回一个描述结果页的 JSON 对象以及一个广告的 items 数组。

url
string
被抓取的结果页 URL。
categoryId
integer | null
结果页的 OLX 类目 ID(若存在)。
page
integer | null
当前结果页的从零开始的索引。
totalPages
integer | null
此查询可用的结果页总数。
totalCount
integer | null
所有页面中匹配该查询的广告总数。
itemCount
integer
本页返回的广告数量(items 的长度)。
items
array
当前结果页上的广告数组。
items[].id
integer | null
OLX 广告 ID。
items[].title
string | null
广告标题。
items[].url
string | null
单条广告页的规范 URL。
items[].price
object
广告的价格对象。
items[].price.value
number | null
数值型价格。
items[].price.currency
string | null
ISO 货币代码(例如 PLNUAHEUR)。
items[].price.currencySymbol
string | null
显示的货币符号(例如 )。
items[].price.displayValue
string | null
OLX 上显示的、可读的格式化价格。
items[].price.negotiable
boolean
卖家是否将价格标记为可议价。
items[].price.free
boolean
广告是否标记为免费。
items[].price.exchange
boolean
卖家是否愿意以物换物而非现金交易。
items[].location
object
广告的位置对象。
items[].location.city
string | null
城市名称。
items[].location.region
string | null
地区、省或州名称。
items[].location.district
string | null
区或街区(若存在)。
items[].location.path
string | null
可读的位置路径(地区、城市、区)。
items[].location.latitude
number | null
大致纬度。
items[].location.longitude
number | null
大致经度。
items[].category
object
广告的类目对象。
items[].category.id
integer | null
广告的 OLX 类目 ID。
items[].category.type
string | null
类目类型 slug(例如 automotive)。
items[].createdTime
string | null
广告发布时间的 ISO 8601 时间戳。
items[].isPromoted
boolean
广告是否为付费/推广广告。
items[].isHighlighted
boolean
广告是否在结果中被视觉高亮。
items[].isBusiness
boolean
广告是否由商家账户发布。
items[].thumbnailUrl
string | null
广告缩略图的 URL。

示例响应

{
  "url": "https://www.olx.pl/motoryzacja/samochody/",
  "categoryId": 4,
  "page": 0,
  "totalPages": 25,
  "totalCount": 1000,
  "itemCount": 2,
  "items": [
    {
      "id": 915581849,
      "title": "BMW 320d F30 2016 xDrive - pełen serwis",
      "url": "https://www.olx.pl/d/oferta/bmw-320d-f30-2016-xdrive-IDABC12.html",
      "price": {
        "value": 45900,
        "currency": "PLN",
        "currencySymbol": "zł",
        "displayValue": "45 900 zł",
        "negotiable": true,
        "free": false,
        "exchange": false
      },
      "location": {
        "city": "Warszawa",
        "region": "Mazowieckie",
        "district": "Mokotów",
        "path": "Mazowieckie, Warszawa, Mokotów",
        "latitude": 52.2297,
        "longitude": 21.0122
      },
      "category": {
        "id": 4,
        "type": "automotive"
      },
      "createdTime": "2026-07-18T10:24:55+02:00",
      "isPromoted": true,
      "isHighlighted": false,
      "isBusiness": true,
      "thumbnailUrl": "https://ireland.apollo.olxcdn.com:443/v1/files/765inat2qu8k1-PL/image;s=1024x768"
    },
    {
      "id": 927067590,
      "title": "Audi A4 B9 2.0 TDI 2017 - bezwypadkowy",
      "url": "https://www.olx.pl/d/oferta/audi-a4-b9-20-tdi-2017-IDDEF34.html",
      "price": {
        "value": 62000,
        "currency": "PLN",
        "currencySymbol": "zł",
        "displayValue": "62 000 zł",
        "negotiable": false,
        "free": false,
        "exchange": false
      },
      "location": {
        "city": "Kraków",
        "region": "Małopolskie",
        "district": null,
        "path": "Małopolskie, Kraków",
        "latitude": 50.0647,
        "longitude": 19.945
      },
      "category": {
        "id": 4,
        "type": "automotive"
      },
      "createdTime": "2026-07-16T09:12:41+02:00",
      "isPromoted": false,
      "isHighlighted": false,
      "isBusiness": false,
      "thumbnailUrl": "https://ireland.apollo.olxcdn.com:443/v1/files/c0riwdwc88q11-PL/image;s=1024x768"
    }
  ]
}