# OLX Brazil Listings Scraper (`devilscrapes/olx-brazil-scraper`) Actor

Search OLX Brazil (olx.com.br) classifieds by keyword and collect structured listings -- titles, prices, locations, categories, and images -- across paginated results in one clean dataset per query, no manual city-by-city browsing.

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

## Pricing

from $2.80 / 1,000 result emitteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## OLX Brazil Listings Scraper

**💰 $3.00 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Search OLX Brazil (olx.com.br) classifieds by keyword and collect structured listings -- titles, prices, locations, categories, and images -- across paginated results in one clean dataset per query, no manual city-by-city browsing.

</div>

***

### 🎯 What this scrapes

Search OLX Brazil (olx.com.br) by keyword and get one row per listing card -- title, price, canonical URL, region, location, category and image -- across every page the search returns, deduplicated by listing id. Point it at as many keywords as you like; each one runs its own paginated search.

### 🔥 What we handle for you

- 🛡️ **Browser fingerprint rotation** -- `curl-cffi` impersonates real Chrome / Firefox / Safari TLS handshakes on every request.
- 🔁 **Retries with exponential backoff** on `408 / 429 / 503` -- up to 5 attempts per page, `Retry-After` honoured.
- 🌎 **Apify Proxy pinned to Brazil** (`apifyProxyCountry: BR`) on every request, regardless of what you pass in.
- 🧠 **JSON-first parsing** -- reads the page's own embedded listings data first, falling back to DOM parsing only if that's missing, so a markup tweak on OLX's side doesn't silently break your dataset.
- 🧊 **Clean, typed dataset rows** -- Pydantic-validated, ISO-8601 timestamps, deduplicated listing ids, JSON / CSV / Excel export straight from the Apify Console.
- 💰 **Pay-Per-Event pricing** -- you only pay for results that hit your dataset. No data, no charge.

### 💡 Use cases

- Price intelligence -- track asking prices for a product category across Brazilian regions.
- Reseller/arbitrage sourcing -- surface freshly listed items matching a keyword before they're gone.
- Market research -- measure listing volume and pricing spread for a search term over time.
- Lead generation -- find sellers or listings matching a niche keyword in a specific region.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `queries` | `array` | **yes** | \['notebook', 'iphone', 'bicicleta'] | Search terms; the Actor runs one paginated search per query against www.olx.com.br/brasil?q=. 1-20 entries, each 1-200… |
| `region` | `string` | no | '—' | Optional post-filter: keep only rows whose listing URL's regional subdomain equals this code (e.g. "ba", "sp", "rj").… |
| `maxPagesPerQuery` | `integer` | no | 5 | Upper bound on the number of o= pages walked per query before pagination stops. |
| `maxResultsPerQuery` | `integer` | no | 200 | Upper bound on unique listing ids collected per query before pagination stops. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': True, 'apifyProxyCountry': 'BR'} | Apify Proxy configuration. Country is pinned to Brazil (BR) server-side regardless of what's set here. |

#### Example input

```json
{
  "queries": [
    "notebook"
  ],
  "region": null,
  "maxPagesPerQuery": 1,
  "maxResultsPerQuery": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "BR"
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `listing_id` | `string` | Trailing numeric id of the listing URL slug. |
| `title` | `string` | Card title text. |
| `price_raw` | `string` | Verbatim price text, e.g. 'R$ 2.200'; null if the card carries no price. |
| `price_brl` | `number` | Numeric BRL parsed from price\_raw; null when unparseable (e.g. 'Gratis', 'A combinar'). |
| `url` | `string` | Canonical listing URL. |
| `region` | `string` | Regional subdomain segment parsed from url, e.g. 'ba'. |
| `location` | `string` | Card location text, e.g. 'Grande Salvador'. |
| `category_path` | `string` | URL path segments between region and slug, e.g. 'informatica/notebooks'. |
| `image_url` | `string` | Card thumbnail URL if present. |
| `posted_at_raw` | `string` | Verbatim posted/updated date text if the card shows one (e.g. 'Hoje'). |
| `query` | `string` | The queries entry that produced this row. |
| `page` | `integer` | The o= value the row was found on (1 = first page). |
| `scraped_at` | `string` | ISO-8601 UTC scrape timestamp. |

#### Example output

```json
{
  "listing_id": "1536511479",
  "title": "Notebook Acer Aspire 3 Ryzen 5 2500U 12GB RAM HD 1TB SSD 128GB",
  "price_raw": "R$ 2.200",
  "price_brl": 2200.0,
  "url": "https://ba.olx.com.br/grande-salvador/informatica/notebooks/notebook-acer-aspire-3-ryzen-5-2500u-12gb-ram-hd-1tb-ssd-128gb-1536511479",
  "region": "ba",
  "location": "Grande Salvador",
  "category_path": "informatica/notebooks",
  "image_url": "https://img.olx.com.br/images/xx/xxxxxxxxx.jpg",
  "posted_at_raw": null,
  "query": "notebook",
  "page": 1,
  "scraped_at": "2026-09-19T14:00:00Z"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.2 | One-off warm-up charge per run |
| `result` | $0.0028 | Per dataset item |

Example: 1 000 results at the rates above ≈ **$3.00**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Brazil only -- other OLX country sites (Poland, Indonesia, etc.) are out of scope.
- Search-result cards only -- no listing detail-page enrichment (full description, seller profile, phone/contact reveal) in v1.
- No login, authenticated seller actions, messaging, or saved searches.
- Requires at least one keyword in `queries` -- pure category/taxonomy browsing isn't supported.

### ❓ FAQ

**Is this legal?**

We only fetch content OLX Brazil's own search pages make publicly available, no login required. Respect OLX's terms of service before using output commercially.

**Can I limit results to one Brazilian state or city?**

Yes -- set the `region` input to the regional subdomain code (e.g. `"ba"`, `"sp"`, `"rj"`). Leave it empty to get every region.

**Why did I get fewer rows than `maxResultsPerQuery`?**

Pagination stops early once a page contributes zero new listing ids -- that means you've reached the end of that search's real results, not a bug.

**How do I export to Sheets?**

After the run, click *Storage -> Dataset -> Export* and pick CSV. Google Sheets imports it directly.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Changelog

This Actor's version history is a separate document: https://apify.com/devilscrapes/olx-brazil-scraper/changelog.md

# Actor input Schema

## `queries` (type: `array`):

Search terms; the Actor runs one paginated search per query against <code>www.olx.com.br/brasil?q=</code>. 1-20 entries, each 1-200 characters.

## `region` (type: `string`):

Optional post-filter: keep only rows whose listing URL's regional subdomain equals this code (e.g. <code>"ba"</code>, <code>"sp"</code>, <code>"rj"</code>). Leave empty to return all regions.

## `maxPagesPerQuery` (type: `integer`):

Upper bound on the number of <code>o=</code> pages walked per query before pagination stops.

## `maxResultsPerQuery` (type: `integer`):

Upper bound on unique listing ids collected per query before pagination stops.

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

Apify Proxy configuration. Country is pinned to Brazil (<code>BR</code>) server-side regardless of what's set here.

## Actor input object example

```json
{
  "queries": [
    "notebook",
    "iphone",
    "bicicleta"
  ],
  "maxPagesPerQuery": 5,
  "maxResultsPerQuery": 200,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "queries": [
        "notebook",
        "iphone",
        "bicicleta"
    ],
    "maxPagesPerQuery": 5,
    "maxResultsPerQuery": 200,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "BR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/olx-brazil-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 = {
    "queries": [
        "notebook",
        "iphone",
        "bicicleta",
    ],
    "maxPagesPerQuery": 5,
    "maxResultsPerQuery": 200,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "BR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/olx-brazil-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 '{
  "queries": [
    "notebook",
    "iphone",
    "bicicleta"
  ],
  "maxPagesPerQuery": 5,
  "maxResultsPerQuery": 200,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}' |
apify call devilscrapes/olx-brazil-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/olx-brazil-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/bxyEUMJQC2eTnd1sW/builds/N0V27wypVK21nYSup/openapi.json
