# Flipkart Scraper (`w3crawler/flipkart-scraper`) Actor

Extract public Flipkart search, category, and product-page data with bounded HTML requests. Returns product IDs, titles, prices, ratings, seller and availability signals, specifications, offers, media, and fail-closed diagnostics.

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

## Pricing

from $2.99 / 1,000 products

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?

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

### What does Flipkart Scraper do?

Flipkart Scraper is a **public Flipkart product data API alternative** for bounded search, category, and product-page extraction. It reads only public HTML and the public structured state exposed by [Flipkart](https://www.flipkart.com/); it does not log in, reuse protected sessions, call private APIs, bypass CAPTCHAs, or evade access controls.

### Why use Flipkart Scraper?

Use it to build product catalogs, price-monitoring datasets, assortment research, marketplace analysis, and public availability snapshots. The Actor can enrich result cards with product-page metadata such as Schema.org offers, descriptions, seller signals, specifications, ratings, delivery and return-policy objects, media links, badges, and bounded raw public objects.

Apify provides scheduling, API access, dataset downloads, monitoring, and integrations around each run. Keep requests small and paced: Flipkart may change public page structure or stop serving a page because of traffic, region, device, login, CAPTCHA, WAF, or other access controls.

### What data can it extract?

| Field | Type | Description |
| --- | --- | --- |
| `productId`, `sku`, `listingId` | string | Public product and listing identifiers. |
| `title`, `description`, `brand`, `category` | string | Public catalog and product-page text. |
| `price`, `mrp`, `discountPercent`, `currency` | number/string | Observed price signals. |
| `rating`, `ratingCount`, `reviewCount` | number | Public review signals. |
| `seller`, `availability`, `shipping`, `returnPolicy` | object/string | Public seller and fulfillment signals. |
| `keySpecs`, `specifications`, `variants`, `offers` | array/object | Public product attributes and commercial signals. |
| `images`, `videos`, `url` | array/string | Public media and product links. |
| `sourceMetadata`, `rawPublic` | object | Provenance and bounded raw public state. |

### How to scrape Flipkart

1. Select `search`, `byCategory`, or `byUrl` in the Input tab.
2. Provide a search phrase, a public Flipkart category URL, or public product URLs.
3. Set `maxItems`, page bounds, filters, enrichment toggles, pacing, retries, and timeout values.
4. Start the Actor and download the dataset as JSON, CSV, Excel, HTML, or another supported format.

`includeDetails` is enabled by default and uses a small worker pool to fetch public product pages. `includeMedia`, `includeRatings`, `includeOffers`, `includeVariants`, and `includeRawPublic` control optional fields. Direct HTTP remains the default. The standard `proxyConfiguration` input can route bounded requests through Apify Proxy when direct cloud traffic is unavailable; requested proxy configuration fails closed if unavailable.

### How much does it cost?

Cost depends on request count, response size, detail enrichment, and Actor runtime. Search-only runs use listing pages; detail enrichment adds one bounded public request per selected product. Start with a small `maxItems`, then increase it after checking runtime and access behavior. Apify platform compute and storage pricing is shown in the Console for your account and plan.

### Input

See the Input tab for every configuration option. `mode` is required. `byUrl` accepts only public Flipkart URLs. The Actor enforces bounded values for pages, items, concurrency, pacing, retries, and timeouts. It does not accept credentials, cookies, session tokens, or non-Flipkart URLs.

### Output

Product rows contain public product business fields. If one of several requested URLs is blocked or fails, successful product rows are preserved and the dataset also receives an exact four-field diagnostic record: `url`, `error`, `errorCode`, and `scrapedAt`. If no usable row is available, the dataset receives only the diagnostic. Run status, counts, request metrics, and barrier state are stored in `OUTPUT_SUMMARY` (`OUTPUT` remains a compatibility alias); no run-summary row is appended to the dataset. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
  "recordType": "product",
  "productId": "EXAMPLEPID123",
  "title": "Example Intel Core Laptop",
  "price": 49999,
  "currency": "INR",
  "url": "https://www.flipkart.com/example-product/p/itmexample123?pid=EXAMPLEPID123"
}
```

### Tips and advanced options

Use `includeDetails: false` for a faster listing-only run. Use `maxPages` and `maxItems` together to cap work. Increase `pacingMs` when making repeated runs. Retries apply only to transient network and server failures; CAPTCHA, login, paywall, geofence, rate, device, WAF, and access barriers are detected and stopped without bypass attempts.

For local development, place a bounded JSON input in the normal local store or pass a file directly:

```bash
apify run --purge --input-file ../qa-inputs/flipkart-scraper/cloud-validation.json
npm run validate
```

After the Actor is mapped to the correct Actor in your authenticated Apify account, deploy and run the same bounded input with:

```bash
apify push --wait-for-finish 600 --json
apify call --input-file ../qa-inputs/flipkart-scraper/cloud-validation.json --memory 512 --timeout 300 --json
```

Inspect the cloud run's default dataset before treating the run as successful. Cloud validation is not a substitute for the local dataset checks, and neither workflow changes public Store visibility or pricing.

### FAQ, disclaimers, and support

#### Why did I receive a diagnostic record?

Flipkart may return an access barrier, a changed public state shape, an empty result, or a transient failure. Read the exact diagnostic `errorCode` and `error`, then inspect `OUTPUT_SUMMARY` for barrier and request outcome fields. On multi-URL runs, any successful public product rows remain available beside the diagnostic; no placeholder product rows are generated.

#### Is this Actor allowed to scrape Flipkart?

Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You are responsible for following Flipkart’s terms, robots guidance, and applicable law.

For programmatic access, use the API tab. For feedback or changed fields, use the Issues tab.

# Actor input Schema

## `mode` (type: `string`):

How to find public Flipkart products.

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

Keyword(s) to search on Flipkart when mode is search.

## `categoryUrl` (type: `string`):

Public Flipkart category or browse URL when mode is byCategory.

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

Public Flipkart product URLs when mode is byUrl. URLs outside Flipkart are rejected.

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

Public search or category sort order.

## `pageFrom` (type: `integer`):

First public result page to request.

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

Maximum number of public search or category pages to request.

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

Maximum product records returned.

## `minPrice` (type: `integer`):

Keep products whose observed price is at least this amount.

## `maxPrice` (type: `integer`):

Keep products whose observed price is at most this amount.

## `minRating` (type: `number`):

Keep products whose observed rating is at least this value.

## `maxRating` (type: `number`):

Keep products whose observed rating is at most this value.

## `availabilityFilter` (type: `string`):

Optional filter based on the public availability signal.

## `includeDetails` (type: `boolean`):

Fetch each public product page to enrich listing records with descriptions, seller, offers, specifications, and delivery or return signals.

## `includeMedia` (type: `boolean`):

Include bounded public image and video URLs when observed.

## `includeRatings` (type: `boolean`):

Include rating, rating count, review count, and rating histogram fields.

## `includeOffers` (type: `boolean`):

Include bounded public offer, discount, shipping, and return-policy objects.

## `includeVariants` (type: `boolean`):

Include bounded public color, size, or related product variant objects when exposed in initial state.

## `includeRawPublic` (type: `boolean`):

Include bounded raw objects selected from public initial state and Schema.org data. No cookies, tokens, or protected session data are collected.

## `concurrency` (type: `integer`):

Maximum number of product-page workers used for public detail requests.

## `pacingMs` (type: `integer`):

Minimum delay between public requests.

## `maxRetries` (type: `integer`):

Retries for transient network and 5xx failures. Access barriers are never retried or bypassed.

## `timeoutMs` (type: `integer`):

Timeout for each public HTML request.

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

Optional standard Apify Proxy configuration. If requested but unavailable, the Actor fails closed instead of silently using direct traffic.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "laptop",
  "categoryUrl": "https://www.flipkart.com/laptops/pr?sid=6bo%2Cb5g",
  "startUrls": [],
  "sortBy": "relevance",
  "pageFrom": 1,
  "maxPages": 5,
  "maxItems": 20,
  "availabilityFilter": "any",
  "includeDetails": true,
  "includeMedia": true,
  "includeRatings": true,
  "includeOffers": true,
  "includeVariants": true,
  "includeRawPublic": true,
  "concurrency": 2,
  "pacingMs": 300,
  "maxRetries": 2,
  "timeoutMs": 15000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing public product records or a diagnostic record.

## `runSummary` (type: `string`):

Canonical JSON summary for the run, including counts, request metrics, and barrier state.

# 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 = {
    "mode": "search",
    "searchQuery": "laptop",
    "categoryUrl": "https://www.flipkart.com/laptops/pr?sid=6bo%2Cb5g",
    "startUrls": [],
    "sortBy": "relevance",
    "maxItems": 20,
    "availabilityFilter": "any",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/flipkart-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 = {
    "mode": "search",
    "searchQuery": "laptop",
    "categoryUrl": "https://www.flipkart.com/laptops/pr?sid=6bo%2Cb5g",
    "startUrls": [],
    "sortBy": "relevance",
    "maxItems": 20,
    "availabilityFilter": "any",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/flipkart-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 '{
  "mode": "search",
  "searchQuery": "laptop",
  "categoryUrl": "https://www.flipkart.com/laptops/pr?sid=6bo%2Cb5g",
  "startUrls": [],
  "sortBy": "relevance",
  "maxItems": 20,
  "availabilityFilter": "any",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call w3crawler/flipkart-scraper --silent --output-dataset

```

## MCP server setup

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