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

Scrape public OLX India classifieds with clean titles, prices, locations, seller details, images and descriptions.

- **URL**: https://apify.com/w3crawler/olx-india-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 listings

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 India Public Classifieds Scraper

This Actor extracts publicly visible OLX India classifieds from `olx.in` search, category, or listing pages. It returns titles, INR-aware prices, locations, categories, conditions, seller fields, descriptions, images, dates, and canonical listing URLs when those fields are present in public HTML or structured data.

#### Input

- `startUrls`: HTTPS OLX India URLs; only `olx.in` and its public subdomains are accepted.
- `maxItems`: maximum unique listings, from 1 to 100.
- `requestTimeoutSecs`: per-page timeout, from 5 to 60 seconds.
- `maxBytes`: response-size limit.
- `proxyConfiguration`: optional standard Apify Proxy settings. Direct requests remain the default; successful navigation reuses one session and one bounded retry rotates the session after a transient/access-boundary response.

The Actor follows public redirects only when the final URL remains on OLX India. It uses Apify's `impit` client with a current desktop Chrome identity, an India-consistent language profile, bounded backoff, and a Chrome network fingerprint because OLX India resets generic Node TLS clients. It does not log in, access private endpoints, submit credentials, solve CAPTCHAs, or bypass challenges. Proxy credentials are passed only to the request transport and are never written to dataset rows or summaries. Anti-automation responses are emitted as diagnostic dataset rows with an error code instead of being hidden. User-supplied fixture content is not accepted by the production Actor, and diagnostic-only runs exit nonzero.

#### Output

Successful rows have `recordType: "olx-listing"` and include stable metadata (`recordId`, source URLs, HTTP status, timestamps, and access policy). When a page is unavailable or has no parseable public listings, an `olx-diagnostic` row records the reason. `OUTPUT` and `OUTPUT_SUMMARY` contain run counts.

Use the dataset export/API for JSON, JSONL, CSV, Excel, XML, or HTML output. Respect OLX terms, request limits, applicable law, and privacy obligations.

# Actor input Schema

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

HTTPS OLX India search, category, or listing pages. Only olx.in public hosts are accepted.

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

Maximum number of unique listings to emit.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for each public OLX page.

## `maxBytes` (type: `integer`):

Upper bound for each downloaded public page.

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

Optional Apify Proxy configuration. When enabled, the Actor uses one consistent proxy session for public OLX requests. The direct connection is used by default.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.olx.in/items"
    }
  ],
  "maxItems": 100,
  "requestTimeoutSecs": 30,
  "maxBytes": 5000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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("w3crawler/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 = {}

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

```

## MCP server setup

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