Skip to content

About

Scrape Target.com as clean JSON/CSV - product search, categories and brands with prices, ratings and filters, product details with specs, UPC and variations, reviews, Q&A, store stock near a ZIP code, bulk price checks and a price/stock watcher, via the ScrapeUnblocker API. CLI + Python library.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Target Scraper

CI Python 3.11+ License: MIT Powered by ScrapeUnblocker

Scrape Target.com into clean JSON or CSV: product search, category and brand listings, full product details, guest reviews, questions and answers, store-level stock and bulk price checks, with a watcher for price drops, sales and restocks. For every product in a listing you get the TCIN, title, brand, current price, regular price, sale flag with the amount and percent saved, price ranges for products whose variations cost different amounts, unit price, the hidden "See price in cart" price, rating and rating count, badges ("Highly rated", "Bestseller", ...), promotions, sponsored flag, item type, DPCI, variation themes and image. Open a product to get its description, highlights, every specification (dimensions, weight, material, warranty, ...), UPC, department and breadcrumbs, rating distribution and breakdown (quality, value, ...), return policy, package size, images, videos and every variation (color, size) with its own TCIN and price. Check how many units each store near a ZIP code has, with in-store, pickup and curbside status, and price dozens of products at once against a store, including the aisle they are shelved in.

Powered by ScrapeUnblocker: target.com loads its product data from JSON endpoints in the browser, and the getPageSource API fetches those same answers for you. You don't need a Target account, cookies, proxies, a headless browser or retry logic of your own.

Want a Telegram, Discord, Slack or Pushover alert when a sold-out Target product is back in stock at your price, on a schedule? See restock-alerts.

Features

  • Search, categories and brands. Any keyword, any category (/c/...-/N-5xtro) or brand (/b/keurig/-/N-5uvm4) page, 24 products per page, every page or as many as you ask for, de-duplicated by TCIN and numbered by position. Several keywords in one run are merged.
  • Every Target filter. filters lists the filter groups Target offers for a listing (brand, price band, guest rating, color, type, features, sold by, deals, ...) with the option ids to pass to --filter; combine as many as you like. The filters Target actually applied are returned too, so you can check that every id was applied.
  • Seven sort orders. Relevance, featured, price low/high, guest rating, best selling and newest.
  • Prices you can compute with. Current and regular price as numbers, sale and clearance flags, amount and percent saved, price_low / price_high for price ranges, unit price ($0.54/fluid ounce) and the real price of "See price in cart" items.
  • Product details. Title, brand and brand id, description, highlights, specifications as label/value pairs, UPC, DPCI, item type, department, category and breadcrumbs, badges, promotions, free-shipping flag, purchase limit, return policy, package dimensions, images, videos and every variation with its attributes, TCIN, URL, image and price.
  • Reviews. Star rating, text, nickname, date, verified-purchase, recommended, incentivized and syndicated flags, helpful / unhelpful votes, secondary ratings (design, quality, value, ...), photo URLs and the brand's public reply. Sort by most recent, most helpful, highest or lowest rating; filter by star rating, verified purchases or reviews with photos; 50 per request. --summary gives the rating distribution, recommendation percentage and the topics guests mention with their share of positive mentions.
  • Questions and answers. Every guest question with its answers, authors, dates and votes.
  • Store stock. Units Target can promise at each store near a ZIP code, nearest first, with in-store, pickup (and pickup date) and curbside status, store address and phone.
  • Store finder. Stores near a ZIP code with address, phone, time zone and opening hours for the coming days.
  • Bulk price checks. Price, sale flag, shipping status and the store's stock and aisle for any number of TCINs, 24 per request.
  • Price and stock watcher. watch remembers the last check and reports price_drop, price_increase, sale_started, sale_ended, back_in_stock, out_of_stock, new and removed, for a list of TCINs or for everything a search or category returns.
  • JSON, JSON Lines, CSV or a terminal table, a CLI and a typed Python library, retries with backoff, and offline tests.

Install

git clone https://github.com/ScrapeUnblocker/target-scraper.git
cd target-scraper
pip install .            # or: pip install -r requirements.txt
cp .env.example .env     # then put your key in it, or export it:
export SCRAPEUNBLOCKER_KEY=your_key_here

Get an API key at scrapeunblocker.com. The official scrapeunblocker SDK reads it from SCRAPEUNBLOCKER_KEY.

CLI usage

# Search results as a table, sorted by guest rating
target-scraper search "coffee maker" --sort rating

# Three pages of two searches as one de-duplicated CSV
target-scraper search "air fryer" "toaster oven" --pages 3 -o kitchen.csv

# Only products on sale, rated 4+ and under $100 (filtered after collecting)
target-scraper search "air fryer" --all --on-sale --min-rating 4 --max-price 100

# Filter ids for a listing, then filter by brand and price band (ids from the filters command)
target-scraper filters "coffee maker" --facet brand
target-scraper search "coffee maker" --filter 5uvm4 --filter 5zja5

# Any target.com search, category or brand URL (filters in the URL are kept)
target-scraper browse "https://www.target.com/c/coffee-makers-tea-espresso-kitchen-appliances-dining/-/N-5xtro" --sort price-low
target-scraper browse "https://www.target.com/b/keurig/-/N-5uvm4" --all -o keurig.jsonl

# Product details (TCIN or product URL) as JSON, or many products as CSV
target-scraper product https://www.target.com/p/-/A-92038440
target-scraper product --from-file tcins.txt -o products.csv

# Reviews: most helpful verified 1-star reviews, every review, or the rating summary
target-scraper reviews 92038440 --sort helpful --stars 1 --verified
target-scraper reviews 92038440 --all -o reviews.csv
target-scraper reviews 92038440 --summary

# Questions and answers
target-scraper questions 92038440 --sort recent --all

# Units in stock at the stores near a ZIP code, and the stores themselves
target-scraper stock 91863921 --zip 10001 --available
target-scraper stores --zip 10001 --limit 5

# Price, shipping, store stock and aisle for many products (nearest store to the ZIP)
target-scraper prices 92038440 91863921 --zip 55403
target-scraper prices --from-file tcins.txt --store 1375 -o prices.csv

# Price drops, sales and restocks since the last run (run it daily from cron)
target-scraper watch --from-file tcins.txt --zip 55403 --state prices.json
target-scraper watch --search "lego star wars" --pages 2 --zip 55403 --state lego.json

Common options: -f/--format json|jsonl|csv|table (default from the -o extension), -o/--output FILE, --retries N, --no-cache, -v/--verbose. Listing commands also take --store ID or --zip ZIP to price against a store instead of Target's online prices.

Library usage

from target_scraper import Listing, TargetScraper, to_csv_file

target = TargetScraper()  # reads SCRAPEUNBLOCKER_KEY; TargetScraper(api_key="...") also works

page = target.search("coffee maker", sort="rating")
print(page.total_results, page.total_pages)
for p in page.products[:5]:
    print(p.tcin, p.title, p.price, p.regular_price, p.on_sale, p.rating, p.rating_count)

# Filters: ids from target.filters(...), several at once; check what Target applied
brands = next(f for f in target.filters(Listing(keyword="coffee maker")) if f.name == "Brand")
keurig = target.search("coffee maker", filters=["5uvm4", "5zja5"])
print(keurig.applied_filters)

# Many pages, de-duplicated; categories and brands work the same way
products = target.products(Listing(keyword="air fryer", sort="bestselling"), pages=3)
to_csv_file(products, "air-fryers.csv")
category = target.listing("https://www.target.com/c/coffee-makers/-/N-5xtro")

# Product details, reviews, questions
details = target.product("https://www.target.com/p/-/A-92038440")
print(details.price.current, details.price.regular, details.upc, details.specifications)
for v in details.variations:
    print(v.tcin, v.attributes, v.price)
reviews = target.reviews(details, sort="helpful", verified=True)
print(reviews.stats.distribution, reviews.stats.topics)
every_review = list(target.iter_reviews(details, pages=None))
questions = target.questions(details).questions

# Stores, stock, bulk prices and watching (prices need a store or a ZIP code)
stores = target.stores("10001", limit=5)
stock = target.stock(details, "10001", available_only=True)
local = TargetScraper(zip_code="55403")
checks = local.prices(["92038440", "91863921"])
changes = local.watch(["92038440", "91863921"], state_path="prices.json")

Examples

Script What it does
examples/search_to_csv.py Export several pages of a search to CSV and list the deals
examples/store_stock.py Nearest stores that have a product in stock, with units per store
examples/review_digest.py Rating distribution, topics and the most helpful critical reviews
examples/price_watch.py Cron-ready alert for price drops, new sales and restocks

Example output

target-scraper search "coffee maker" --sort rating --limit 8

#  TCIN      PRICE    WAS      RATING    BRAND                   TITLE
1  93008139  $349.99           5.00 (2)  Technivorm Moccamaster  Technivorm Moccamaster 10c KBT Drip Coffee Maker Polished Silver
2  94600031  $405.99           5.00 (1)  Technivorm Moccamaster  Technivorm Moccamaster CDT Coffee Maker Grand
3  92466281  $99.99            5.00 (5)  Haden                   HADEN Generous 14c Digital Drip Coffee Maker Ivory and Chrome: 14 Cup Capacity,~
4  91770720  $161.99           5.00 (1)  BLACK+DECKER            BLACK+DECKER Family Single Serve K-Cup Brewer: Lrg 50oz Water Reservoir, Versat~
5  89697012  $119.95           5.00 (1)  ChefWave                ChefWave Espresso Machine (Black) with Holder, Cups and Handheld Milk Frother
6  88182035  $42.99   $47.29   5.00 (1)  Brentwood               Brentwood® 4-Cup 800-Watt Electric Stainless Steel Turkish Coffee Maker
7  87617427  $54.98   $69.99   5.00 (1)  Brentwood               Brentwood Single Cup Coffee Maker - White
8  84159547  $128.10  $319.99  5.00 (4)  Haden                   Haden Heritage 12 Cup Programmable Vintage Retro Home Coffee Maker Machine with~

target-scraper product 92038440 (trimmed)

{
  "tcin": "92038440",
  "title": "Keurig K-Duo Hot & Iced Single-Serve & Carafe Coffee Maker Black: Electric Drip Coffee Pot, 72 oz Capacity",
  "url": "https://www.target.com/p/keurig-k-duo-hot-38-iced-single-serve-38-carafe-coffee-maker-black/-/A-92038440",
  "brand": "Keurig",
  "brand_id": "5uvm4",
  "price": {
    "current": 129.99,
    "regular": 189.99,
    "kind": "sale",
    "on_sale": true,
    "save_amount": 60.0,
    "save_percent": 32.0,
    "text": "$129.99",
    "currency": "USD"
  },
  "rating": 4.39,
  "rating_count": 2093,
  "review_count": 940,
  "question_count": 112,
  "rating_distribution": {"5": 1566, "4": 201, "3": 81, "2": 57, "1": 188},
  "rating_breakdown": {"design": 3.72, "ease of use": 4.01, "quality": 3.01, "easy to clean": 3.78, "value": 2.98},
  "specifications": {
    "Dimensions (Overall)": "12.7 Inches (H) x 11.1 Inches (W) x 12.9 Inches (D)",
    "Weight": "10 Pounds",
    "Features": "Brews Iced Coffee, ...",
    "Capacity (Volume)": "72 fl oz (US)"
  },
  "upc": "611247401859",
  "dpci": "072-08-3014",
  "department": "SMALL APPLIANCES",
  "breadcrumbs": ["Kitchen & Dining", "Kitchen Appliances", "Coffee & Espresso Makers", "Drip Coffee Makers"],
  "badges": ["Highly rated"],
  "free_shipping": true,
  "purchase_limit": 10
}

target-scraper stock 91863921 --zip 10001 --limit 5

STORE  MILES  QTY  IN STORE  PICKUP    NAME                      CITY
3277   0.3    8    IN_STOCK  IN_STOCK  Manhattan Herald Square   New York
3412   0.3    4    IN_STOCK  IN_STOCK  Chelsea 23rd and 8th      New York
3385   0.7    7    IN_STOCK  IN_STOCK  Times Square 42nd Street  New York
3268   0.9    3    IN_STOCK  IN_STOCK  Manhattan Hells Kitchen   New York
3321   1.0    5    IN_STOCK  IN_STOCK  Kips Bay                  New York

target-scraper prices 92038440 91863921 --zip 10001

TCIN      PRICE    WAS      SHIPPING  STORE QTY  AISLE  TITLE
92038440  $129.99  $189.99  IN_STOCK  10         C4     Keurig K-Duo Hot & Iced Single-Serve & Carafe Coffee Maker Black: Electric Drip~
91863921  $24.99            IN_STOCK  4          C4     Mr. Coffee 5-Cup Programmable Coffee Maker Black: Drip Coffee Machine, Electric~

target-scraper reviews 92038440 --sort highest --limit 5

DATE        STARS  VERIFIED  HELPFUL  AUTHOR   REVIEW
2026-10-18  5      yes       0        Lynn     Brews quickly. Haven't gotten programing down quite yet.
2026-09-22  5      yes       0        Missy    I love this Keurig coffee maker. A whole pot or a single cup all in one!
2026-09-04  5      yes       0        Maricar  It was perfect.
2026-08-29  5      yes       0        BH       Fast hot coffee
2026-08-11  5      yes       0        CRK1003  I love that the water container is easy to clean as well as the lift away porti~

watch prints nothing new on its first run (it only saves --state); later runs list one row per change with the TCIN, the kind of change, the old and new price and the title.

How it works

target.com's pages fill themselves from public JSON endpoints: redsky.target.com for search, product, stock, store and price data and r2d2.target.com for reviews and questions. The scraper requests the same URLs with the same parameters the site uses, through the ScrapeUnblocker getPageSource API, and turns the answers into typed records.

Those endpoints expect the public client key that target.com publishes in the __CONFIG__ script of every page. The scraper reads it from the home page the first time it runs (one extra request) and caches it in ~/.cache/target-scraper/web-config.json (or $XDG_CACHE_HOME) for 12 hours; if an answer stops making sense with a cached key, the key is read again. --no-cache / cache_path=None turns the cache off.

Data Endpoint Requests
Search, category, brand results and filters plp_search_v2 1 per 24 products
Product details and variations pdp_client_v1 1 per product
Reviews and rating summary ggc/v2/summary 1 per 50 reviews
Questions and answers ggc/Q&A/v1/question-answer 1 per 20 questions
Stock at nearby stores fiats_v1 1 per product
Stores near a ZIP code nearby_stores_v1 1
Price checks product_summary_with_fulfillment_v1 1 per 24 products

Things worth knowing:

  • Online prices by default. Listings and product pages are priced with Target's online prices. Pass --store / --zip to price against a store (some items, groceries for example, are priced per store).
  • Price checks need a store. Target does not price the bulk endpoint without one, so prices and watch take --zip (the nearest store is used) or --store.
  • Sponsored placements are left out unless you pass --sponsored; Target repeats them among the organic results, and the scraper keeps each TCIN once.
  • An unmatched keyword still returns products. Target answers a search that matches nothing with a page of popular products instead of an empty page. The scraper logs a warning when no result mentions any word of the keyword.
  • Variation children. A listing can show one color of a product; its parent_tcin is the product with every color, and the rating comes from the parent when the child has none. product <parent TCIN> lists every variation with its own TCIN and price.
  • Category URLs. browse works with category (/c/) and brand (/b/) pages. Some landing pages use an N- id that is not a category, and Target refuses those; use the category link from the page's breadcrumbs instead.
  • Filters are listing-specific. The option ids from filters belong to that listing; an id Target does not apply shows up as an empty applied_filters and a warning.
  • Stock is what Target reports: quantity is the number of units Target says it can promise at that store, as shown to shoppers checking store availability.
  • US only. Target operates in the United States, so requests are routed through the US.

Project layout

target-scraper/
├── src/target_scraper/
│   ├── __init__.py      # public API and __version__
│   ├── scraper.py       # TargetScraper: fetch + retries, search, product, reviews, stock, prices, watch
│   ├── parsing.py       # JSON answers -> records
│   ├── webconfig.py     # target.com's public client keys, read once and cached
│   ├── urls.py          # TCINs, target.com URLs, sort orders, endpoint URLs
│   ├── models.py        # dataclasses with to_dict / to_row / table layouts
│   ├── monitor.py       # price snapshots and change detection
│   ├── export.py        # JSON / JSONL / CSV / table output
│   └── cli.py           # target-scraper command
├── examples/            # search export, store stock, review digest, price watch
├── tests/               # offline tests with a mocked client (no API credit used)
├── pyproject.toml
├── Makefile
└── .github/workflows/ci.yml

Development

pip install -e ".[dev]"
make lint      # ruff check + ruff format --check
make test      # pytest, offline
make format    # ruff format

The tests use small answers built from the real structure of Target's JSON and a fake client, so they run without an API key or network access.

Links

License

MIT - Copyright (c) 2026 ScrapeUnblocker. This project is not affiliated with or endorsed by Target Corporation. Respect Target's terms of use.

About

Scrape Target.com as clean JSON/CSV - product search, categories and brands with prices, ratings and filters, product details with specs, UPC and variations, reviews, Q&A, store stock near a ZIP code, bulk price checks and a price/stock watcher, via the ScrapeUnblocker API. CLI + Python library.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages