# OLX Brasil Scraper — Classified Listings (`noahadler/olx-brasil`) Actor

Scrape OLX Brasil (olx.com.br) classified search results: title, price BRL, city, UF, neighborhood, category, detail URL and image. Clean BR schema — no phone harvesting. HTTP-only; default RESIDENTIAL + BR.

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

## Pricing

from $1.50 / 1,000 ads

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

## OLX Brasil Scraper — Classified Listings

**OLX Brasil** (olx.com.br) classified search results — title, price (BRL), city, UF, neighborhood, category, detail URL, image and professional-seller flag — one Dataset row per ad.

HTTP-only (`curl_cffi` + Chrome TLS). Parses classic **`__NEXT_DATA__` / pageProps** when present, and the current App Router **`__next_f` RSC `"ads"`** payload used by listing-next.

> **Proxy:** Cloudflare often returns **403** from datacenter IPs. This Actor defaults to **Apify RESIDENTIAL + country BR**. Without that, expect an honest soft-fail error row — never fake listings.
>
> **No phone harvesting.** Public listing fields only. This is a clean BR classifieds schema (chollazos angle vs bloated all-in-one actors).

**Portfolio:** #41 · **version:** `0.1` · no Playwright in v0.1

### Input

| Field | Description |
|-------|-------------|
| `query` | Search keyword (`?q=`). Required unless `searchUrl` is set |
| `searchUrl` | Optional full `olx.com.br` results URL (pagination via `?o=N`) |
| `state` | Optional UF code → `/estado-{uf}/` (e.g. `sp`, `rj`) |
| `category` | Optional category slug (e.g. `celulares`, `autos-e-pecas/carros-vans-e-utilitarios`) |
| `maxItems` | 1–200 (default 40) |
| `proxyConfiguration` | Default RESIDENTIAL + BR |

Example URLs built from input:

- Nationwide: `https://www.olx.com.br/brasil?q=iphone`
- State: `https://www.olx.com.br/estado-sp?q=iphone`
- State + category: `https://www.olx.com.br/estado-sp/celulares?q=iphone`
- Page 2+: `?o=2`

### Output example

```json
{
  "listingId": "1512304345",
  "title": "IPHONE 17 PRO MAX 256GB",
  "price": 7680,
  "currency": "BRL",
  "city": "Belo Horizonte",
  "state": "MG",
  "neighborhood": "Bonfim",
  "category": "Celulares e Smartphones",
  "detailUrl": "https://mg.olx.com.br/belo-horizonte-e-regiao/celulares/iphone-17-pro-max-256gb-1512304345",
  "imageUrl": "https://img.olx.com.br/images/65/656690896664222.jpg",
  "isProfessional": false,
  "query": "iphone",
  "scrapedAt": "2026-09-22T16:00:00Z",
  "error": false,
  "errorMessage": null
}
```

On Cloudflare / 403 the Actor pushes one row with `error=true` and a message telling you to enable RESIDENTIAL BR (or consider DROP if that already failed).

### Limitations

- Residential BR is recommended for reliable runs.
- If still blocked after correct residential BR — **DROP**, do not rewrite endlessly.
- No detail-page enrichment and **no seller phone numbers** in v0.1.
- Category/UF path order follows `/estado-{uf}/{category}`; paste `searchUrl` if you need a different OLX path shape.

### Keywords

OLX Brasil, olx.com.br scraper, Brazil classifieds, anúncios Brasil, BRL listings, residential proxy BR, lead generation Brazil

# Actor input Schema

## `query` (type: `string`):

Keyword for OLX Brasil search (?q=). Required unless you provide searchUrl. Example: iphone, apartamento, gol g5.

## `searchUrl` (type: `string`):

Paste any olx.com.br search/results URL. When set, it is used as the base (query/state/category are ignored for path building; pagination still applies via ?o=N).

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

Optional Brazilian UF code for /estado-{uf}/. Examples: sp, rj, mg.

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

Optional category path slug, e.g. celulares, autos-e-pecas/carros-vans-e-utilitarios, imoveis/venda/apartamentos.

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

Maximum ads to return (1–200). Paginated via ?o=N (~50 listings per page).

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

Recommended for OLX Brasil. Default: Apify RESIDENTIAL. If country is empty, the Actor injects apifyProxyCountry=BR. Without residential BR, Cloudflare often returns 403.

## Actor input object example

```json
{
  "query": "iphone",
  "state": "sp",
  "maxItems": 40,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}
```

# Actor output Schema

## `listings` (type: `string`):

No description

# 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 = {
    "query": "iphone",
    "state": "sp"
};

// Run the Actor and wait for it to finish
const run = await client.actor("noahadler/olx-brasil").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 = {
    "query": "iphone",
    "state": "sp",
}

# Run the Actor and wait for it to finish
run = client.actor("noahadler/olx-brasil").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 '{
  "query": "iphone",
  "state": "sp"
}' |
apify call noahadler/olx-brasil --silent --output-dataset

```

## MCP server setup

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

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/dmiigkDALOsvyvMa0/builds/jZGRNercalrEjS1c2/openapi.json
