# Olx India Scraper (`natanielsantos/olx-india-scraper`) Actor

Scrape ads data from olx.in with this powerful tool. You can use it to extract title, price, images, description, and more. Download your data as HTML table, JSON, CSV, Excel, XML, and RSS feed.

- **URL**: https://apify.com/natanielsantos/olx-india-scraper.md
- **Developed by:** [Nataniel Santos](https://apify.com/natanielsantos) (community)
- **Categories:** Automation, Jobs, E-commerce
- **Stats:** 479 total users, 15 monthly users, 100.0% runs succeeded, 5 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 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

### What does OLX India Scraper do?

**OLX India Scraper** is a tool that enables you to scrape ads from OLX India website. This is a ready-to-use scraping tool and doesn't require any programming knowledge to get started.

### Features

- 🔎 Extract ads data using URLs or search terms.
- ⚡ Fast and reliable scraping
- 🧑‍💻 Perfect for non-technical users
- 🔒 No need for authentication
- 🔄 Automatically handles retries for failed requests
- 📦 Outputs data in JSON format for easy integration with other tools
- 📅 Schedulable

### ⬇️ What You Need to Provide

- 🔗 A list of OLX India URLs to scrape data from.
  - **Category URL** (e.g: `https://www.olx.in/cars_c84`)
  - **Location URL** (e.g: `https://www.olx.in/mgroad_g5462393`)
  - **Search URL** (e.g: `https://www.olx.in/items/q-car`)
  - **Search URL with filters** (e.g: `https://www.olx.in/thodupuzha_g4387975/motorcycles_c81?filter=make_eq_royal-enfield%2Cprice_max_152000`)
  - **Ads URL** (e.g: `https://www.olx.in/item/led-tv-good-condition-iid-1753262460`)
- 🔍 **Search Terms** - You can also scrape results by one or more search terms.
- ⚙️ **Sort Search By** - Only applicable for search terms. Options are `relevance` (default), `date_published`, `price_asc`, and `price_desc`.
- 🔢 **Max Items** - The maximum number of ads to scrape **per URL or Search Term**.

### 📥 Input Examples

##### Scraping by Category URLs (100 results per category)

```json
{
  "startUrls": [
    { "url": "https://www.olx.in/cars_c84" },
    { "url": "https://www.olx.in/motorcycles_c81" }
  ],
  "maxItems": 100
}
```

##### Scraping by Location URLs (100 results per location)

```json
{
  "startUrls": [
    { "url": "https://www.olx.in/mgroad_g5462393" },
    { "url": "https://www.olx.in/thodupuzha_g4387975" }
  ],
  "maxItems": 100
}
```

##### Scraping by Search Terms (100 results per search term, sorted by most recent)

```json
{
  "searchTerms": ["car", "motorcycle"],
  "sortSearchBy": "date_published",
  "maxItems": 100
}
```

### 🚀 Get Started

1. [Sign up](https://console.apify.com/) for Apify or [log in](https://console.apify.com/) if you already have an account.
2. Open [OLX India Scraper](https://apify.com/natanielsantos/olx-india-scraper) and click **Try For Free**.
3. Add URLs to the field **Start URLs** or terms to **Search Terms**. You can find examples of URLs in the section above.
4. Set the **Max Items** field to limit the number of ads scraped per URL or search term. The default is 50.
5. Click on ▶️ **Start** and wait for the results.

### 📦 Output example

The output of the OLX India Scraper is stored in a dataset. Each item is an ad and looks like this:

```json
  {
    "mainImage": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image",
    "id": "1733271487",
    "url": "https://www.olx.in/item/bullet-350cc-excellent-condition-exchange-available-iid-1733271487",
    "title": "Bullet 350cc excellent condition / exchange available",
    "description": "Restored With all new parts, showroom condition",
    "createdAt": "2023-11-17T15:47:56+05:30",
    "score": 1,
    "categoryId": "81",
    "userType": "Regular",
    "userId": "76236133",
    "images": [
      {
        "id": "1582142916",
        "external_id": "48z6jxi9i76z2-IN",
        "width": 1080,
        "height": 810,
        "url": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image",
        "full": {
          "width": 1080,
          "height": 810,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image;s=1080x810"
        },
        "big": {
          "width": 505,
          "height": 378,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image;s=505x378"
        },
        "medium": {
          "width": 120,
          "height": 90,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image;s=120x90"
        },
        "small": {
          "width": 120,
          "height": 90,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/48z6jxi9i76z2-IN/image;s=120x90"
        }
      },
      {
        "id": "1582142917",
        "external_id": "5dtb7z3tivqt-IN",
        "width": 1080,
        "height": 810,
        "url": "https://apollo-singapore.akamaized.net:443/v1/files/5dtb7z3tivqt-IN/image",
        "full": {
          "width": 1080,
          "height": 810,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/5dtb7z3tivqt-IN/image;s=1080x810"
        },
        "big": {
          "width": 505,
          "height": 378,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/5dtb7z3tivqt-IN/image;s=505x378"
        },
        "medium": {
          "width": 120,
          "height": 90,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/5dtb7z3tivqt-IN/image;s=120x90"
        },
        "small": {
          "width": 120,
          "height": 90,
          "url": "https://apollo-singapore.akamaized.net:443/v1/files/5dtb7z3tivqt-IN/image;s=120x90"
        }
      }
    ],
    "mainInfo": "1991 - 2,000 km",
    "price": {
      "raw": 140000,
      "currency": {
        "iso_4217": "INR",
        "pre": "₹"
      },
      "display": "₹ 1,40,000"
    },
    "status": "active",
    "parameters": [
      {
        "type": "single",
        "key": "make",
        "value_name": "Royal Enfield",
        "value": "royal-enfield",
        "key_name": "Brand",
        "formatted_value": "Royal Enfield"
      },
      {
        "type": "single",
        "key": "model",
        "value_name": "Bullet",
        "value": "royal-enfield-bullet",
        "key_name": "Model",
        "formatted_value": "Bullet"
      },
      {
        "type": "single",
        "key": "year",
        "value_name": "1991",
        "value": "1991",
        "key_name": "Year",
        "formatted_value": "1991"
      },
      {
        "type": "single",
        "key": "mileage",
        "value_name": "2000",
        "value": "2000",
        "key_name": "KM driven",
        "formatted_value": "2,000 km"
      }
    ],
    "favoritesCount": 4,
    "createdAtFirst": "2023-06-04T00:37:52+05:30",
    "certifiedCar": false,
    "isKycVerifiedUser": false,
    "locations": [
      {
        "lat": 9.963,
        "lon": 76.242,
        "region_id": "2001160",
        "district_id": "5316645",
        "city_id": "4058873"
      }
    ],
    "locationsResolved": {
      "COUNTRY_id": "1000001",
      "COUNTRY_name": "India",
      "ADMIN_LEVEL_1_id": "2001160",
      "ADMIN_LEVEL_1_name": "Kerala",
      "ADMIN_LEVEL_3_id": "4058873",
      "ADMIN_LEVEL_3_name": "Kochi",
      "SUBLOCALITY_LEVEL_1_id": "5316645",
      "SUBLOCALITY_LEVEL_1_name": "Fort Kochi"
    },
    "hasPhoneParam": false
  }
```

### 💲How much will scraping Kwai cost you?

The cost changes according to your Apify plan:

Plan | Price per 1000 results
\--- | ---
Free | $6
Starter | $2
Scale | $1.8
Business | $1.8

💡Note: Free users can only scrape 2 URLs per run and 50 results per URL. To remove this limitation, subscribe to a paid plan.

### 🧩Integrations and OLX India Scraper

OLX India Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, [and more](https://docs.apify.com/integrations). Or you can use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs, e.g. get a notification whenever OLX India Scraper successfully finishes a run.

### 🔌 Using OLX India Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the apify-client NPM package. To access the API using Python, use the apify-client PyPI package.

Check out the [Apify API reference](https://docs.apify.com/api/v2) docs for full details or click on the [API tab](https://apify.com/natanielsantos/olx-india-scraper/api) for code examples.

### 💬 Giving feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for OLX India scraper or simply found a bug, please create an issue on the Actor’s [Issues tab](https://apify.com/natanielsantos/olx-india-scraper/issues) in Apify Console.

# Actor input Schema

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

URLs to start with. It can be ads detail URLs, search results URLs or an ads listing URLs. You can see some examples on the [information page](https://apify.com/natanielsantos/olx-india-scraper#how-to-use-olx-india-scraper)

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

Maximum number of ads to scrape per URL added on Start URLs or per search term.

## `searchTerms` (type: `array`):

Search terms to scrape. Limit the number of results in the maxItems field.

## `sortSearchBy` (type: `string`):

Sort the search results by this criteria. Only valid for the search terms input. If you are scraping by Search URLs, add your own filters on the OLX website and copy the URL into Start URLs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.olx.in/kerala_g2001160/motorcycles_c81"
    },
    {
      "url": "https://www.olx.in/item/rc-390-bs3-iid-1752582650"
    }
  ],
  "maxItems": 50,
  "searchTerms": [
    "cars",
    "motorcycles"
  ],
  "sortSearchBy": "relevance"
}
```

# Actor output Schema

## `ads` (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 = {
    "startUrls": [
        {
            "url": "https://www.olx.in/kerala_g2001160/motorcycles_c81"
        }
    ],
    "maxItems": 50,
    "sortSearchBy": "relevance"
};

// Run the Actor and wait for it to finish
const run = await client.actor("natanielsantos/olx-india-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 = {
    "startUrls": [{ "url": "https://www.olx.in/kerala_g2001160/motorcycles_c81" }],
    "maxItems": 50,
    "sortSearchBy": "relevance",
}

# Run the Actor and wait for it to finish
run = client.actor("natanielsantos/olx-india-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 '{
  "startUrls": [
    {
      "url": "https://www.olx.in/kerala_g2001160/motorcycles_c81"
    }
  ],
  "maxItems": 50,
  "sortSearchBy": "relevance"
}' |
apify call natanielsantos/olx-india-scraper --silent --output-dataset

```

## MCP server setup

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