# 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
- **Stats:** 34 total users, 3 monthly users, 97.7% 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 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!

Paste an **`input_url`** from your browser once you've already filtered on OLX.pt, **or** use **structured filters** (category, subcategory, location, price, tipologia, condition, seller type) — structured filters work better for AI agents. When `input_url` is set it overrides the filters. Either way, you get up to **1000 listings** from any OLX Portugal category — imóveis, cars, tech, fashion, and more — with pricing, location, and seller details as CSV or JSON.

![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

- 🔗 **Input URL or Filters:** Paste an OLX.pt search URL (`input_url`) if you already filtered in the browser, or use structured filters (better for AI agents). `input_url` always wins when set.
- 🎯 **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 filters work great for houses and apartments.
- ⚙️ **Rich Listings:** Price, location, seller signals, photos, and promotion flags.
- ⏱️ **Sorting Options:** Newest, recommended, cheapest, or most expensive — same labels as on olx.pt.
- 🇵🇹 **Built for Portugal:** Covers all major OLX.pt categories nationwide.

### 📦 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

**Option A — Input URL**

1. Open [OLX.pt](https://www.olx.pt/), apply filters in the browser, copy the results URL.
2. Paste it into `input_url`.
3. Set `max_items` and click **Start**.

**Option B — Structured filters (better for AI agents)**

1. Leave `input_url` empty.
2. Pick a **category** (default: `imoveis`), optional subcategory, location, query, price, tipologia, condition, or seller type.
3. Choose `sort_by` and `max_items` (up to 1000).
4. Click **Start** and 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
{
  "input_url": "https://www.olx.pt/imoveis/apartamento-casa-a-venda/lisboa/",
  "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/v1/files/i1mpbl9lnr2r-PT/image;s=%7Bwidth%7Dx%7Bheight%7D",
  "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/v1/files/i1mpbl9lnr2r-PT/image;s=%7Bwidth%7Dx%7Bheight%7D"
  ],
  "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 |
|-----------|------|----------|---------|-------------|
| `input_url` | string | No | — | Paste a full olx.pt search or category URL; overrides all filters below when set. Leave empty to use filters (better for AI agents). |
| `category` | string enum | No | `imoveis` | Top-level category: `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 (e.g. `Lisboa`, `Porto`). |
| `query` | string | No | — | Free-text keywords. |
| `price_min` / `price_max` | integer | No | — | Price range in **euros**. |
| `tipologia` | string enum | No | `""` (any) | Property typology: `t0`…`t6`, `t5-ou-mais`, `t6-ou-mais`. |
| `condition` | string enum | No | `""` (any) | Item condition: `new`, `used`, `used_good`, `used_medium`, `used_bad`. |
| `seller_type` | string enum | No | `""` (any) | `private` or `business`. |
| `sort_by` | string enum | No | `Mais recente` | See sort options above. |
| `max_items` | integer | No | `500` | How many listings to return (`1`–`1000`). |

#### Notes on filters

- `input_url` always wins over filters when provided.
- With no filters and no URL, the Actor starts in **Imóveis**.
- 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`).

# 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 OLX.pt category. 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 typology / rooms. Mainly for Imóveis. Ignored when input\_url is set.

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

Item condition. Ignored when input\_url is set.

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

Private or business seller. Ignored when input\_url is set.

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

How to order the listings (same labels as on olx.pt).

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

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

## Actor input object example

```json
{
  "category": "imoveis",
  "tipologia": "",
  "condition": "",
  "seller_type": "",
  "sort_by": "Mais recente",
  "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/hW2wFyD4OcOjpOyS2/openapi.json
