Flipkart APIflipkart.com ↗
Fetch Flipkart product ratings summaries and paginated individual reviews including star breakdowns, author details, and certified buyer flags via 2 endpoints.
What is the Flipkart API?
The Flipkart Reviews API provides 2 endpoints to retrieve product rating summaries and individual customer reviews from Flipkart. The get_rating_summary endpoint returns the average rating, total ratings count, total reviews count, and a full star-level breakdown (1–5 stars). The get_reviews endpoint returns up to 10 reviews per page with author, rating, title, body text, date, location, and certified buyer status.
curl -X GET 'https://api.parse.bot/scraper/dfeb72c1-9b76-4102-a752-70e10f3a0c50/get_rating_summary?product_url=%2Fnivea-body-milk-nourishing-lotion-400ml-120-ml-pack-2%2Fproduct-reviews%2Fitmf6y86zahhzntz%3Fpid%3DMSCF6Y86XFKRFZDG%26lid%3DLSTMSCF6Y86XFKRFZDG42HEUC' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace flipkart-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
Flipkart Product Reviews API Client
Get your API key from: https://parse.bot/settings
"""
import os
import requests
from typing import Optional, Dict, Any
from urllib.parse import urlencode
class ParseClient:
"""Client for interacting with the Parse API for Flipkart product reviews."""
def __init__(self, api_key: Optional[str] = None):
"""
Initialize the Parse API client.
Args:
api_key: API key for authentication. If not provided, reads from PARSE_API_KEY env var.
"""
self.base_url = "https://api.parse.bot"
self.scraper_id = "dfeb72c1-9b76-4102-a752-70e10f3a0c50"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError("API key not provided and PARSE_API_KEY environment variable not set")
def _call(self, endpoint: str, method: str = "POST", **params) -> Dict[str, Any]:
"""
Make a request to the Parse API.
Args:
endpoint: The endpoint name (e.g., 'get_rating_summary')
method: HTTP method - 'GET' or 'POST'
**params: Parameters to send with the request
Returns:
The JSON response from the API
"""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json"
}
if method.upper() == "GET":
response = requests.get(url, headers=headers, params=params)
else: # POST
response = requests.post(url, headers=headers, json=params)
response.raise_for_status()
return response.json()
def get_rating_summary(
self,
product_url: str,
sort_order: str = "MOST_RECENT"
) -> Dict[str, Any]:
"""
Get the rating summary for a Flipkart product.
Args:
product_url: Flipkart product reviews URL path (e.g., /product-name/product-reviews/itemid?pid=...)
sort_order: Sort order - MOST_RECENT, MOST_HELPFUL, POSITIVE_FIRST, NEGATIVE_FIRST
Returns:
Rating summary data including average rating, total ratings, and breakdown by stars
"""
return self._call(
"get_rating_summary",
method="GET",
product_url=product_url,
sort_order=sort_order
)
def get_reviews(
self,
product_url: str,
page: str = "1",
sort_order: str = "MOST_RECENT",
certified_buyer: str = "false"
) -> Dict[str, Any]:
"""
Get individual product reviews with full details.
Args:
product_url: Flipkart product reviews URL path
page: Page number for pagination (1-based)
sort_order: Sort order - MOST_RECENT, MOST_HELPFUL, POSITIVE_FIRST, NEGATIVE_FIRST
certified_buyer: Filter to certified buyer reviews - 'true' or 'false'
Returns:
Paginated reviews data with individual review details
"""
return self._call(
"get_reviews",
method="GET",
product_url=product_url,
page=page,
sort_order=sort_order,
certified_buyer=certified_buyer
)
def analyze_product_reviews():
"""
Practical workflow: Analyze a Flipkart product's reviews comprehensively.
This example demonstrates:
1. Getting rating summary for overview statistics
2. Fetching reviews across multiple pages
3. Analyzing patterns in the review data
"""
client = ParseClient()
# Example product URL - this would be a real Flipkart product reviews URL
product_url = "/nivea-body-milk-nourishing-lotion-400ml-120-ml-pack-2/product-reviews/itmf6y86zahhzntz?pid=MSCF6Y86XFKRFZDG&lid=LSTMSCF6Y86XFKRFZDG42HEUC"
print("=" * 80)
print("FLIPKART PRODUCT REVIEWS ANALYSIS")
print("=" * 80)
# Step 1: Get rating summary
print("\n[1] Fetching rating summary...")
rating_response = client.get_rating_summary(product_url, sort_order="MOST_HELPFUL")
if rating_response.get("status") == "success":
rating_data = rating_response.get("data", {})
print(f"\n📊 RATING SUMMARY:")
print(f" Average Rating: {rating_data.get('average_rating', 'N/A')}/5.0")
print(f" Total Ratings: {rating_data.get('total_ratings', 'N/A'):,}")
print(f" Total Reviews: {rating_data.get('total_reviews', 'N/A'):,}")
# Display rating breakdown
breakdown = rating_data.get("rating_breakdown", {})
print(f"\n⭐ RATING BREAKDOWN:")
for star_count in [5, 4, 3, 2, 1]:
key = f"{star_count}_star"
count = breakdown.get(key, 0)
percentage = (count / rating_data.get('total_ratings', 1)) * 100
bar = "█" * int(percentage / 2)
print(f" {star_count}★ {bar} {count:,} ({percentage:.1f}%)")
# Step 2: Fetch reviews from multiple pages
print(f"\n[2] Fetching reviews (most helpful first)...")
all_reviews = []
pages_to_fetch = min(3, (rating_data.get('total_reviews', 10) // 10) + 1) # Fetch up to 3 pages
for page_num in range(1, pages_to_fetch + 1):
print(f" Loading page {page_num}...")
reviews_response = client.get_reviews(
product_url,
page=str(page_num),
sort_order="MOST_HELPFUL",
certified_buyer="false"
)
if reviews_response.get("status") == "success":
reviews_data = reviews_response.get("data", {})
reviews = reviews_data.get("reviews", [])
all_reviews.extend(reviews)
else:
break
# Step 3: Analyze review patterns
print(f"\n[3] ANALYZING {len(all_reviews)} REVIEWS:")
rating_distribution = {5: 0, 4: 0, 3: 0, 2: 0, 1: 0}
certified_count = 0
avg_helpful = 0
locations_seen = set()
for review in all_reviews:
rating = review.get("rating", 0)
rating_distribution[rating] = rating_distribution.get(rating, 0) + 1
if review.get("certified_buyer"):
certified_count += 1
avg_helpful += review.get("helpful_count", 0)
location = review.get("location", {})
if location.get("city"):
locations_seen.add(f"{location.get('city')}, {location.get('state', 'N/A')}")
avg_helpful = avg_helpful / len(all_reviews) if all_reviews else 0
print(f" Certified Buyers: {certified_count}/{len(all_reviews)} ({(certified_count/len(all_reviews)*100):.1f}%)")
print(f" Avg Helpful Count: {avg_helpful:.1f}")
print(f" Unique Locations: {len(locations_seen)}")
# Sample reviews
print(f"\n[4] SAMPLE REVIEWS (Top {min(3, len(all_reviews))} Most Helpful):")
for i, review in enumerate(all_reviews[:3], 1):
print(f"\n Review #{i}:")
print(f" 👤 {review.get('author', 'Anonymous')}")
print(f" ⭐ Rating: {review.get('rating')}/5")
print(f" ✍️ Title: {review.get('title', 'No title')}")
print(f" 📝 {review.get('text', 'No text')[:100]}...")
print(f" 📅 Date: {review.get('created', 'N/A')}")
print(f" 👍 Helpful: {review.get('helpful_count', 0)}")
if review.get("product_attributes"):
attrs = ", ".join([f"{a.get('name')}: {a.get('value')}" for a in review.get("product_attributes", [])])
print(f" 📦 Variant: {attrs}")
print("\n" + "=" * 80)
print("Analysis complete!")
print("=" * 80)
if __name__ == "__main__":
analyze_product_reviews()Get the rating summary for a Flipkart product including average rating, total ratings count, total reviews count, and rating breakdown by each star level (1-5 stars).
| Param | Type | Description |
|---|---|---|
| sort_order | string | Sort order for reviews context. Accepts: MOST_RECENT, MOST_HELPFUL, POSITIVE_FIRST, NEGATIVE_FIRST. |
| product_urlrequired | string | Flipkart product reviews URL path including query params. Format: /product-name/product-reviews/itemid?pid=PRODUCT_ID&lid=LISTING_ID (e.g. /nivea-body-milk-nourishing-lotion-400ml-120-ml-pack-2/product-reviews/itmf6y86zahhzntz?pid=MSCF6Y86XFKRFZDG&lid=LSTMSCF6Y86XFKRFZDG42HEUC) |
{
"type": "object",
"fields": {
"rating_base": "integer, rating scale base (always 5)",
"total_ratings": "integer, total number of ratings",
"total_reviews": "integer, total number of written reviews",
"average_rating": "number, average product rating out of 5",
"rating_breakdown": "object with keys 5_star, 4_star, 3_star, 2_star, 1_star each containing the count of ratings at that level",
"histogram_base_count": "integer, the highest count in the histogram"
},
"sample": {
"data": {
"rating_base": 5,
"total_ratings": 168227,
"total_reviews": 12325,
"average_rating": 4.5,
"rating_breakdown": {
"1_star": 4706,
"2_star": 3792,
"3_star": 11602,
"4_star": 37443,
"5_star": 110684
},
"histogram_base_count": 110684
},
"status": "success"
}
}About the Flipkart API
Rating Summary
The get_rating_summary endpoint accepts a product_url — the Flipkart product reviews URL path including query parameters such as pid — and returns a structured summary: average_rating, total_ratings, total_reviews, rating_base, histogram_base_count, and a rating_breakdown object with individual counts for each star level from 1_star through 5_star. The optional sort_order parameter accepts MOST_RECENT, MOST_HELPFUL, POSITIVE_FIRST, or NEGATIVE_FIRST, though it primarily provides review context rather than changing the aggregate counts.
Individual Reviews
The get_reviews endpoint returns paginated review data, 10 reviews per page, for a given product_url. Each review object in the reviews array includes: id, author, rating, title, text, created (date), certified_buyer (boolean), helpful_count, location, and product_attribute (the specific product variant reviewed). Pagination is controlled via the page parameter (1-based). You can filter to certified buyer reviews only by passing certified_buyer=true, and sort results with the same four sort_order values available on get_rating_summary.
Parameters and Filtering
Both endpoints share the same product_url format: a path like /product-name/product-reviews/itemid?pid=PRODUCTID. This maps directly to the Flipkart product reviews page URL structure. The certified_buyer filter on get_reviews is useful when you want to analyze only verified purchase reviews separately from all reviews. The sort_order values let you retrieve the most recent reviews first or surface the most helpful or most polarized feedback.
Coverage Notes
The API covers per-product review content and rating aggregates. It does not currently expose seller reviews, Q&A data, or product listing details such as price or inventory. The product_attribute field in each review surfaces the variant (e.g. size or color) the reviewer purchased, which is useful when a single listing covers multiple variants.
The Flipkart API is a managed, monitored endpoint for flipkart.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when flipkart.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official flipkart.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track changes in
average_ratingandtotal_ratingsover time for competitor products on Flipkart. - Aggregate
rating_breakdownstar counts to compute sentiment distribution for a product category. - Filter reviews with
certified_buyer=trueto isolate verified purchase feedback for quality analysis. - Paginate through all reviews using the
pageparameter to build a full review corpus for NLP or topic modeling. - Extract
locationfields from reviews to understand regional satisfaction patterns for a product. - Monitor
helpful_countacross reviews sorted byMOST_HELPFULto identify the most influential customer opinions. - Compare
product_attributevalues across reviews to detect quality differences between product variants.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Flipkart have an official developer API for product reviews?+
What does the `get_reviews` endpoint return for each review, and how does the certified buyer filter work?+
id, author, rating, title, text, created, certified_buyer, helpful_count, location, and product_attribute. Setting certified_buyer=true restricts results to reviews from buyers Flipkart has verified as having purchased the product, which is indicated by the certified_buyer boolean field in every review object.How many reviews are returned per page, and is there a way to know the total number of pages?+
get_reviews endpoint returns 10 reviews per page. The response includes a reviews_count field indicating the number of reviews returned in that page. To determine the total page count, divide the total_reviews from get_rating_summary by 10. Pagination is 1-based via the page parameter.Does the API cover Q&A sections, seller ratings, or product listing details like price?+
get_reviews and rating aggregates via get_rating_summary. Q&A data, seller ratings, product prices, and inventory details are not currently included. You can fork this API on Parse and revise it to add endpoints targeting those data types.