Skip to content

Repository files navigation

nike-scraper

CI Python License: MIT

Scrape Nike.com product listings into clean, typed JSON or CSV — no HTML selectors, no blocks.

Give it a search term (or a full Nike URL) and get back a tidy list of products: title, category, price and currency, colorway, discount, style code, product URL and image. Prices are localized by country.

Powered by ScrapeUnblocker. Nike.com is rendered in a real browser and returned as AI-parsed structured data through the getPageSource parsed-data API, so this library never scrapes raw HTML or maintains brittle CSS selectors.

Features

  • 🔎 Search or browse — pass a free-text query ("air max 90") or a full Nike search/category URL.
  • 🧱 Clean, typed output — a Product dataclass with consistent fields; export to JSON or CSV in one call.
  • 🌍 Country targeting — localized prices via --country (proxy country).
  • 🧩 Rich fields when available — category-browse pages add colorway, original price, discount % and badges (e.g. "Best Seller") automatically.
  • ♻️ Multi-query + de-dupe — merge several searches and drop duplicate products by URL.
  • 🔁 Resilient — automatic retries with backoff on transient upstream errors.
  • 🖥️ CLI + library — use nike-scraper from the shell or import it in Python.

Install

pip install .
# or, for development:
pip install -e ".[dev]"

Set your ScrapeUnblocker API key (grab one from your dashboard):

cp .env.example .env          # then edit it, or just export the variable:
export SCRAPEUNBLOCKER_KEY=your_key_here

CLI usage

# Search and print JSON to stdout
nike-scraper "air max 90"

# Merge multiple queries, localize to the UK, cap at 40 products
nike-scraper "pegasus" "invincible" --country GB --limit 40

# Export to CSV
nike-scraper "dunk low" --format csv --output dunks.csv

# Scrape a full category-browse URL (richer fields), pretty-printed
nike-scraper "https://www.nike.com/w/mens-shoes-nik1zy7ok" --pretty
usage: nike-scraper [-h] [-c ISO] [-p PAGES] [-n LIMIT] [-f {json,csv}]
                    [-o PATH] [--pretty] [--version]
                    QUERY [QUERY ...]

Library usage

from nike_scraper import NikeScraper, to_csv

scraper = NikeScraper()  # reads SCRAPEUNBLOCKER_KEY
products = scraper.scrape(
    ["air max 90", "air max 95"],  # queries and/or full Nike URLs
    proxy_country="US",
    limit=50,
)

for p in products:
    print(p.title, p.price, p.currency, p.style_code)

to_csv(products, "nike.csv")

Example output

[
  {
    "title": "Nike Air Max 90",
    "subtitle": "Men's Shoes",
    "price": 135.0,
    "currency": "USD",
    "original_price": null,
    "discount_percent": null,
    "color": null,
    "badge": null,
    "product_type": null,
    "style_code": "DM0029-121",
    "url": "https://www.nike.com/t/air-max-90-mens-shoes-bAZ6AeHT/DM0029-121",
    "image": "https://static.nike.com/a/images/.../AIR+MAX+90.png"
  }
]

Category-browse URLs also fill color, original_price, discount_percent and badge:

{
  "title": "Nike Dunk Low Retro",
  "price": 96.97,
  "currency": "USD",
  "original_price": 120.0,
  "discount_percent": 19,
  "color": "White/Hyper Royal",
  "badge": "Best Seller",
  "style_code": "HF5441-112"
}

Project layout

src/nike_scraper/
  __init__.py      package exports + version
  scraper.py       Product model, NikeScraper, normalization, JSON/CSV export
  cli.py           argparse command-line interface
examples/          runnable scripts (search → JSON, CSV export, category browse)
tests/             offline unit tests (SDK mocked — no API credit spent)

Development

make install       # editable install with dev deps
make lint          # ruff check
make format        # ruff format
make test          # pytest (offline; the SDK is mocked)
make run           # run the search → JSON example (needs SCRAPEUNBLOCKER_KEY)

The test suite mocks the ScrapeUnblocker client, so make test runs fully offline and spends no API credits.

Links

Legal

For research and educational use. Respect Nike's Terms of Service and robots.txt, and applicable laws, when scraping. This project is not affiliated with or endorsed by Nike, Inc.

License

MIT — see LICENSE. Copyright (c) 2026 ScrapeUnblocker.

About

Scrape Nike.com product listings into clean JSON/CSV via the ScrapeUnblocker parsed-data API - title, price, colorway, discount, style code, URL and image.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages