# Olx Search Scraper (`daddyapi/olx-search-scraper`) Actor

Olx Search Scraper acts like a real user:

```
You provide a Search Query (e.g., "MacBook Pro").
You select a Region (e.g., Ukraine, Poland, Romania).
The actor navigates, searches, handles pagination, and extracts clean data.
```

- **URL**: https://apify.com/daddyapi/olx-search-scraper.md
- **Developed by:** [DaddyAPI](https://apify.com/daddyapi) (community)
- **Categories:** Automation, E-commerce, Jobs
- **Features:** Limited permissions
- **Stats:** 82 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 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/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 Search Scraper

> **The only OLX scraper that searches by KEYWORD.** No need to manually filter URLs. Enter a term (e.g., "iPhone 15", "Apartment") and get thousands of results instantly.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue?style=for-the-badge\&logo=apify)](https://apify.com/daddyapi/olx-search-scraper)
[![Node.js](https://img.shields.io/badge/Node.js-v22-green?style=for-the-badge\&logo=node.js)](https://nodejs.org/)

### 🚀 Why this scraper?

Most OLX scrapers require you to manually visit the website, apply filters, copy the URL, and paste it into the scraper. **That's slow and unscalable.**

**Olx Search Scraper** acts like a real user:

1. You provide a **Search Query** (e.g., "MacBook Pro").
2. You select a **Region** (e.g., Ukraine, Poland, Romania).
3. The actor navigates, searches, handles pagination, and extracts clean data.

**Perfect for:**

- 📉 **Price Monitoring:** Track competitors or market trends.
- 🏠 **Real Estate:** Find new apartment listings instantly.
- 🚗 **Automotive:** Monitor car prices across regions.
- 📦 **Arbitrage:** Compare prices between countries.

***

### 🌍 Supported Countries

We support the 10 largest OLX markets globally:

| Domain | Country | Language | Currency |
|--------|---------|----------|----------|
| **olx.ua** | 🇺🇦 Ukraine | Ukrainian | UAH |
| **olx.pl** | 🇵🇱 Poland | Polish | PLN |
| **olx.ro** | 🇷🇴 Romania | Romanian | RON |
| **olx.pt** | 🇵🇹 Portugal | Portuguese | EUR |
| **olx.bg** | 🇧🇬 Bulgaria | Bulgarian | BGN |
| **olx.kz** | 🇰🇿 Kazakhstan | Russian/Kazakh | KZT |
| **olx.uz** | 🇺🇿 Uzbekistan | Uzbek/Russian | UZS |

***

### 📖 How to Use

#### Option 1: Apify Console (No Coding)

1. Go to the **Input** tab.
2. Enter your **Search Keyword** (e.g., `Sony PlayStation 5`).
3. Select the **OLX Domain** (e.g., `olx.pl`).
4. (Optional) Set **Sort By** to `Newest` to get the latest ads.
5. **Proxy Selection:** Select "Apify Proxy" (Residential recommended) OR select your own custom proxy groups if you are renting the worker.
6. Click **Start**.
7. Download your data in Excel, CSV, or JSON format.

#### Option 2: API (Developers)

You can trigger this actor programmatically via REST API, Python, or Node.js.

##### Input Payload (JSON)

```json
{
    "searchQuery": "iPhone 15 Pro",
    
    "olxDomain": "olx.ua", 
    // Options: "olx.ua" (Ukraine), "olx.pl" (Poland), "olx.ro" (Romania), 
    //          "olx.pt" (Portugal), "olx.bg" (Bulgaria), "olx.kz" (Kazakhstan), 
    //          "olx.uz" (Uzbekistan)
    "sortBy": "newest",
    // Options: "newest" (Recommended), "cheapest", "expensive", "relevance"

    "maxPages": 1,
    "maxRequestsPerCrawl": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
}
```

##### 🐍 Python Example (Simple & Clean)

This script runs the scraper and saves the results to a local file. It demonstrates how to use **Custom Proxies** (Datacenter or Residential) associated with your Apify account.

```python
import json
from apify_client import ApifyClient

## 1. Configuration
APIFY_TOKEN = 'YOUR_APIFY_TOKEN'
ACTOR_ID = 'daddyapi/olx-search-scraper'

client = ApifyClient(APIFY_TOKEN)

## 2. Define Input with Custom Proxies
## If you "rent" this worker, you can use YOUR OWN Apify proxy groups here.
run_input = {
    "searchQuery": "iPhone 15 Pro",
    "olxDomain": "olx.ua",
    "sortBy": "newest",
    "maxPages": 1,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": [
            "BUYPROXIES94952",  # <-- Your custom datacenter group
            "StaticUS3"         # <-- Another group
        ]
        # Remove 'apifyProxyGroups' to use auto-selected Residential proxies
    }
}

print(f"🚀 Starting scraper for: {run_input['searchQuery']} on {run_input['olxDomain']}...")

## 3. Run Actor
run = client.actor(ACTOR_ID).call(run_input=run_input)

if not run:
    print("❌ Failed to start run.")
    exit(1)

print(f"✅ Run finished! Status: {run['status']}")

## 4. Fetch & Save Results
dataset_client = client.dataset(run["defaultDatasetId"])
items = dataset_client.list_items().items

filename = "results.json"
with open(filename, "w", encoding="utf-8") as f:
    json.dump(items, f, indent=2, ensure_ascii=False)

print(f"💾 Saved {len(items)} listings to {filename}")
```

***

### 🔒 Proxy Configuration (Bring Your Own Proxies)

This actor is fully compatible with **Apify Proxy** (Datacenter & Residential) and **Custom Proxies**.

#### 1. Datacenter Proxies (Cost-Effective)

If you have your own Datacenter proxy groups on Apify you can specify them here. This is great for high-volume users who want to control costs.

```json
{
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "BUYPROXIES94952",
            "StaticUS3"
        ]
    }
}
```

#### 2. Residential Proxies (Best Reliability)

**Recommended for most users.** Residential proxies are harder to block and provide the highest success rate. Ideal if you are getting 403 errors with Datacenter proxies.

```json
{
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
}
```

#### 3. Bring Your Own Proxies (Custom URLs)

If you have proxies from an external provider (BrightData, Smartproxy, IPRoyal, etc.), you can pass the connection strings directly.

```json
{
    "proxyConfiguration": {
        "useApifyProxy": false,
        "proxyUrls": [
            "http://username:password@my-proxy.example.com:8000",
            "http://username:password@my-proxy-2.example.com:8000"
        ]
    }
}
```

#### 💡 Recommendation

- **Low Volume / High Reliability:** Start with **Residential**. It just works.
- **High Volume / Low Cost:** If you are running massive scrapes, try **Datacenter** groups first. If blocked, switch to Residential.

***

### 📊 Data Output

The scraper returns highly detailed, structured data for every listing:

```json
{
  "id": 84920155,
  "title": "Sony PlayStation 5 Slim 1TB",
  "url": "https://www.olx.ua/d/obyavlenie/sony-playstation-5-slim-IDuQ2.html",
  "description": "New sealed console, warranty included...",
  "price": {
    "amount": 18500,
    "currency": "UAH",
    "display": "18 500 грн."
  },
  "location": {
    "city": "Kyiv",
    "region": "Kyiv Oblast"
  },
  "postedAt": "2025-12-30T14:28:41+02:00",
  "isPromoted": true,
  "isBusiness": true,
  "photos": [
    "https://ireland.apollo.olxcdn.com/v1/files/image1.jpg",
    "https://ireland.apollo.olxcdn.com/v1/files/image2.jpg"
  ]
}
```

***

### ⚙️ Configuration Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `searchQuery` | String | ✅ | - | What to search for. Supports multiple words. |
| `olxDomain` | Enum | ✅ | `olx.ua` | The regional site to scrape. |
| `sortBy` | Enum | ❌ | `newest` | `newest`, `cheapest`, `expensive`, or `relevance`. |
| `maxPages` | Integer | ❌ | `1` | Depth of scrape. 1 page ≈ 40-50 ads. |
| `proxyConfiguration` | Object | ❌ | Auto | Configure Residential or Your Custom Proxy Groups. |

***

### 🛡️ Troubleshooting

- **Empty Results?** Check if the item exists in that country. Try a local language keyword (e.g., "komputer" instead of "computer" in Poland).
- **Blocked/403?** Your proxy is detected. Switch to Apify Proxy (Residential) or try again later.
- **Missing Fields?** Some sellers don't provide all info (e.g., location or business status).

***

#### ⚖️ Legal & Ethics

This scraper is for educational and analytical purposes. Please respect OLX's Terms of Service and `robots.txt`. Do not use this tool to spam sellers or overload their servers. Use responsible rate limits.

# Actor input Schema

## `searchQuery` (type: `string`):

What item are you looking for? (e.g., 'iPhone 15', 'PlayStation 5')

## `olxDomain` (type: `string`):

Select the OLX regional site to scrape.

## `sortBy` (type: `string`):

Order in which ads are scraped.

## `maxPages` (type: `integer`):

How many pages of results to traverse. 1 page ≈ 40-50 ads.

## `maxRequestsPerCrawl` (type: `integer`):

Hard limit on total requests to prevent runaway costs.

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

Select proxies. 'Residential' works best for OLX. If 'Country' is set here, it overrides the auto-detection.

## Actor input object example

```json
{
  "searchQuery": "playstation 5",
  "olxDomain": "olx.ua",
  "sortBy": "newest",
  "maxPages": 1,
  "maxRequestsPerCrawl": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("daddyapi/olx-search-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("daddyapi/olx-search-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 daddyapi/olx-search-scraper --silent --output-dataset

```

## MCP server setup

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