# OLX Brasil Scraper — Ads, Prices & Listings (`bgfc97/olx-brasil-scraper`) Actor

🔥 Up to 30% OFF! Scrape OLX Brasil classifieds — no login. By search, category or ad URL: title, price, full specs & attributes, all images, seller, location (city, CEP, DDD, GPS) and total results. Fast HTTP, cheap. Perfect for market research & lead gen. ⚡

- **URL**: https://apify.com/bgfc97/olx-brasil-scraper.md
- **Developed by:** [Bruno](https://apify.com/bgfc97) (community)
- **Categories:** E-commerce, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.05 / 1,000 ad scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OLX Brasil Scraper — Listings, Prices, Specs & Sellers

Scrape **real classified ads** from **OLX Brasil (olx.com.br)** — search results *and* individual
ad pages — and get back **clean, fully-structured JSON**: title, price (and previous price), the
full description, **every attribute/spec** (car km & year, fuel, gearbox; phone storage, battery
health, condition; etc.), **all image URLs**, precise **location** (city, state, neighbourhood,
ZIP, area code), seller, category, publish date, and the **total number of matching ads** on OLX.

No login, no cookies, public data only. Fast and cheap: it uses a **single plain-HTTP request per
page** (no heavyweight headless browser) — just with a real Chrome TLS fingerprint so Cloudflare
lets it through.

### Why it's better than other OLX scrapers

- **Richest fields per ad.** Most scrapers return title/price/location. This one also returns the
  full **attribute list and a ready-to-use `specs` object** (e.g. `specs["Ano"]`, `specs["Quilometragem"]`
  for cars; `specs["Memória interna"]`, `specs["Saúde da bateria"]` for phones), **all photos**,
  seller info, neighbourhood + ZIP + area code, `oldPrice`, delivery/OLX-Pay flags and more — all
  straight from OLX's own data, no second request needed.
- **Cheaper to run.** Plain HTTP (~1 MB/page, ~1 s) instead of a 2 GB Chromium downloading megabytes
  of assets — less proxy bandwidth, less compute, faster runs.
- **Automatic pagination** up to your `maxItems`, plus the **`totalAdsAvailable`** count so you know
  how big the full result set is.
- **Honest.** If a page is ever blocked or its markup changes, the item carries an `error` field —
  it never invents a price, title or listing.

### Input

```json
{
  "search": ["iphone 13"],
  "category": "",
  "state": "sp",
  "sort": "relevance",
  "urls": [],
  "maxItems": 40,
  "maxConcurrency": 4,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "BR" }
}
```

- `search` — keywords, one per line. Each is its own search. Provide **at least one of `search` or `urls`**.
- `category` — optional OLX category path, e.g. `"celulares"` or `"autos-e-pecas/carros-vans-e-utilitarios"`.
- `state` — optional 2-letter UF (`"sp"`, `"rj"`, `"mg"`…), applied as OLX's `estado-<uf>` filter. (Alias: `location`.)
- `sort` — `relevance` (default), `date` (newest), `price` (cheapest), `biggest_price` (most expensive).
- `urls` — OLX **search URLs** (paginated automatically) or individual **ad URLs** (scraped in full detail).
- `maxItems` — total cap across all searches/URLs (default 40). It paginates until it hits this or runs out.
- `maxConcurrency` / `maxRetries` / `timeoutSecs` — tuning. Each retry rotates to a fresh residential IP.
- `includeRaw` — also attach OLX's raw ad object under `raw`.
- `proxyConfiguration` — **RESIDENTIAL is required** (datacenter IPs are hard-blocked by Cloudflare), defaults to Brazil.

### Output

**Search result** (`source: "search"`, one per ad):

```json
{
  "source": "search", "searchTerm": "iphone 13", "pageNumber": 1, "totalAdsAvailable": 15146,
  "listId": 1541146668, "title": "iPhone 13 Pro Max (impecável) + Acessórios Apple",
  "price": 3410, "priceText": "R$ 3.410", "oldPrice": null,
  "url": "https://sp.olx.com.br/.../iphone-13-pro-max-...-1541146668",
  "categoryName": "Celulares e Smartphones", "categoryId": "3060",
  "location": "São Paulo - SP", "city": "São Paulo", "state": "SP",
  "neighbourhood": "Santa Cecília", "ddd": "11",
  "publishedDate": "2026-10-04T23:29:52.000Z",
  "imageCount": 6, "thumbnail": "https://img.olx.com.br/images/84/848659930498343.jpg",
  "images": ["https://img.olx.com.br/..."],
  "specs": { "Marca": "APPLE", "Modelo": "IPHONE 13 PRO MAX", "Condição": "Usado - Excelente",
             "Memória interna": "256GB", "Cor": "Verde", "Saúde da bateria": "OK (60% até 79%)" },
  "attributes": [ { "name": "electronics_brand", "label": "Marca", "value": "APPLE" } ],
  "professionalAd": false, "olxPay": true, "olxDelivery": true, "extractionMethod": "json"
}
```

**Ad detail** (`source: "listing"`, from an individual ad URL): everything above **plus** `adId`,
full `description`, `seller` (`{ name, id, type, whatsapp, chatEnabled }`), `zipcode`, `latitude`/
`longitude` (when published), `parentCategoryName`, `firstPublishedDate`, `videos`, and
`categorySpecificData` (vehicle/real-estate blocks).

### How it works (and why residential is required)

OLX Brasil sits behind Cloudflare. Verified while building this Actor:

1. A **datacenter IP is blocked outright** (HTTP 403) — *even with* a perfect Chrome TLS fingerprint.
2. On a **residential IP**, a plain client with a **weak TLS fingerprint** (curl / Node) is still blocked.
3. On a **residential IP with a real-Chrome TLS fingerprint**, plain HTTP returns the full page.

So the Actor does a plain HTTP GET per page through Apify **residential** proxy with a real Chrome
TLS handshake, then reads the listing data straight from the page's embedded JSON (the Next.js RSC
stream on search pages; the `initial-data` blob on ad pages). No browser is launched.

### Pricing

Billed **per ad returned** (pay-per-event `ad`) — you only pay for real extracted listings, not for
pages, requests or errors.

# Actor input Schema

## `search` (type: `array`):

Keywords to search on OLX Brasil, one per line, e.g. "iphone 13". Each keyword becomes its own search (combined with Category / State / Sort if set). Provide at least one of "search" or "urls".

## `category` (type: `string`):

OLX category path/slug to restrict the search to, e.g. "celulares", "autos-e-pecas/carros-vans-e-utilitarios", or a deeper facet like "celulares/apple/iphone-13" (copy the path segment(s) after olx.com.br/ from a real category page). Combined with any keyword in "search"; ignored if empty.

## `state` (type: `string`):

Restrict results to a Brazilian state. A 2-letter state code (UF), e.g. "sp", "rj", "mg", is applied as OLX's own official "estado-<uf>" filter path. Anything else (a city/region name) isn't a guaranteed OLX path, so it is honestly appended as extra search text instead of a hard filter — check the "state"/"city" fields on each result to confirm. (Alias: "location".)

## `sort` (type: `string`):

How to order the search results (OLX's own sort).

## `urls` (type: `array`):

Direct olx.com.br URLs to open: either search-result URLs (e.g. https://www.olx.com.br/brasil?q=iphone+13 or https://www.olx.com.br/estado-sp?q=iphone+13) which get paginated like a keyword search, or individual ad/listing URLs (e.g. https://sp.olx.com.br/.../iphone-13-1234567890) which get opened and scraped in full detail. Provide at least one of "search" or "urls".

## `maxItems` (type: `integer`):

Maximum number of ads to return in total across all searches/URLs. The scraper paginates automatically until it reaches this cap or runs out of results.

## `maxConcurrency` (type: `integer`):

How many pages/ads to fetch in parallel. Higher is faster but uses more residential bandwidth at once.

## `maxRetries` (type: `integer`):

How many times to retry a request (each retry rotates to a fresh residential IP) before giving up on that page.

## `includeRaw` (type: `boolean`):

Also attach OLX's full raw ad object under "raw" on each item (larger output; useful if you need a field this Actor doesn't surface yet).

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. RESIDENTIAL is required and defaults to Brazil IPs — OLX Brasil sits behind Cloudflare and hard-blocks datacenter IPs outright (verified), even with a perfect browser TLS fingerprint.

## `timeoutSecs` (type: `integer`):

How long to wait for a single page to load before retrying it.

## Actor input object example

```json
{
  "search": [
    "iphone 13"
  ],
  "sort": "relevance",
  "maxItems": 40,
  "maxConcurrency": 4,
  "maxRetries": 4,
  "includeRaw": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  },
  "timeoutSecs": 60
}
```

# Actor output Schema

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "search": [
        "iphone 13"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "BR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bgfc97/olx-brasil-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "search": ["iphone 13"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "BR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bgfc97/olx-brasil-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "search": [
    "iphone 13"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}' |
apify call bgfc97/olx-brasil-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bgfc97/olx-brasil-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mhp9loI9b1vr6pagR/builds/7vPYpwc8xnBL3o4Pe/openapi.json
