Scrape a Target product's reviews to JSON, with ratings, text, photos and incentivized and syndicated flags. Built on the Scrapier API: one HTTPS request, no headless browser to run, no parser to maintain.
Quickstart · Fields · CLI · FAQ
-
Get an API key from the Scrapier dashboard. No credit card needed to start.
-
Install:
pip install git+https://github.com/get-scrapier/Target-Reviews-Scraper
-
Run:
from scrapier_target_reviews import TargetReviews
client = TargetReviews(api_key="sk_live_...") # or set SCRAPIER_API_KEY
url = "https://www.target.com/p/-/A-92148487"
print(client.summary(url)) # distribution, totals, counts
for review in client.iter_reviews(url, verified_only=True,
max_items=200):
if review["incentivized"] or review["syndicated"]:
continue
print(review["rating"], review["text"][:70])The same code is in examples/quickstart.py.
- Sentiment analysis
- Review authenticity checks
- Competitor research
- Product quality monitoring
Walks a product's reviews, fifty a page, with the rating, the text, the photos, the per-aspect ratings and the seller's replies.
It flags incentivized and syndicated reviews separately, and
:meth:summary gives you the whole rating distribution in one read.
Wraps the target-reviews endpoint, 50 rows a page.
# 1. A list. For scripts and one-liners.
rows = client.reviews(url, max_items=100)
# 2. A generator. Streams, so you can stop early and stop paying.
for row in client.iter_reviews(url):
handle(row)
# 3. A page at a time. You hold the cursor, so you can resume later.
page = client.reviews_page(url)
save(page.items)
while page.has_more:
page = client.reviews_page(cursor=page.next_cursor)
save(page.items)A Page carries the rows plus the envelope:
page.items # the rows
page.next_cursor # opaque string, or None
page.has_more # bool
page.raw_responses # upstream payloads, when raw_data=True
page.data # the whole envelope
len(page) # number of rowsThis endpoint returns more than rows. These read the extra payloads, one request each:
summary()— The product's whole review picture in one read:average_rating,rating_distribution,total_reviews,total_ratings,positive_percentage,recommended_percentage,incentivized_countand the image and video counts. Usually cheaper than walking reviews to compute any of it.
Observed on live responses, not copied from a schema.
| Field | Notes |
|---|---|
id, entity_id, url |
identity |
rating |
the stars |
title, text |
the review |
recommended |
whether they recommend it |
verified |
whether Target confirmed the purchase |
incentivized |
whether the reviewer was given the product or paid -- see the quirks |
syndicated, source |
whether the review came from elsewhere |
secondary_ratings |
the per-aspect ratings |
helpful_votes, unhelpful_votes |
how others rated it |
images |
any photos |
responses |
the seller's or brand's reply |
labels |
the content judgments, when judgments |
author |
who wrote it |
language, original_language, translated |
what it was written in, and whether it was translated |
published_at |
when |
tcin, input_url, position, scraped_at |
request metadata |
| Argument | What it does |
|---|---|
sort_by |
How to order the reviews. One of: most_recent, helpfulness_desc, highest_rating, lowest_rating. |
rating_filter |
Keep only reviews at this star rating, 1 to 5. |
verified_only |
Only verified purchases. Off by default. |
photos_only |
Only reviews with photos. Off by default. |
judgments |
Run the content judgments that populate labels. On by default. |
label |
A label echoed back on the rows, for tagging a batch of requests as yours. |
reports |
Ask for an aggregate report alongside the reviews. |
incentivized is the flag that matters most here. Target
discloses reviews written in exchange for a free or discounted product,
and :meth:summary gives you incentivized_count for the whole
product. A star average that includes them is measuring something
different from one that does not.
syndicated is a separate question. A syndicated review came from
the manufacturer's own site rather than a Target customer. Filter both
it and incentivized for a read on actual Target buyers.
Read :meth:summary before walking. The rating distribution, totals
and percentages are all there in one request, so most "what do customers
think" questions need no walk at all.
secondary_ratings holds per-aspect scores (fit, value and so on)
where the product has them, which is a sharper signal than the overall
star count.
Target sits behind PerimeterX and occasionally blocks a request.
Measured live: one category URL came back 500 with Blocked: HTTP 435 and a captcha script, while a different category answered 200
in the same minute. It is bot detection reacting to the moment, not a
broken endpoint, so keep the client's max_retries above zero.
Each page is a billable request, so bound a broad walk:
client.reviews(url, max_items=200) # stop after 200 rows
client.reviews(url, max_pages=5) # stop after 5 requestsmax_items truncates mid-page rather than buying another page to fill a
quota. Checking your balance is free:
print(client.credits())
print(client.account())AsyncTargetReviews exposes every method TargetReviews does, with
identical arguments.
import asyncio
from scrapier_target_reviews import AsyncTargetReviews
async def main():
async with AsyncTargetReviews() as client:
rows = await client.reviews(url)
asyncio.run(main())For hundreds of inputs, submit one background job instead of paging:
job = client.bulk([...], max_items=1000) # up to 10,000 per input
print(job.job_id, job.status)
rows = job.wait(timeout=1800, poll_interval=5)Reattach from another process with client.job(job_id), then read
job.data.
Submits are deduplicated server-side on the request parameters, so an identical submit returns the job the first one created — including when that job failed. Vary a parameter to force a fresh attempt.
Everything derives from ScrapierError, so one except can catch the
lot while you still get to be specific when it matters.
from scrapier_target_reviews import InsufficientCreditsError, RateLimitError, ScrapierError
try:
rows = client.reviews(url)
except InsufficientCreditsError as exc:
print(f"out of credits: {exc.balance} left, {exc.required} needed")
except RateLimitError as exc:
print(f"slow down for {exc.retry_after}s")
except ScrapierError as exc:
print(f"something else: {exc}")| Exception | When |
|---|---|
ConfigurationError |
no API key, or a reserved parameter was passed |
TransportError |
the request never got a response |
BadRequestError |
400 — bad input |
AuthenticationError |
401 — bad or missing key |
InsufficientCreditsError |
402 with a balance — carries .balance and .required |
NotFoundError |
404 |
RateLimitError |
429 — carries .retry_after |
ScrapeTimeoutError |
504 — the scrape itself ran out of time |
ServiceUnavailableError |
503 |
ServerError |
5xx |
JobFailedError |
a bulk job finished in failed — carries .errors |
APIError |
the base for anything with a status code |
429, 503, 5xx and transport failures are retried automatically with
jittered backoff that honours Retry-After. 400, 401, 404 and a 402
about your balance are not — retrying those only wastes time.
export SCRAPIER_API_KEY=sk_live_...
scrapier-target-reviews <url> --max-items 50 --jsonlJSON on stdout and nothing else, so it pipes. Global flags (--api-key,
--base-url, --timeout, --jsonl, --indent) work anywhere on the
line. Exit codes: 0 success, 2 usage or configuration, 3 API
error.
TargetReviews(
api_key=None, # falls back to $SCRAPIER_API_KEY
base_url=None, # falls back to $SCRAPIER_BASE_URL, then the default
timeout=150.0,
max_retries=3, # for 429/503/5xx and transport failures
http_client=None, # bring your own httpx.Client
)The key is sent in the X-API-Key header only — never in a URL or a
request body, so it will not end up in a proxy log.
Every call also accepts method="GET" if you would rather the
parameters went in the query string, use_proxy=True to route the
scrape through Scrapier's proxy pool, and raw_data=True to get the
upstream payloads instead of parsed rows.
Python 3.9+. The only dependency is httpx. Ships py.typed.
The client code is MIT-licensed. It needs a Scrapier API key, and requests are billed in credits; failed requests are not billed. See pricing. You can start without a credit card.
No. The scrape runs on Scrapier's servers and returns JSON.
Use bulk jobs: submit many inputs as one background job, then job.wait().
Yes. See AGENTS.md, or connect the
Scrapier MCP server.
180+ endpoints across 35+ platforms: browse them all.
Open an issue or read the docs.
MIT. See LICENSE.