Skip to content

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Target Scraper API by ScrapeBadger

Get API key Docs MCP server Pricing

Target Scraper API

Get target.com product data as JSON with one HTTP request. The Target Scraper API returns search results, category pages, full product pages with price and variants, reviews, customer questions, in-store stock near a ZIP code and store details. Each endpoint below has a runnable Python, Node.js and cURL example and the real response it returned.

What does a Target scraper do?

A Target scraper collects public product data from target.com, such as titles, prices, sale prices, ratings, reviews, questions and store stock, and turns it into structured data. Brands and retailers use it to track prices and promotions, check which stores have a product in stock, and read what shoppers say. With this API you send a keyword, a TCIN (Target's item number) or a ZIP code and get JSON back.

Contents

Quick start

  1. Create a free ScrapeBadger account. You get 1,000 free credits, no card needed.

  2. Copy your API key from the dashboard and export it:

    export SCRAPEBADGER_API_KEY="your_api_key"
  3. Make your first request: search Target products.

cURL

curl -sS --max-time 120 -G "https://scrapebadger.com/v1/target/search" \
  -H "X-API-Key: $SCRAPEBADGER_API_KEY" \
  --data-urlencode 'query=lego'

Python (pip install requests)

import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/search",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "lego",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js (18+, no dependencies)

const params = new URLSearchParams({
  query: 'lego',
});

const response = await fetch(`https://scrapebadger.com/v1/target/search?${params}`, {
  headers: { 'X-API-Key': process.env.SCRAPEBADGER_API_KEY },
  signal: AbortSignal.timeout(120000),
});
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(JSON.stringify(await response.json(), null, 2));

Every endpoint below has the same three versions in examples/, and the real response it returned is in output-samples/.

Endpoints

Base URL: https://scrapebadger.com. Authenticate with the X-API-Key header. Credits are charged only for successful requests.

Endpoint What it returns Credits per request Docs
GET /v1/target/markets List supported markets Free Docs
GET /v1/target/search Search products 5 Docs
GET /v1/target/category Browse a category 5 Docs
GET /v1/target/autocomplete Get search suggestions 5 Docs
GET /v1/target/stores Find nearby stores 5 Docs
GET /v1/target/stores/{store_id} Get store detail 5 Docs
GET /v1/target/categories Get categories 5 Docs
GET /v1/target/products/{tcin}/reviews Get product reviews 5 Docs
GET /v1/target/products/{tcin}/questions Get product questions 5 Docs
GET /v1/target/products/{tcin}/availability Get product availability 10 Docs
GET /v1/target/products/{tcin} Get product detail 10 Docs

Common parameters

Parameter Description Default
tcin Target item number (TCIN), the number after /A- in a target.com product URL.
zip_code US ZIP code, for local prices, stock and nearby stores.
store_id Target store ID, for store-specific price and stock. GET /v1/target/stores finds stores near a ZIP code. 1375
page Results page on search, category, reviews and questions. 1
page_size Results per page on search, category, reviews and questions.

Examples by endpoint

Each example prints the JSON response. The Python versions are below; Node.js and cURL versions are linked under each one.

Search Target products

GET /v1/target/search · Credits: 5 · Docs

Parameter Required Type Default Description
query Yes string What to search for, e.g. lego
page integer 1 Results page on search, category, reviews and questions.
page_size integer 24 Results per page on search, category, reviews and questions.
store_id string 1375 Target store ID, e.g. 1375. GET /v1/target/stores finds stores near a ZIP code.
zip_code string 55403 US ZIP code, e.g. 55403
sort enum relevance One of relevance, PriceLow, PriceHigh, RatingHigh, bestselling, newest.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/search",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "lego",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (332 KB)

Get product details

GET /v1/target/products/{tcin} · Credits: 10 · Docs

Parameter Required Type Default Description
tcin Yes string Target item number (TCIN), the number after /A- in a target.com product URL, e.g. 80179068
store_id string 1375 Target store ID, e.g. 1375. GET /v1/target/stores finds stores near a ZIP code.
zip_code string 55403 US ZIP code, e.g. 55403
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

tcin = "52699306"

response = requests.get(
    f"https://scrapebadger.com/v1/target/products/{tcin}",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (28 KB)

Get product reviews

GET /v1/target/products/{tcin}/reviews · Credits: 5 · Docs

Parameter Required Type Default Description
tcin Yes string Target item number (TCIN), the number after /A- in a target.com product URL, e.g. 80179068
page integer 1 Results page on search, category, reviews and questions.
page_size integer 10 Results per page on search, category, reviews and questions.
sort enum most_recent One of most_recent, most_helpful, highest_rated, lowest_rated.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

tcin = "52699306"

response = requests.get(
    f"https://scrapebadger.com/v1/target/products/{tcin}/reviews",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (48 KB)

Get product questions

GET /v1/target/products/{tcin}/questions · Credits: 5 · Docs

Parameter Required Type Default Description
tcin Yes string Target item number (TCIN), the number after /A- in a target.com product URL, e.g. 80179068
page integer 1 Results page on search, category, reviews and questions.
page_size integer 10 Results per page on search, category, reviews and questions.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

tcin = "52699306"

response = requests.get(
    f"https://scrapebadger.com/v1/target/products/{tcin}/questions",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (13 KB)

Check store stock near a ZIP code

GET /v1/target/products/{tcin}/availability · Credits: 10 · Docs

Parameter Required Type Default Description
tcin Yes string Target item number (TCIN), the number after /A- in a target.com product URL, e.g. 80179068
zip_code Yes string US ZIP code, e.g. 55403
limit integer 10 Number of stores to return
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

tcin = "52699306"

response = requests.get(
    f"https://scrapebadger.com/v1/target/products/{tcin}/availability",
    headers={"X-API-Key": API_KEY},
    params={
        "zip_code": "55403",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (71 KB)

Browse a category

GET /v1/target/category · Credits: 5 · Docs

Parameter Required Type Default Description
category_id Yes string Target category ID, the code after /N- in a target.com category URL, e.g. 5xt8r (Building Sets)
page integer 1 Results page on search, category, reviews and questions.
page_size integer 24 Results per page on search, category, reviews and questions.
store_id string 1375 Target store ID, e.g. 1375. GET /v1/target/stores finds stores near a ZIP code.
zip_code string 55403 US ZIP code, e.g. 55403
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/category",
    headers={"X-API-Key": API_KEY},
    params={
        "category_id": "5xt8r",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (415 KB)

List categories

GET /v1/target/categories · Credits: 5 · Docs

Parameter Required Type Default Description
category_id string 5xtly Target category ID, the code after /N- in a target.com category URL, e.g. 5xt8r (Building Sets)
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/categories",
    headers={"X-API-Key": API_KEY},
    params={
        "category_id": "5xtb0",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (19 KB)

Get search suggestions

GET /v1/target/autocomplete · Credits: 5 · Docs

Parameter Required Type Default Description
query Yes string What to search for, e.g. lego
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/autocomplete",
    headers={"X-API-Key": API_KEY},
    params={
        "query": "lego st",
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (1 KB)

Find stores near a ZIP code

GET /v1/target/stores · Credits: 5 · Docs

Parameter Required Type Default Description
zip_code Yes string US ZIP code, e.g. 55403
limit integer 10 Number of stores to return
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/stores",
    headers={"X-API-Key": API_KEY},
    params={
        "zip_code": "55403",
        "limit": 5,
    },
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (123 KB)

Get store details

GET /v1/target/stores/{store_id} · Credits: 5 · Docs

Parameter Required Type Default Description
store_id Yes string Target store ID, e.g. 1375. GET /v1/target/stores finds stores near a ZIP code.
import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

store_id = "1375"

response = requests.get(
    f"https://scrapebadger.com/v1/target/stores/{store_id}",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (31 KB)

List supported markets

GET /v1/target/markets · Credits: Free · Docs

import json
import os

import requests

API_KEY = os.environ["SCRAPEBADGER_API_KEY"]

response = requests.get(
    "https://scrapebadger.com/v1/target/markets",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Node.js · cURL · Output sample (1 KB)

Example output

A real response from GET /v1/target/search, trimmed to the first items of each list. The full response is in output-samples/search.json.

{
  "query": "lego",
  "total_results": 524,
  "products": [
    {
      "tcin": "95046294",
      "requested_tcin": null,
      "title": "LEGO Snowman Ornaments 40812",
      "url": "https://www.target.com/p/lego-snowman-ornaments-40812/-/A-95046294",
      "brand": "LEGO",
      "description": null,
      "price": {
        "current_retail": 8.99,
        "display_was_now": false,
        "formatted_comparison_price": "$12.99",
        "formatted_comparison_price_type": "reg",
        "formatted_current_price": "$8.99",
        "formatted_current_price_type": "sale",
        "reg_retail": 12.99,
        "save_dollar": 4.0,
        "save_percent": 31.0,
        "location_id": 3991,
        "price_handle": "When purchased online"
      },
      "currency": "USD",
      "images": [
        "https://target.scene7.com/is/image/Target/GUEST_5d5a4676-3abe-4211-99f3-147c70956df3"
      ],
      "videos": [
        {
          "is_list_page_eligible": false,
          "video_files": [
            {
              "mime_type": "video/mp4",
              "video_url": "https://target.scene7.com/is/content/Target/GUEST_962c2c39-4184-475b-848e-42dd91674b13"
            }
          ]
        }
      ],
      "specifications": [
        "<B>Number of Pieces:</B> 168"
      ],
      "highlights": [
        "SNOWMAN FIGURES FOR KIDS – Make wishes of a white Christmas come true with the LEGO Snowman Ornaments (40812) Christmas building toy for girls and boys ages 6 years old and up"
      ],
      "fulfillment": {},
      "promotions": [],
      "ratings_and_reviews": {
        "statistics": {
          "rating": {
            "average": 4.88,
            "count": 123,
            "secondary_averages": [
              {
                "id": "broad age appeal",
                "label": "broad age appeal",
                "value": 4.64
              }
            ]
          }
  …

Use it with AI agents (MCP)

ScrapeBadger runs a hosted MCP server, so Claude, Cursor, ChatGPT and other agents can call the Target endpoints as tools, with no code.

  • Claude (claude.ai or Claude Desktop): Settings → Connectors → Add custom connector → https://mcp.scrapebadger.com/mcp, then sign in. No API key needed.
  • Cursor, VS Code, Windsurf and other clients: add this server to your MCP config:
{
  "mcpServers": {
    "scrapebadger": {
      "url": "https://mcp.scrapebadger.com/mcp?apis=target",
      "headers": { "Authorization": "Bearer YOUR_SCRAPEBADGER_API_KEY" }
    }
  }
}

Then ask:

Find the 10 best-rated LEGO sets on Target under $50, and check which ones are in stock at stores near ZIP 55403.

Setup guides for each client are in the MCP docs.

Use cases

Use case What you collect Endpoints
Price monitoring Current price, regular price and promotions for the items you track Get product details, Search Target products
Local stock checks Which stores near a ZIP code have an item, and how many Check store stock near a ZIP code, Find stores near a ZIP code
Review and Q&A analysis Review text, stars and dates, and the questions shoppers ask before buying Get product reviews, Get product questions
Assortment and category research What Target lists in a category, at what price and rating Browse a category, List categories, Search Target products
Keyword research What shoppers type into target.com search Get search suggestions
Store data Store address, phone, hours and services Get store details, Find stores near a ZIP code

Pricing

  • Each endpoint's credit cost is listed in the endpoints table.
  • Only successful requests are billed. Blocked, empty and failed results cost nothing.
  • New accounts get 1,000 free credits. After that, pay as you go or pick a monthly plan. Credits on pay-as-you-go never expire.

See ScrapeBadger pricing for the price per credit on each plan.

Errors

Errors come back as JSON with a detail field (and an error code on some).

Status Meaning What to do
400 / 422 A parameter is missing or invalid Check the parameter table for the endpoint
401 Missing, invalid or expired API key Send the key in the X-API-Key header
402 Out of credits Top up or upgrade in the dashboard
403 The key can't call this API, or the request came from an IP the key doesn't allow Check the key's scopes and IP allowlist
404 The item, page or profile doesn't exist (or is no longer public) Check the ID; not billed
429 Over your account's max concurrency Wait Retry-After (1 s) and retry; run fewer calls in parallel (concurrency)
502 / 503 / 504 The target site failed or timed out on this attempt Not billed. Retry with backoff

Long calls can run asynchronously: send Prefer: respond-async and poll the returned request_id (async requests).

FAQ

Is it legal to scrape Target?

Collecting publicly available product data, such as prices, descriptions and public reviews, is generally lawful in most jurisdictions. This API only reads pages anyone can see on target.com without signing in. You're responsible for how you store and use the data, so check the rules that apply to you and ask a lawyer if you're unsure.

What Target data can I get?

Search and category results, product pages (title, price, variants, images, rating and specifications), reviews, customer questions and answers, stock at stores near a ZIP code, store details, store search by ZIP code, the subcategories of any category and search suggestions. See the endpoints table.

How much does it cost?

Each request costs a fixed number of credits, shown in the endpoints table, and only successful requests are billed. You get 1,000 free credits when you sign up, then pay as you go or pick a plan on the pricing page.

Which countries are supported?

target.com (United States). Prices and stock depend on the store and ZIP code you pass.

How fast is it, and are there rate limits?

Most calls answer in 1 to 1.5 seconds, and the slowest within 3 to 5 seconds. There's no per-minute cap: you can run as many requests in parallel as your plan's max concurrency allows, and a request over it gets 429 without being billed.

Other languages

These examples use plain HTTP. Official SDKs wrap every endpoint with types and retries:

Language Repository Install
Python scrape-badger/scrapebadger-python pip install scrapebadger
Node.js / TypeScript scrape-badger/scrapebadger-node npm install scrapebadger
Go scrape-badger/scrapebadger-go
Java scrape-badger/scrapebadger-java
C# scrape-badger/scrapebadger-csharp
PHP scrape-badger/scrapebadger-php
Ruby scrape-badger/scrapebadger-ruby
Rust scrape-badger/scrapebadger-rust
Kotlin scrape-badger/scrapebadger-kotlin
Swift scrape-badger/scrapebadger-swift
Dart scrape-badger/scrapebadger-dart
C++ scrape-badger/scrapebadger-cpp

There is also a CLI (pip install scrapebadger-cli) and an n8n node.

Related scrapers

  • Walmart Scraper API: Search, product pages, prices, reviews, sellers, deals and stores on walmart.com
  • Best Buy Scraper API: Search, products, specs, prices, reviews, Q&A, deals and pickup on bestbuy.com
  • Amazon Scraper API: Products, search, offers, reviews, bestsellers, deals and sellers on 20 marketplaces
  • E-commerce Scraper API: Every marketplace we cover, with one example repo per marketplace

Learn more

Disclaimer

ScrapeBadger is an independent tool and is not affiliated with, endorsed by, or sponsored by Target. Target is a trademark of its respective owner, used here only to describe the platform this scraper works with. This repository only covers publicly available data. You are responsible for how you use the data you collect and for following the laws that apply to you.

License

MIT. The examples are free to copy into your own projects.