How to Scrape Flipkart Data: Complete Guide for 2026
Tutorials

How to Scrape Flipkart Data: Complete Guide for 2026

Learn to scrape Flipkart product data responsibly using AlterLab's API with Python and Node.js examples. Covers anti-bot handling, structured extraction, and pricing.

H
Herald Blog Service
4 min read
3 views

AlterLab handles this automaticallyscrape any URL with one API call. No infrastructure required.

Try it free

This guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.

TL;DR

Scrape Flipkart product pages using AlterLab's API with automatic anti-bot handling. Start with T1/T2 tiers for static content, escalate to T3 for JS-protected pages. Extract structured data via CSS selectors or Cortex AI for typed JSON output. Costs begin at $0.0002/request.

Why collect e-commerce data from Flipkart?

Flipkart hosts over 150 million products across categories like electronics, fashion, and home goods. Engineering teams scrape this public data for:

  • Price intelligence: Track competitor pricing fluctuations for dynamic pricing models
  • Market research: Analyze product availability, category trends, and seasonal demand patterns
  • Data enrichment: Enhance internal catalogs with standardized product attributes from public listings

Technical challenges

Flipkart employs layered anti-bot protections common to major e-commerce sites:

  • Rate limiting based on IP and request patterns
  • Header validation (User-Agent, Accept, Referer checks)
  • Occasional JavaScript rendering requirements for dynamic content
  • Bot detection via behavioral analysis and fingerprinting

Raw HTTP requests frequently receive 403/429 responses or altered HTML. AlterLab's Smart Rendering API manages these challenges through:

  • Automatic proxy rotation with residential IPs
  • Realistic browser fingerprinting
  • Header normalization and cookie handling
  • Tiered rendering escalation (curl → browser) without code changes

Quick start with AlterLab API

Begin by installing the SDK and making your first request. See the Getting started guide for detailed setup.

Python example

Python
import alterlab

client = alterlab.Client("YOUR_API_KEY")
response = client.scrape("https://www.flipkart.com/apple-iphone-15-pro-max-black-titanium-256-gb/p/itmdc5308fa78822")
print(response.text[:500])  # First 500 chars of HTML

Node.js example

JAVASCRIPT
import { AlterLab } from "alterlab";

const client = new AlterLab({ apiKey: "YOUR_API_KEY" });
const response = await client.scrape("https://www.flipkart.com/apple-iphone-15-pro-max-black-titanium-256-gb/p/itmdc5308fa78822");
console.log(response.text.slice(0, 500));

cURL example

Bash
curl -X POST https://api.alterlab.io/v1/scrape \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"url": "https://www.flipkart.com/apple-iphone-15-pro-max-black-titanium-256-gb/p/itmdc5308fa78822"}'

Note: Flipkart product pages typically succeed at T2/T3 tiers. The API auto-escalates if initial attempts fail—you only pay for the successful tier.

Extracting structured data

Parse relevant data points using CSS selectors in your post-processing layer. Common Flipkart selectors:

Data PointCSS SelectorExample Value
Product Titleh1 span.B_NuCIApple iPhone 15 Pro Max
Pricediv._30jeq3._16Jk6d₹1,44,900
Ratingdiv._3LWZlK._1BLPMq4.5
Availabilitydiv._16FRp0In Stock
Image URLimg._396cs4._3exPp9https://rukminim2.flixcart.com/...

Extract these in Python:

Python
from parsel import Selector

selector = Selector(text=response.text)
data = {
    "title": selector.css("h1 span.B_NuCI::text").get(),
    "price": selector.css("div._30jeq3._16Jk6d::text").get(),
    "rating": selector.css("div._3LWZlK._1BLPMq::text").get(),
    "in_stock": "In Stock" in selector.css("div._16FRp0::text").get()
}

Structured JSON extraction with Cortex

For guaranteed typed output without selector maintenance, use AlterLab's Cortex AI extraction. Define a JSON schema and receive validated data:

Python
import alterlab

client = alterlab.Client("YOUR_API_KEY")
result = client.extract(
    url="https://www.flipkart.com/apple-iphone-15-pro-max-black-titanium-256-gb/p/itmdc5308fa78822",
    schema={
        "type": "object",
        "properties": {
            "title": {"type": "string"},
            "price": {"type": "number"},  # Converted from string like "₹1,44,900" → 144900
            "rating": {"type": "number"},
            "availability": {"type": "string"},
            "brand": {"type": "string"},
            "storage": {"type": "string"}
        },
        "required": ["title", "price"]
    }
)
print(result.data)
# Output: {"title": "Apple iPhone 15 Pro Max", "price": 144900, "rating": 4.5, ...}

Cortex handles:

  • Currency/number parsing
  • Missing field normalization
  • Schema validation and type coercion
  • Fallback to traditional selectors when AI confidence is low

Cost breakdown

Flipkart's anti-bot landscape typically requires T2-T3 tiers. AlterLab auto-escalates from T1—you pay only for the tier that successfully retrieves data.

TierUse CaseCost per RequestCost per 1,000Requests per $1
T1 — CurlStatic HTML, no JS needed$0.0002$0.205,000
T2 — HTTPStandard pages with headers$0.0003$0.303,333
T3 — StealthProtected pages, anti-bot active$0.002$2.00500
T4 — BrowserFull JS rendering required$0.004$4.00250
T5 — CAPTCHACAPTCHA solving + JS rendering$0.02$20.0050

View detailed pricing including volume discounts. Example monthly cost for 100K Flipkart product scrapes (avg T3): $200.

Best practices

  • Rate limiting: Start with 1 request/second per IP, adjust based on response headers
  • Robots.txt compliance: Check https://www.flipkart.com/robots.txt for disallowed paths
  • Error handling: Implement
Share

Was this article helpful?

Frequently Asked Questions

Scraping publicly accessible data from Flipkart is generally permissible under laws like hiQ v. LinkedIn, but you must review Flipkart's robots.txt and Terms of Service, implement rate limiting, and avoid accessing login-protected or personal data. Users bear responsibility for compliance.
Flipkart employs standard anti-bot measures including rate limiting, header validation, and occasional JavaScript challenges. Raw HTTP requests often fail; AlterLab's Smart Rendering API handles proxy rotation, header management, and browser rendering automatically to maintain access to public data.
Costs range from $0.0002/request for static HTML (T1) to $0.004/request for full JavaScript rendering (T4), with AlterLab's auto-escalation ensuring you only pay for the successful tier. For typical Flipkart product pages requiring light JS handling, expect ~$0.002/request (T3 tier).