Market NinjaMarket Ninja
Workflows

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))
done

Mind the daily quota

The quota counts records actually returned in responses, not requests, so a paginated export uses it in proportion to the products you retrieve, however many requests that takes. Every response carries an X-Quota-Remaining header. The example above stops once it reaches 0 (or on a 429 quota_exceeded), and on a 429 rate_limited waits Retry-After seconds before retrying the same page. On a 503 it waits Retry-After seconds (30 if the header is missing), longer with each retry, and gives up after three retries: a query_timeout that keeps coming back means the request itself is too heavy, so narrow it (a more specific filter) rather than repeat it unchanged. Each key's usage for the current day is shown on the API Keys page of your account. The limit values and counting rules are described in Limits and quotas.

The quota resets at 00:00 UTC. If you're exporting the entire dataset, plan the export over several days. If 75,000 records a day isn't enough for your use case, message us on Telegram at @getmarketninja.

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

On this page