# OLX Portugal Scraper (`dadhalfdev/olx-portugal-scraper`) Actor

Scrape OLX Portugal (olx.pt) with your search URL and filters. Export structured listings: price, currency, city/region, photos, seller signals, promotions, and category params—site-accurate sort and pagination, up to 1k items per run for research or alerts.

- **URL**: https://apify.com/dadhalfdev/olx-portugal-scraper.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 69 total users, 11 monthly users, 96.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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 Portugal Scraper

Want to find deals on [OLX.pt](https://www.olx.pt/) or analyze the Portuguese classifieds market? This scraper makes it super easy!

Just **set your filters** (category, subcategory, location, price, tipologia, condition, seller type) and the scraper will extract up to **1000 listings** from any OLX Portugal category — imóveis, cars, tech, fashion, and more — neatly packing pricing, location, and seller details into a CSV or JSON file. No need to paste a search URL.

![OLX Website](https://i.ibb.co/9mcddVDq/Screenshot-From-2026-04-24-15-37-52.png)

### 💡 Perfect for...

- **Market Analysts:** Track pricing trends, availability, and demand across Portugal.
- **Resellers & Deal Hunters:** Monitor new listings to find underpriced items before anyone else.
- **Real Estate Pros:** Filter imóveis by typology, location, price, and private vs business sellers.
- **Auto & Electronics Buyers:** Browse cars, phones, and tech with structured condition filters.
- **🤖 AI Agents:** Power bots and OpenClaw workflows with real-time OLX.pt listings.
- **📚 RAG Systems:** Feed listing specs and prices into retrieval pipelines.
- **🔗 AI Workflows:** Plug into LangChain, AutoGPT, CrewAI, and similar stacks.

### ✨ Why you'll love this scraper

- 🎯 **Structured Filters:** Search by category, subcategory, location, query, price, tipologia, condition, and seller type — no URL crafting.
- 🏠 **Imóveis Ready:** Tipologia (T0–T6+) and location slugs work great for houses and apartments.
- 🔗 **Optional URL Override:** Prefer pasting a filtered OLX link? Use `search_url` (legacy `input_url` still works as an alias).
- ⚙️ **Rich Listings:** Price, location, seller signals, photos, and promotion flags from the GraphQL API.
- ⏱️ **Sorting Options:** Newest, recommended, cheapest, or most expensive — same labels as on olx.pt.
- 🇵🇹 **Built for Portugal:** Camoufox browser + cookie handling tuned for olx.pt.

### 📦 What's inside the data?

For every single listing, you will get:

- **Core Details:** `id`, `title`, `url`, `created_time`, `last_refresh_time`, `description`
- **Media:** `img_url` (first image) and `photos` (full list of high-res image links)
- **Pricing:** `price`, `currency`, `negotiable`
- **Location:** `city`, `district`, `region`
- **Seller Details:** `business`, `contact_name`, `contact_phone`, `contact_chat`, `shop_subdomain`
- **Item Specifics:** `category`, `state` (condition), and a clean `params` list
- **Visibility:** `highlighted`, `top_ad`, `urgent`, and other promotion flags

### 🛠️ Sort options

Use the `sort_by` parameter (Portuguese labels as on olx.pt):

- **Mais recente** – Newest listings first
- **Anúncios recomendados** – Recommended / featured ordering
- **Mais barato** – Cheapest first
- **Mais caro** – Most expensive first

### 🚀 Quick start

1. **Open the Actor** and pick a **category** (default: `imoveis`).
2. *(Optional)* Set **subcategory**, **location** (e.g. `Lisboa`), **query**, price range, **tipologia**, **condition**, or **seller type**.
3. *(Optional)* Or paste a full OLX results URL into **`search_url`** to override the filters.
4. **Choose `sort_by`** and **`max_items`** (up to 1000).
5. **Click Start** and let it run! 🛒 Export CSV, Excel, or JSON when done.

***

#### Tech details for developers 🧑‍💻

**Input Example (structured filters):**

```json
{
  "category": "imoveis",
  "subcategory": "casas-moradias-para-arrendar-vender",
  "location": "Lisboa",
  "tipologia": "t2",
  "price_max": 350000,
  "seller_type": "private",
  "sort_by": "Mais recente",
  "max_items": 100
}
```

**Input Example (URL override):**

```json
{
  "search_url": "https://www.olx.pt/imoveis/apartamento-casa-a-venda/lisboa/q-t2/?search%5Bfilter_float_price%3Ato%5D=350000&search%5Bprivate_business%5D=private",
  "sort_by": "Mais recente",
  "max_items": 200
}
```

**Output Example:**

```json
{
  "id": 667517968,
  "title": "Nintendo Switch Desbloqueada",
  "url": "https://www.olx.pt/d/anuncio/nintendo-switch-desbloqueada-IDJaPUQ.html",
  "created_time": "2025-12-20T11:34:47+00:00",
  "last_refresh_time": "2026-04-22T18:08:00+01:00",
  "img_url": "https://ireland.apollo.olxcdn.com:443/v1/files/i1mpbl9lnr2r-PT/image;s={width}x{height}",
  "price": 225,
  "currency": "EUR",
  "description": "Consola Mario Edition Desbloqueada como nova…",
  "business": true,
  "status": "active",
  "city": "Alverca Do Ribatejo E Sobralinho",
  "district": null,
  "region": "Lisboa",
  "category": "electronics",
  "contact_name": "Nuno",
  "contact_phone": false,
  "contact_chat": true,
  "photos": [
    "https://ireland.apollo.olxcdn.com:443/v1/files/i1mpbl9lnr2r-PT/image;s={width}x{height}"
  ],
  "highlighted": true,
  "top_ad": true,
  "premium_ad_page": false,
  "urgent": false,
  "b2c_ad_page": false,
  "shop_subdomain": null,
  "negotiable": false,
  "state": "used",
  "params": [
    { "key": "state", "value_key": "used" },
    { "key": "type", "value_key": "switch" }
  ]
}
```

### 📋 Input reference (detailed)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `category` | string enum | No | `imoveis` | Top-level path: `imoveis`, `carros-motos-e-barcos`, `tecnologia-e-informatica`, `telemoveis-e-tablets`, `moda`, `moveis-casa-e-jardim`, `desporto-e-lazer`, `animais`, `bebes-criancas`, `emprego`, `servicos`, `lazer`. |
| `subcategory` | string | No | — | Subcategory slug (e.g. `apartamento-casa-a-venda`, `casas-moradias-para-arrendar-vender`). |
| `location` | string | No | — | Location text; slugified with accents stripped (`Lisboa` → `lisboa`). |
| `query` | string | No | — | Free-text keywords → path segment `/q-{slug}/`. |
| `price_min` / `price_max` | integer | No | — | Price in **euros** (`search[filter_float_price:from]` / `:to`). |
| `tipologia` | string enum | No | `""` (any) | `t0`…`t6`, `t5-ou-mais`, `t6-ou-mais` (`search[filter_enum_tipologia][0]`). |
| `condition` | string enum | No | `""` (any) | `new`, `used`, `used_good`, `used_medium`, `used_bad` (`search[filter_enum_state][0]`). |
| `seller_type` | string enum | No | `""` (any) | `private` or `business` (`search[private_business]`). |
| `sort_by` | string enum | No | `Mais recente` | See sort options above. |
| `max_items` | integer | No | `500` | How many listings to return (`1`–`1000`). |
| `search_url` | string | No | — | Optional advanced override. Paste a full olx.pt search URL; filters above are ignored. |
| `input_url` | string | No | — | **Deprecated** alias for `search_url`. If both are set, `search_url` wins. |

#### Notes on filters

- With no filters and no URL, the Actor starts at **`https://www.olx.pt/imoveis/`**.
- Location and query are slugified (NFD, lowercase, hyphens) before building the path.
- Tipologia is mainly useful for **Imóveis**; other categories can still use price, condition, and seller type.
- Each run returns at most **`max_items`** listings (`1`–`1000`).
- Sort is applied in the browser after navigation (same UI labels as on the site).

### 🔧 Custom scrapers and agents

If you need a custom web scraper, or custom AI agents and workflows, contact me through [tuik.ai](https://www.tuik.ai). We help businesses cut costs and time by up to 10x.

# Actor input Schema

## `input_url` (type: `string`):

Paste a full olx.pt search or category URL to use instead of the filters below — overrides all structured filters when set. Leave empty to use the filters below (better for AI agents).

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

Top-level category. Names like Imóveis, Cars, Phones, Fashion, or Jobs work, and so do the existing values such as imoveis. Ignored when input_url is set.

## `subcategory` (type: `string`):

Optional subcategory (e.g. apartamento-casa-a-venda, casas-moradias-para-arrendar-vender). Ignored when input_url is set.

## `location` (type: `string`):

Optional location (e.g. Lisboa, Porto). Ignored when input_url is set.

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

Optional free-text keywords. Ignored when input_url is set.

## `price_min` (type: `integer`):

Minimum price in euros. Ignored when input_url is set.

## `price_max` (type: `integer`):

Maximum price in euros. Ignored when input_url is set.

## `tipologia` (type: `string`):

Property size, mainly for Imóveis. Names like T2 or T5 ou mais work. Leave empty for any. Ignored when input_url is set.

## `condition` (type: `string`):

Item condition. Names like New, Used, or Used — good work. Leave empty for any. Ignored when input_url is set.

## `seller_type` (type: `string`):

Private or Business. Leave empty for any. Ignored when input_url is set.

## `sort_by` (type: `string`):

How to order the listings. Most recent, Recommended, Cheapest, and Most expensive work, and so do Mais recente, Mais barato, and Mais caro.

## `max_items` (type: `integer`):

How many unique listings to return (1–2000).

## Actor input object example

```json
{
  "category": "Imóveis",
  "tipologia": "T2",
  "condition": "Used",
  "seller_type": "Private",
  "sort_by": "Most recent",
  "max_items": 500
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped listings (dataset view "overview").

## `results` (type: `string`):

All dataset records as JSON (no view).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dadhalfdev/olx-portugal-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("dadhalfdev/olx-portugal-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 '{}' |
apify call dadhalfdev/olx-portugal-scraper --silent --output-dataset

```

## MCP server setup

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