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. GET /products doesn't return a meta.total
— drive the loop off meta.has_more instead:
#!/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
HAS_MORE=$(echo "$RESPONSE" | jq '.meta.has_more')
if [ "$HAS_MORE" != "true" ]; 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. Every response carries
X-Quota-Remaining — the example above stops once it reaches 0 (or on a
429 quota_exceeded), and on a 429 rate_limited waits out Retry-After before retrying
the same page. Each key's
usage for the current day is shown on the API Keys page of your account.
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