# OLX Brazil Scraper — Ads, Prices, Location & Seller Data (`haketa/olx-brasil-scraper`) Actor

Scrape OLX Brasil (olx.com.br) classified ads by keyword, category or URL. Get title, price, price drops, photos, location (city, neighbourhood, state, DDD), attributes, vehicle specs, market-price benchmarks and seller data. Export to JSON/CSV/Excel for price monitoring, leads and market research.

- **URL**: https://apify.com/haketa/olx-brasil-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** E-commerce, Real estate, Lead generation
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

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

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## OLX Brazil Scraper — Ads, Prices, Location & Seller Data

Extract structured classified-ad data from **OLX Brasil ([olx.com.br](https://www.olx.com.br))**, the largest marketplace for buying and selling new and used goods in Brazil. Search by keyword, narrow down by category, or paste any OLX search URL, and get clean, ready-to-use data for every ad: **title, price, price drops, photos, location (city, neighbourhood, state, area code), product attributes, vehicle specs, market-price benchmarks and seller information**.

No code, no login, no browser extensions. Run it from the Apify Console, on a schedule, or call it from your own app through the API. Results download as **JSON, CSV, Excel, HTML or XML**, or sync straight into Google Sheets, Airtable, Make, Zapier and n8n.

---

### 📋 What this scraper does

OLX Brasil lists tens of millions of ads across cars, motorcycles, real estate, electronics, phones, home & furniture, fashion, jobs, services and more. This actor turns those search-result pages into a structured dataset you can analyse, monitor or feed into another system.

Give it one or more search terms (for example `iphone 13`, `honda civic`, `apartamento aluguel`), and it will:

- ✅ Collect every ad from the search results, page after page
- ✅ Return the **numeric price** plus the original price text, and flag ads with a **price reduction**
- ✅ Break the location into **city, neighbourhood, state (UF) and DDD area code**
- ✅ Capture **category-specific attributes** — brand, model, condition, storage, colour, mileage, fuel, number of rooms, and dozens more depending on the category
- ✅ Save **all photo URLs** for each ad
- ✅ Tell you whether the seller is a **private individual or a professional/business** account
- ✅ Optionally open each ad to pull the **full description, seller details, vehicle specifications and vehicle market-price benchmarks**

Everything is de-duplicated by ad ID, so you never get the same listing twice in a run.

---

### ⭐ Why choose this OLX scraper

Most OLX scrapers hand you a flat title and price. This one is built for analysis and automation:

- **Structured location, not a string.** Every ad is split into `city`, `neighbourhood`, `state (UF)` and `ddd` area code — ready to group, filter and map without extra cleanup.
- **Built-in price intelligence.** Get the numeric `price`, the previous price, and a `priceDropped` flag so you can track reductions and spot deals automatically.
- **Vehicle market-price benchmarks.** For cars and motorcycles, the optional details mode returns the **market low / median / high** for comparable vehicles plus the sample size — instantly see whether an ad is over- or under-priced.
- **Rich, category-aware attributes.** Phones come with storage, colour and battery health; cars with mileage, fuel and transmission; real estate with rooms and area — automatically, per category.
- **Private vs. professional sellers.** Separate dealerships and stores from individuals for clean lead lists or supply analysis.
- **Fast and economical.** Listing-only runs pull ~50 ads per page directly from search results, so a few hundred ads cost very little and finish in seconds.

---

### 💡 Popular use cases

| Use case | How this scraper helps |
| --- | --- |
| **Price monitoring & repricing** | Track asking prices for any product across Brazil, spot price drops, and benchmark your own listings. |
| **Reselling & arbitrage** | Find underpriced phones, electronics, car parts or collectibles the moment they are posted. |
| **Market research** | Measure supply, median prices and seller mix (private vs. professional) for any product or category. |
| **Automotive intelligence** | Pull car & motorcycle listings with mileage, fuel, transmission and a built-in **market-price range** to value any vehicle. |
| **Real-estate analysis** | Gather apartments and houses for sale or rent with location, attributes and price per region. |
| **Lead generation** | Build lists of professional sellers, dealerships and agencies by category and city for B2B outreach. |
| **Competitor tracking** | Watch how specific stores or sellers price and rotate their inventory over time. |
| **Dashboards & data products** | Feed a clean, normalised classified-ads feed into BI tools, spreadsheets or your own database. |

---

### 🚀 Quick start

1. Open the actor in the Apify Console.
2. In **Search queries**, type one or more keywords — for example `iphone`, `playstation 5`, `geladeira`.
3. (Optional) Set a **Category**, a **price range**, or a **Max items per search** limit.
4. Keep the default **Brazil residential proxy** turned on.
5. Click **Start**. Watch the live log fill up, then download your data from the **Storage → Dataset** tab.

That's it. For a first test, leave **Max items per search** at 100 and **Fetch ad details** off — you'll get a full page of clean listing data in under a minute.

---

### ⚙️ Input

| Field | Type | Description |
| --- | --- | --- |
| **Search queries** | array | Keywords to search on OLX, one search per keyword. e.g. `["iphone 13", "playstation 5"]`. |
| **Category slug** | string | Optional. Narrow every search to one OLX category, e.g. `eletronicos-e-celulares`, `autos-e-pecas`, `imoveis`. Leave empty for all categories. |
| **Start URLs** | array | Optional. Paste full OLX search/category URLs to scrape directly. The best way to target a **specific state, city, region or sort order** — apply those filters on olx.com.br, then copy the URL here. Overrides Search queries when set. |
| **Minimum price (BRL)** | integer | Only return ads at or above this price in Reais. |
| **Maximum price (BRL)** | integer | Only return ads at or below this price in Reais. |
| **Fetch ad details** | boolean | Open each ad for extra data: full description, seller name & type, vehicle specs and vehicle market-price benchmarks. Slower — leave off for fast listing collection. |
| **Max items per search** | integer | Maximum ads per keyword / start URL. Default `100`. |
| **Max total items** | integer | Global cap across all searches. `0` = unlimited. |
| **Proxy** | object | Proxy configuration. Brazilian residential proxy is enabled by default and strongly recommended. |

#### Example 1 — Simple keyword search

```json
{
  "searchQueries": ["iphone 13"],
  "maxItemsPerSearch": 200
}
````

#### Example 2 — Category + price range

```json
{
  "searchQueries": ["notebook"],
  "category": "informatica",
  "minPrice": 1500,
  "maxPrice": 4000,
  "maxItemsPerSearch": 300
}
```

#### Example 3 — Cars with full details and market-price benchmarks

```json
{
  "searchQueries": ["honda civic"],
  "category": "autos-e-pecas/carros-vans-e-utilitarios",
  "fetchDetails": true,
  "maxItemsPerSearch": 100
}
```

#### Example 4 — Scrape an exact OLX URL (state, city or custom sort)

```json
{
  "startUrls": [
    "https://www.olx.com.br/estado-sp/regiao-de-sao-paulo/imoveis/aluguel?q=apartamento"
  ],
  "maxItemsPerSearch": 500
}
```

> **Tip:** To scrape a specific state, city, region, or a custom sort order, just apply the filters you want on olx.com.br and copy the resulting address into **Start URLs**. The scraper paginates through it automatically.

***

### 📦 Output

Each ad becomes one dataset record. Example (keyword `iphone`):

```json
{
  "listId": "1514012963",
  "title": "iPhone 11 128gb",
  "price": 990,
  "priceText": "R$ 990",
  "oldPrice": null,
  "priceDropped": false,
  "category": "Celulares e Smartphones",
  "categoryId": "1020",
  "isProfessional": false,
  "isFeatured": false,
  "state": "RS",
  "city": "Porto Alegre",
  "neighbourhood": "Cristal",
  "ddd": "51",
  "locationLabel": "Porto Alegre - RS",
  "publishedAt": "2026-06-28T10:20:18.000Z",
  "imageUrl": "https://img.olx.com.br/images/30/308636299900579.jpg",
  "imageCount": 8,
  "images": [
    "https://img.olx.com.br/images/30/308636299900579.jpg",
    "https://img.olx.com.br/images/32/328684650980481.jpg"
  ],
  "attributes": {
    "Categoria": "Celulares e Smartphones",
    "Marca": "APPLE",
    "Modelo": "IPHONE 11",
    "Condição": "Usado - Bom",
    "Memória interna": "128GB",
    "Cor": "Preto",
    "Saúde da bateria": "OK (60% até 79%)"
  },
  "sellerGoogleRating": null,
  "hasOlxPay": true,
  "hasOlxDelivery": false,
  "url": "https://rs.olx.com.br/.../celulares/iphone-11-128gb-1514012963",
  "searchTerm": "iphone",
  "scrapedAt": "2026-06-30T12:00:00.000Z"
}
```

When **Fetch ad details** is enabled, each car/motorcycle/listing is also enriched with:

```json
{
  "sellerName": "Paulo",
  "sellerId": "b315d9f2-d061-4a98-8b99-bd6fd69b11c4",
  "sellerType": "Private",
  "description": "Vendo Opala 1980 Comodoro. Motor 4 cilindros, tudo funcionando...",
  "vehicleBrand": "Chevrolet",
  "vehicleModel": "Opala",
  "vehicleYear": "1980",
  "vehicleMileage": "85000",
  "vehicleFuel": "Álcool",
  "vehicleTransmission": "Manual",
  "vehicleBodyType": "Coupé",
  "vehicleDoors": "2 portas",
  "marketPriceMin": 9000,
  "marketPriceMedian": 30000,
  "marketPriceMax": 55000,
  "marketSampleSize": 11
}
```

#### Output fields

| Field | Description |
| --- | --- |
| `listId` | Unique OLX ad identifier (use it to de-duplicate across runs). |
| `title` | Ad title. |
| `price` | Price as a number, in BRL. `null` when the ad has no price ("a combinar"). |
| `priceText` | Price exactly as shown on OLX. |
| `oldPrice` | Previous price when the ad shows a reduction. |
| `priceDropped` | `true` when OLX flags the ad as price-reduced. |
| `category` / `categoryId` | Category name and OLX category ID. |
| `isProfessional` | `true` for professional/business sellers, `false` for private individuals. |
| `isFeatured` | `true` when the ad is promoted/featured. |
| `state` | Two-letter Brazilian state (UF). |
| `city` | Municipality. |
| `neighbourhood` | Neighbourhood. |
| `ddd` | Phone area code of the ad's region. |
| `locationLabel` | Location string as displayed on OLX. |
| `publishedAt` | Publication date (ISO 8601). |
| `imageUrl` | First / main photo URL. |
| `imageCount` | Number of photos. |
| `images` | Array of all photo URLs. |
| `attributes` | Object of category-specific attributes (brand, model, condition, mileage, rooms, etc.). |
| `sellerGoogleRating` | Seller's Google rating, when shown. |
| `hasOlxPay` / `hasOlxDelivery` | Whether OLX Pay / OLX Delivery are offered. |
| `url` | Direct link to the ad. |
| `sellerName`, `sellerId`, `sellerType` | Seller info *(with Fetch ad details)*. |
| `description` | Full ad description *(with Fetch ad details)*. |
| `vehicleBrand` … `vehicleDoors` | Vehicle specifications *(with Fetch ad details)*. |
| `marketPriceMin/Median/Max`, `marketSampleSize` | Vehicle market-price benchmark from comparable listings *(with Fetch ad details)*. |
| `searchTerm` | The keyword or URL that produced this record. |
| `scrapedAt` | Extraction timestamp. |

***

### 🗂️ Categories you can scrape

Use these slugs in the **Category** field, or as part of a Start URL. A few of the most popular OLX Brasil categories:

| Category | Slug |
| --- | --- |
| Cars, vans & utility vehicles | `autos-e-pecas/carros-vans-e-utilitarios` |
| Motorcycles | `autos-e-pecas/motos` |
| Auto parts & accessories | `autos-e-pecas/pecas-e-acessorios` |
| Real estate (all) | `imoveis` |
| Apartments for sale | `imoveis/venda/apartamentos` |
| Apartments for rent | `imoveis/aluguel/apartamentos` |
| Mobile phones | `eletronicos-e-celulares/celulares` |
| Electronics & phones (all) | `eletronicos-e-celulares` |
| Computers & accessories | `informatica` |
| Video games | `eletronicos-e-celulares/videogames` |
| Home & furniture | `para-a-sua-casa` |
| Appliances | `eletro` |
| Fashion & beauty | `moda-e-beleza` |
| Sports & leisure | `esportes-e-lazer` |
| Pets / animals | `agro-e-industria` |
| Music & hobbies | `musica-e-hobbies` |
| Jobs | `vagas-de-emprego` |
| Services | `servicos` |

Leave the Category empty to search across **all** categories at once.

***

### 🔎 Sample searches by use case

| Goal | Try a search like |
| --- | --- |
| Used phone pricing | `iphone 13`, `samsung galaxy s23`, `iphone` + category `eletronicos-e-celulares/celulares` |
| Car valuation | `honda civic`, `toyota corolla`, `jeep compass` + category `autos-e-pecas/carros-vans-e-utilitarios` + *Fetch ad details* |
| Motorcycle market | `honda cb 500`, `yamaha fazer` + category `autos-e-pecas/motos` |
| Apartment rentals | `apartamento` + category `imoveis/aluguel/apartamentos` + Start URL for the city |
| Gaming resale | `playstation 5`, `nintendo switch`, `xbox series` |
| Appliances | `geladeira`, `máquina de lavar`, `ar condicionado` |
| Furniture flips | `sofá`, `guarda roupa`, `mesa de jantar` |
| Dealer lead lists | any car/real-estate search → filter `isProfessional = true` |

You can pass several queries at once — they run as separate searches in a single run and land in the same dataset.

***

### 🧭 Tips for best results

- **Target a state or city** by applying the filter on olx.com.br and pasting the URL into **Start URLs** (e.g. `https://www.olx.com.br/estado-rj?q=bicicleta`). The scraper paginates through whatever URL you give it.
- **Custom sorting** (most recent, price ascending/descending) works the same way — choose it on the site and copy the URL.
- **Keep runs fast and cheap:** leave *Fetch ad details* off when you only need price, location and listing data. Turn it on only when you need full descriptions or vehicle specs.
- **Scale gradually:** start with `maxItemsPerSearch: 100`, confirm the data looks right, then raise the limit.
- **Multiple keywords** run as separate searches in a single run, so you can collect several products at once.
- A search returns roughly 50 ads per page; OLX limits very deep pagination, so extremely broad queries are best split by category or region.

***

### 🔌 Integrations & export

- **Download formats:** JSON, CSV, Excel, HTML, XML, RSS.
- **Google Sheets / Airtable / Make / Zapier / n8n:** push results automatically after each run.
- **API:** start runs and fetch the dataset programmatically with the Apify API or one of the official clients (JavaScript / Python).
- **Scheduling:** run the scraper hourly, daily or weekly to track prices and new listings over time.
- **Webhooks:** trigger your own services the moment a run finishes.

#### Run via API (example)

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR~olx-brasil-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "searchQueries": ["iphone 13"], "maxItemsPerSearch": 200 }'
```

***

### ❓ FAQ

**Do I need an OLX account or API key?**
No. You only need an Apify account and the proxy that ships with the actor.

**Why is the Brazil residential proxy on by default?**
OLX serves its content reliably to Brazilian visitors. The default Brazil residential proxy ensures pages load consistently. You can change proxy settings in the input, but the default is recommended.

**Can I scrape a specific state or city?**
Yes — apply the location filter on olx.com.br and paste the resulting URL into **Start URLs**. That is the most reliable way to scope results geographically.

**How many ads can I get per search?**
As many as the search returns, up to the limit you set. OLX caps very deep pagination, so for huge result sets, split the work by category, price band or region.

**Can I get the seller's phone number?**
OLX hides direct contact details behind its chat. This actor returns the seller's name, type (private/professional) and public profile ID when *Fetch ad details* is enabled, but not private phone numbers.

**How fast / how expensive is it?**
Listing-only runs are fast and inexpensive because the data comes straight from the search results. Enabling *Fetch ad details* opens one extra page per ad, so it is slower and uses more resources — enable it only when you need the extra fields.

**Does it return duplicates?**
No. Every ad is de-duplicated by its OLX ad ID within a run.

***

### ⚖️ Legal & responsible use

This actor collects **publicly available** information from OLX Brasil search pages — the same data any visitor can see without logging in. It does not bypass logins, access private messages, or collect personal contact details hidden behind OLX's chat.

You are responsible for how you use the data. Please:

- Respect OLX's Terms of Use and Brazil's data-protection law (LGPD).
- Use the data for lawful purposes such as price research, analytics and market intelligence.
- Do not use scraped personal data for spam or any purpose that infringes individual privacy.

If you have questions about compliance for your specific use case, consult a legal professional.

***

### 🛟 Support

Found a field you'd like added, a category that needs better coverage, or hit an issue? Open a ticket from the actor's **Issues** tab and include your input configuration — most requests are quick to address.

Happy scraping! 🇧🇷

### 📅 Changelog & Maintenance

**Last updated:** 2026-07-02 — Actor verified and maintained. Data pipeline tested for quality, structure and freshness; selectors/endpoints confirmed against the live site.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search on OLX Brasil, e.g. 'iphone', 'honda civic', 'apartamento'. Each query runs a separate search. Leave empty if you use Start URLs.

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

Optional OLX category to narrow the search, e.g. 'eletronicos-e-celulares', 'autos-e-pecas', 'imoveis'. Leave empty to search across all categories.

## `startUrls` (type: `array`):

Paste full OLX Brasil search/category/listing URLs to scrape directly. Best way to target a state, city, region or a specific sort order: apply those filters on olx.com.br, then copy the resulting URL here (e.g. https://www.olx.com.br/estado-sp/regiao-de-sao-paulo?q=geladeira). Overrides Search queries when provided.

## `minPrice` (type: `integer`):

Only return ads priced at or above this value (in Brazilian Reais). Leave empty for no minimum.

## `maxPrice` (type: `integer`):

Only return ads priced at or below this value (in Brazilian Reais). Leave empty for no maximum.

## `fetchDetails` (type: `boolean`):

Open each ad page for extra data: full description, seller name & type, vehicle specs (fuel, mileage, transmission) and vehicle market-price benchmarks. Slower and uses more proxy traffic — leave off for fast price/listing collection.

## `maxItemsPerSearch` (type: `integer`):

Maximum number of ads to collect per keyword / start URL. Default 100.

## `maxTotalItems` (type: `integer`):

Global cap across all searches. 0 = unlimited.

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

OLX Brasil requires Brazilian residential proxies to load reliably. Keep the default (Apify residential, Brazil) for best results.

## Actor input object example

```json
{
  "searchQueries": [
    "iphone 13",
    "playstation 5"
  ],
  "startUrls": [
    "https://www.olx.com.br/eletronicos-e-celulares/celulares?q=iphone"
  ],
  "fetchDetails": false,
  "maxItemsPerSearch": 100,
  "maxTotalItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "BR"
  }
}
```

# Actor output Schema

## `listId` (type: `string`):

OLX listing ID

## `title` (type: `string`):

Ad title

## `price` (type: `string`):

Numeric price in Reais

## `priceText` (type: `string`):

Price as shown on OLX

## `oldPrice` (type: `string`):

Previous price before a drop

## `priceDropped` (type: `string`):

Whether the ad shows a price reduction badge

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

Ad category name

## `categoryId` (type: `string`):

OLX category ID

## `isProfessional` (type: `string`):

Whether the seller is a professional/business account

## `isFeatured` (type: `string`):

Whether the ad is featured/promoted

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

Brazilian state

## `city` (type: `string`):

Municipality

## `neighbourhood` (type: `string`):

Neighbourhood

## `ddd` (type: `string`):

Area phone code

## `locationLabel` (type: `string`):

Location as shown on OLX

## `publishedAt` (type: `string`):

Ad publication date (ISO)

## `imageUrl` (type: `string`):

First image URL

## `imageCount` (type: `string`):

Number of photos

## `images` (type: `string`):

All image URLs

## `attributes` (type: `string`):

Category-specific attributes (brand, model, condition, etc.)

## `sellerGoogleRating` (type: `string`):

Seller's Google rating, if shown

## `hasOlxPay` (type: `string`):

Whether OLX Pay is available

## `hasOlxDelivery` (type: `string`):

Whether OLX Delivery is available

## `url` (type: `string`):

Ad detail page URL

## `sellerName` (type: `string`):

Seller name (with Fetch ad details)

## `sellerId` (type: `string`):

Seller public account ID (with Fetch ad details)

## `sellerType` (type: `string`):

Private or Professional (with Fetch ad details)

## `phoneVerified` (type: `string`):

Whether the seller's phone is verified (with Fetch ad details)

## `description` (type: `string`):

Full ad description (with Fetch ad details)

## `vehicleBrand` (type: `string`):

Vehicle brand (with Fetch ad details)

## `vehicleModel` (type: `string`):

Vehicle model (with Fetch ad details)

## `vehicleYear` (type: `string`):

Vehicle model year (with Fetch ad details)

## `vehicleMileage` (type: `string`):

Odometer reading (with Fetch ad details)

## `vehicleFuel` (type: `string`):

Vehicle fuel type (with Fetch ad details)

## `vehicleTransmission` (type: `string`):

Vehicle transmission (with Fetch ad details)

## `vehicleBodyType` (type: `string`):

Vehicle body type (with Fetch ad details)

## `vehicleDoors` (type: `string`):

Number of doors (with Fetch ad details)

## `marketPriceMin` (type: `string`):

Vehicle market price floor benchmark (with Fetch ad details)

## `marketPriceMedian` (type: `string`):

Vehicle market median price benchmark (with Fetch ad details)

## `marketPriceMax` (type: `string`):

Vehicle market price ceiling benchmark (with Fetch ad details)

## `marketSampleSize` (type: `string`):

Number of comparable vehicles in the benchmark (with Fetch ad details)

## `searchTerm` (type: `string`):

Query/URL used

## `scrapedAt` (type: `string`):

Extraction timestamp

# 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 = {
    "searchQueries": [
        "iphone"
    ],
    "maxItemsPerSearch": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "BR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/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 = {
    "searchQueries": ["iphone"],
    "maxItemsPerSearch": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "BR",
    },
}

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

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

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

```

## CLI example

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=haketa/olx-brasil-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OLX Brazil Scraper — Ads, Prices, Location & Seller Data",
        "description": "Scrape OLX Brasil (olx.com.br) classified ads by keyword, category or URL. Get title, price, price drops, photos, location (city, neighbourhood, state, DDD), attributes, vehicle specs, market-price benchmarks and seller data. Export to JSON/CSV/Excel for price monitoring, leads and market research.",
        "version": "0.1",
        "x-build-id": "BBajDZeumnvpmTJNr"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/haketa~olx-brasil-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-haketa-olx-brasil-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/haketa~olx-brasil-scraper/runs": {
            "post": {
                "operationId": "runs-sync-haketa-olx-brasil-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/haketa~olx-brasil-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-haketa-olx-brasil-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchQueries": {
                        "title": "Search queries",
                        "type": "array",
                        "description": "Keywords to search on OLX Brasil, e.g. 'iphone', 'honda civic', 'apartamento'. Each query runs a separate search. Leave empty if you use Start URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "category": {
                        "title": "Category slug (optional)",
                        "type": "string",
                        "description": "Optional OLX category to narrow the search, e.g. 'eletronicos-e-celulares', 'autos-e-pecas', 'imoveis'. Leave empty to search across all categories."
                    },
                    "startUrls": {
                        "title": "Start URLs (optional)",
                        "type": "array",
                        "description": "Paste full OLX Brasil search/category/listing URLs to scrape directly. Best way to target a state, city, region or a specific sort order: apply those filters on olx.com.br, then copy the resulting URL here (e.g. https://www.olx.com.br/estado-sp/regiao-de-sao-paulo?q=geladeira). Overrides Search queries when provided.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "minPrice": {
                        "title": "Minimum price (BRL)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return ads priced at or above this value (in Brazilian Reais). Leave empty for no minimum."
                    },
                    "maxPrice": {
                        "title": "Maximum price (BRL)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return ads priced at or below this value (in Brazilian Reais). Leave empty for no maximum."
                    },
                    "fetchDetails": {
                        "title": "Fetch ad details (slower, richer)",
                        "type": "boolean",
                        "description": "Open each ad page for extra data: full description, seller name & type, vehicle specs (fuel, mileage, transmission) and vehicle market-price benchmarks. Slower and uses more proxy traffic — leave off for fast price/listing collection.",
                        "default": false
                    },
                    "maxItemsPerSearch": {
                        "title": "Max items per search",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of ads to collect per keyword / start URL. Default 100.",
                        "default": 100
                    },
                    "maxTotalItems": {
                        "title": "Max total items",
                        "type": "integer",
                        "description": "Global cap across all searches. 0 = unlimited.",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "OLX Brasil requires Brazilian residential proxies to load reliably. Keep the default (Apify residential, Brazil) for best results.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "BR"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
