# 🇧🇦 OLX.ba Bosnia Marketplace Scraper (`hipersoft/olx-ba-scraper`) Actor

Scrape listings from OLX.ba, Bosnia and Herzegovina's largest marketplace — cars, phones, real estate, electronics and every category. Search any keyword or paste a URL and export one clean row per ad: title, price in KM, category, city, images and the listing URL as JSON, CSV or Excel.

- **URL**: https://apify.com/hipersoft/olx-ba-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0015 / listing scraped

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?

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.ba Scraper — Bosnia and Herzegovina Marketplace Listings

Scrape classified ads from **OLX.ba**, Bosnia and Herzegovina's largest online marketplace, into clean, structured **JSON, CSV or Excel**. Search any **keyword** — or paste an OLX.ba URL — and pull every listing across cars, phones, real estate, electronics, fashion and more, **one tidy row per ad**: **title, price in KM, category, city, images and the listing URL**. Built for price tracking, market research, competitive analysis and automations.

### Features

- 🛒 **Every category** — cars, mobile phones, real estate, electronics, home, fashion, jobs and services, all from one Actor.
- 🔎 **Keyword search** — run one or many keywords at once (e.g. `iphone`, `golf 7`, `stan sarajevo`); each returns its own matching ads.
- 🔗 **Paste-a-URL** — drop in any OLX.ba search or category link and the Actor scrapes it end to end.
- 🗂️ **Category filter** — restrict a search to a single category by its ID (e.g. cars, real estate).
- 💰 **Prices in KM** — the numeric price is parsed for you, plus the displayed price text and any discount.
- 🖼️ **Images** — the main image plus the full gallery URL list for every ad.
- 🔗 **Direct ad URL** — a ready-to-open link to each listing on OLX.ba.
- 📄 **Volume control** — set `maxItems` to balance coverage and cost.

### Input

```json
{
  "queries": ["iphone", "golf 7"],
  "categoryId": 18,
  "maxItems": 100
}
```

| Field | Description |
| --- | --- |
| `queries` | One or more keywords to search. Each runs its own search and results are combined. |
| `startUrls` | Optional. OLX.ba search or category page URLs to scrape (e.g. `https://olx.ba/pretraga?q=iphone`). Scraped in addition to any keywords. |
| `categoryId` | Optional. Restrict every keyword search to one category by its numeric ID (e.g. `18` for cars). |
| `maxItems` | Maximum ads to collect across all searches (0 = no limit). |
| `maxConcurrency` | How many requests to run in parallel. Leave at the default unless you have a reason to change it. |
| `proxyConfiguration` | Proxy settings. Not required by default. |

#### How to search

Enter one or more `queries` and run to collect matching ads. Add a `categoryId` to focus on one section of the marketplace, or paste `startUrls` straight from your browser. Set `maxItems` to control how much you collect.

### Use cases

- Track prices for cars, phones or property across Bosnia and Herzegovina over time.
- Build and refresh a classifieds dataset for market and demand analysis.
- Monitor new listings for specific keywords and categories.
- Generate lead lists of sellers by category.
- Feed structured ad records into a CRM, spreadsheet or analytics pipeline.

### What you get

Each ad is one dataset record:

```json
{
  "id": 78962452,
  "title": "Volkswagen Passat 1.6 TDI 2010 Grijanje sjedišta",
  "price": 8990,
  "displayPrice": "8.990 KM",
  "currency": "BAM",
  "hasDiscount": false,
  "originalPrice": null,
  "listingType": "sell",
  "categoryId": 18,
  "cityId": 132,
  "location": null,
  "imageUrl": "https://.../img-1787232542-62155358b11e.jpeg",
  "images": ["https://.../img-1787232542-62155358b11e.jpeg"],
  "sponsored": true,
  "userType": "shop",
  "postedDate": "2026-09-05T10:50:59.000Z",
  "url": "https://olx.ba/artikal/78962452",
  "sourceUrl": "https://api.olx.ba/search?q=iphone&page=1&per_page=50"
}
```

#### Output schema

| Field | Type | Description |
|---|---|---|
| `id` | integer | OLX.ba's unique identifier for the ad. |
| `title` | string | Ad title. |
| `price` | number | Price in KM (numeric). `null` when the ad has no fixed price (e.g. "Na upit" / on request). |
| `displayPrice` | string | Price exactly as displayed on OLX.ba (e.g. `8.990 KM`). |
| `currency` | string | Currency code (`BAM`, the Bosnian convertible mark / KM). |
| `hasDiscount` | boolean | Whether the ad shows a discounted price. |
| `originalPrice` | number | Original price before any discount, where shown. |
| `listingType` | string | Listing type (e.g. `sell`). |
| `categoryId` | integer | Numeric category the ad belongs to. |
| `cityId` | integer | Numeric city the ad is posted in. |
| `location` | object/string | Location detail where provided. |
| `imageUrl` | string (URL) | Main image URL. |
| `images` | array | All image URLs for the ad. |
| `sponsored` | boolean | Whether the ad is promoted/sponsored. |
| `userType` | string | Seller type (e.g. `user`, `shop`). |
| `postedDate` | string | Date the ad was posted (ISO 8601). |
| `url` | string (URL) | Direct link to the ad on OLX.ba. |
| `sourceUrl` | string (URL) | The search this ad was collected from. |

### Related Actors

- [Avito.ma Morocco Marketplace Scraper](https://apify.com/hipersoft/avito-ma-scraper)
- [Divar Scraper](https://apify.com/hipersoft/divar-scraper)
- [Vinted Scraper](https://apify.com/hipersoft/vinted-scraper)
- [Google Maps Scraper](https://apify.com/hipersoft/google-maps-scraper)

### FAQ

**Do I need an OLX.ba account?**
No. Just enter a keyword and run.

**Can I search a specific category?**
Yes. Set `categoryId` to a category's numeric ID, or paste a category URL into `startUrls`.

**In what currency are prices?**
Prices are in the Bosnian convertible mark (KM / `BAM`). The numeric `price` is parsed for you; `displayPrice` keeps the original as displayed.

**How many ads can I collect?**
As many as your search returns. Use `maxItems` to control volume and cost.

**What export formats are supported?**
JSON, CSV, Excel and XML, plus the Apify API for programmatic access.

**Can I use this with n8n?**
Yes. Use the [Apify node for n8n](https://docs.apify.com/platform/integrations/n8n) to run this Actor and pull its dataset straight into an n8n workflow — trigger it on a schedule, then route the ad rows to a database, spreadsheet or messaging step.

**Can I connect it to other tools?**
This Actor connects with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### Notes

Returns only public OLX.ba ad data — the same information any visitor can see. This is an independent tool and is not affiliated with, endorsed by or connected to OLX.ba; "OLX.ba" is a trademark of its respective owner. Original clean-room implementation.

# Actor input Schema

## `queries` (type: `array`):

One or more keywords to search on OLX.ba — for example 'iphone', 'golf 7' or 'stan sarajevo'. Each keyword runs its own search across every category and the results are combined. Leave Start URLs empty to use this.

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

Optional. One or more OLX.ba search or category page URLs to scrape. Paste the URL straight from your browser (e.g. https://olx.ba/pretraga?q=iphone). When set, these are scraped in addition to any keywords. The scraper follows the pagination of each URL automatically.

## `categoryId` (type: `integer`):

Optional. Restrict every keyword search to a single OLX.ba category by its numeric ID — for example 18 for cars or 23 for real estate. Leave empty to search across all categories.

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

Maximum number of ads to collect across all searches (0 = no limit; collect everything the searches return).

## `maxConcurrency` (type: `integer`):

How many requests to run in parallel. Leave at the default unless you have a reason to change it.

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

Proxy settings. Not required by default. If you experience reduced results, enable Apify Residential proxy for the most reliable access.

## Actor input object example

```json
{
  "queries": [
    "iphone"
  ],
  "maxItems": 100,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

The results as dataset items.

# 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 = {
    "queries": [
        "iphone"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/olx-ba-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 = { "queries": ["iphone"] }

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

```

## MCP server setup

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