Zara is one of the largest fast fashion retailers online, with a catalogue that changes almost weekly across dozens of countries and sections. That makes it a popular target for developers and researchers who want to track pricing, monitor new drops, or compare product availability across markets.
So how do you pull structured product data from Zara without fighting a fragile HTML scraper? In this tutorial, we will walk through hitting Zara’s own internal search API and turning the response into clean, usable JSON.
Let’s get into it.
What We’ll Scrape From Zara
Before writing any code, let’s define what we’re after. Each product returned by Zara’s search endpoint carries a lot of nested data, but the fields most people actually need are:
| Field | Description |
|---|---|
| Product Name | The display name, e.g., “100% Linen Relaxed Fit Shirt” |
| Product ID | Zara’s internal identifier for that color variant |
| Price | Current price, plus the original price if the item is discounted |
| Colors | Every color variant available for that product |
| Product URL | A direct link to the product page |
| Section | Which department the item belongs to (man, woman, kid, home, and so on) |
How to Find Zara’s Search API
Zara loads its search results dynamically through an internal API rather than rendering everything server-side. Instead of scraping the HTML grid, we’ll call that API directly.
Step 1: Search for a Product on Zara.com
Go to Zara.com and search for a keyword, for example, “shirt.”
Step 2: Open Developer Tools and Inspect Network Activity
- Open Developer Tools (F12 or right-click, Inspect)
- Go to the Network tab
- Filter by Fetch/XHR
- Run the search again so the request shows up in the list
Step 3: Inspect the Request
Look for a GET request to a URL that looks like this:
https://www.zara.com/itxrest/1/search/store/{store}/query
Click it and check the query string parameters. You’ll see things like query, catalogue, warehouse, section, offset, and limit. The store, catalogue, and warehouse values are tied to the specific country and section you’re browsing, so they’ll be different if you’re searching Zara Home versus Zara Man in a different country. Grab the ones shown in your own DevTools session and swap them in.
Step 4: Fields Returned in the Response
The response comes back as JSON with a results array. Each entry is a content object nested one level down, containing:
- name and price
- detail.colours, an array of color variants with their own name
- seo.keyword and seo.seoProductId are used to build the product URL
- Availability
This nesting matters. If you grab fields straight off the top-level result object instead of digging into content, you’ll get back a pile of nulls; more on that in a minute.
Don’t Want to Code It Yourself?
You can follow the steps below and run the script yourself, or you can skip the setup entirely.
At ScrapeInsight, we pull accurate, ready-to-use product data from Zara and other major retailers at scale, no scripts, no proxy management, and no broken pagination when a site changes its schema.
Scraping Zara Product Data Using Python
Now let’s turn that into a working script using requests. Make sure Python 3 is installed and run pip install requests first.
Step 1: Set Up Search Parameters and Session Info
import requests
import time
import uuid
import json
BASE_URL = "https://www.zara.com/itxrest/1/search/store/{store}/query"
HEADERS = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/124.0.0.0 Safari/537.36"
),
"Accept": "application/json, text/plain, */*",
"Referer": "https://www.zara.com/",
}
store = "11719"
catalogue = "21053"
warehouse = "15053"
section = "MAN"
query = "shirt"
limit = 36
delay = 1.0 # seconds between requests, keep this polite
The session, visitorId, and sessionId params don’t need to match a real browser session for basic search calls. Random UUIDs work fine:
session_id_param = str(uuid.uuid4())
visitor_id = uuid.uuid4().hex
session_id = uuid.uuid4().hex
Step 2: Build the Request Parameters
def build_params(query, offset):
return {
"query": query,
"locale": "en_US",
"session": session_id_param,
"deviceType": "desktop",
"deviceOS": "Windows",
"deviceOSVersion": "10",
"catalogue": catalogue,
"warehouse": warehouse,
"section": section,
"offset": offset,
"limit": limit,
"scope": "default",
"origin": "search",
"filter": f"searchSection:{section}",
"visitorId": visitor_id,
"sessionId": session_id,
"ajax": "true",
}
Step 3: Fetch a Single Page
http = requests.Session()
http.headers.update(HEADERS)
def fetch_page(query, offset):
url = BASE_URL.format(store=store)
resp = http.get(url, params=build_params(query, offset), timeout=15)
resp.raise_for_status()
return resp.json()
Step 4: Paginate Through All Results
def search(query, max_results=None):
products = []
offset = 0
while True:
data = fetch_page(query, offset)
if data.get("status") != "SUCCESS":
print(f"Unexpected response status: {data.get('status')}")
break
raw_results = data.get("results", [])
for raw in raw_results:
products.append(extract_product(raw))
print(f"offset={offset}, got {len(raw_results)} items, "
f"total so far {len(products)} / {data.get('totalResults')}")
if max_results and len(products) >= max_results:
return products[:max_results]
if data.get("isLastPage") or not raw_results:
break
offset += limit
time.sleep(delay)
return products
Step 5: Extract Needed Fields
This is the part that’s easy to get wrong. If you write raw.get(“name”) on a result item, you’ll get None every time, because the useful fields sit inside a content key, not at the top level. Here’s what a raw result looks like once you print it:
{
"id": "555527049",
"position": 1,
"content": {
"name": "100% LINEN RELAXED FIT SHIRT",
"price": 6990,
"detail": {
"colors": [
{ "id": "052", "name": "Light beige" },
{ "id": "811", "name": "Light gray" }
]
},
"seo": {
"keyword": "100-linen-relaxed-fit-shirt",
"discernProductId": 555527049
}
}
}
Once you know that, extraction is straightforward:
def extract_product(raw):
content = raw.get("content", {}) or {}
name = content.get("name")
price_cents = content.get("price")
price = price_cents / 100 if isinstance(price_cents, (int, float)) else None
old_price_cents = content.get("oldPrice")
old_price = old_price_cents / 100 if isinstance(old_price_cents, (int, float)) else None
detail = content.get("detail", {}) or {}
colors = detail.get("colors", []) or []
color_names = [c.get("name") for c in colors if isinstance(c, dict)]
seo = content.get("seo", {}) or {}
seo_path = seo.get("keyword")
product_id = raw.get("id") or seo.get("discernProductId")
url = (
f"https://www.zara.com/us/en/{seo_path}-p{product_id}.html"
if seo_path and product_id else None
)
return {
"id": raw.get("id"),
"name": name,
"price": price,
"old_price": old_price,
"colors": color_names,
"url": url,
}
Zara’s schema does shift between sections (Man, Woman, Home, and especially the Massimo Dutti sections nest slightly differently), so if a field comes back empty, dump one raw item with json.dumps(raw, indent=2) and check where the field actually lives before assuming the API is broken.
Step 6: Save the Scraped Product Data to a JSON File
products = search(query, max_results=100)
print(f"\nTotal products fetched: {len(products)}\n")
for p in products[:10]:
print(f"- {p['name']} | ${p['price']} | colors: {p['colors']} | {p['url']}")
output_file = f"{query.replace(' ', '_')}_{section}.json"
with open(output_file, "w", encoding="utf-8") as f:
json.dump(products, f, indent=2, ensure_ascii=False)
print(f"\nSaved {len(products)} products to {output_file}")
Once this runs, you’ll get clean rows like the following:
{
"id": "502024640",
"name": "SOFT COTTON SHIRT",
"price": 17.97,
"old_price": 59.9,
"colors": ["Light blue", "Navy blue", "Gray / Blue"],
"url": "https://www.zara.com/us/en/soft-cotton-shirt-p00975477.html"
}
Code Limitations
This script depends on an undocumented, internal Zara endpoint, and the exact JSON shape can change without notice. A few things to keep in mind:
- Store, catalogue, and warehouse IDs are different per country and section. The values here won’t work for every locale, pull your own from DevTools.
- There’s no built-in handling for CAPTCHAs, rate limits, or bot detection. Heavy request volume can get an IP throttled or blocked.
- Scraping may fall outside Zara’s Terms of Service, so keep request rates low and use this for personal or research purposes only.
- If fields start coming back empty, the schema has likely shifted; dump a raw item and re-map extract_product() before assuming your code broke.
Want Zara Data Without Managing Scripts?
This script works fine for small, one-off pulls, but keeping it running over time is a different story. Any change to Zara’s internal API, session handling, or bot detection can break it, and without proxy rotation you risk getting blocked after a handful of requests.
If you need reliable Zara product data at scale, pricing, colors, and availability across sections and countries, without maintaining scrapers yourself, ScrapeInsight can handle it.
Get in touch. We’ll take care of the rest.