Bulk export
Paginating a large slice of the dataset — for an LLM context, your own database, or analytics — while respecting the daily quota.
Browsing categories before exporting
Before pulling a whole marketplace's assortment, it's often useful to narrow the scope
via the category list first — GET /categories, then the resulting category_path as
the category filter on GET /products. For the full guide, including containment
matching at any hierarchy level and how to read an empty category_path: [], see
Categories. You can narrow an export by a specific brand the
same way, via brand — see Brands for the available names and
full examples.
Paginating
page_size defaults to 100, max 500 — deliberately generous relative to a typical
UI-facing API, sized for exactly this use case. Drive the loop off meta.total, not a
page count you compute up front:
#!/bin/bash
PAGE=1
while true; do
RESPONSE=$(curl -s -G -H "Authorization: Bearer mn_live_..." \
"https://data.marketninja.ru/v1/products" \
--data-urlencode "marketplace=wildberries" \
--data-urlencode "category=Зоотовары" \
--data-urlencode "page_size=500" \
--data-urlencode "page=$PAGE")
echo "$RESPONSE" | jq -c '.data[]' >> products.jsonl
TOTAL=$(echo "$RESPONSE" | jq '.meta.total')
if [ $((PAGE * 500)) -ge "$TOTAL" ]; then break; fi
PAGE=$((PAGE + 1))
doneMind the daily quota
The quota counts records actually returned in responses, not the number of
requests — a large paginated export costs quota proportional to how many products you
retrieved, regardless of how many requests it took. The X-Quota-Limit/X-Quota-Used
headers only appear on a 429 quota_exceeded response — check the response status and
stop when you hit it, rather than trying to predict the remainder in advance.
For LLM context
If the goal is giving a model an up-to-date slice of data (not maintaining your own copy of the dataset), it's often better to fetch narrowly, per user query, rather than bulk-exporting everything upfront "just in case": resolve the specific product or seller the user is asking about via the scenarios in Finding products and hand the model that compact JSON directly.
Last updated on