This example shows how to scrape OLX listings in Node.js using the OLX Listings Scraper actor on Apify. Instead of building a scraper from scratch, this repo demonstrates how to call the ready-made actor via the Apify API client — you get structured listing data in minutes.
- Calls the OLX Listings Scraper actor with a search query and optional filters
- Passes the input configuration to the actor
- Waits for the run to finish
- Fetches results from the actor's dataset
- Prints each listing item to the console
- Node.js v18 or higher
- An Apify account
- Your Apify API token
npm installCopy .env.example to .env and add your Apify API token:
cp .env.example .envThen open .env and replace your_apify_token_here with your actual token:
APIFY_TOKEN=your_apify_token_herenpm startimport { ApifyClient } from 'apify-client';
import 'dotenv/config';
// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
// Prepare Actor input
const input = {
"searchQuery": "iphone",
"categoryIds": [],
"startUrls": []
};
// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/olx-listings-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/docsSee sample-output.json for a full example. Each listing item contains:
| Field | Description |
|---|---|
id |
Unique OLX listing ID |
url |
Direct link to the listing page |
title |
Listing title |
description |
Full listing description text |
price |
Price as a number |
currency |
Currency code (e.g. PLN) |
negotiable |
Whether the price is negotiable |
condition |
Item condition (e.g. Używane = Used) |
city / district / region |
Location details |
lat / lon |
Geographic coordinates |
sellerName / sellerId |
Seller info |
isPromoted |
Whether the listing is a promoted ad |
photos |
Array of photo URLs |
params |
Category-specific attributes (model, storage, color, etc.) |
createdAt / refreshedAt |
Listing timestamps |
scrapedAt |
When the data was collected |
- Price monitoring — track price trends for specific products across OLX Poland
- Market research — analyze supply, demand, and pricing for categories like electronics or vehicles
- Lead generation — find sellers listing items relevant to your business
- Arbitrage — identify underpriced listings by comparing against market averages
- Academic research — study second-hand market dynamics and consumer behavior in CEE markets
Open the OLX Listings Scraper on Apify
MIT
