Market NinjaMarket Ninja
Workflows

Price history

When the current price from a search response is enough, and when you need the dedicated history endpoint — with a monitoring example.

You already have the current price

Every product in GET /products and GET /products/{id} already includes a prices array — one entry per (country, region, auth-status) pair actually observed:

"prices": [
  {
    "country_code": "ru",
    "region_code": null,
    "user_auth_status": "anonymous",
    "price": 7093,
    "old_price": 8651,
    "currency": "RUB",
    "recorded_at": "2026-08-02T23:21:53.185302+00:00"
  }
]
country_code reflects the marketplace's own country-domain variant (e.g. Wildberries' .ru/.kz/.by/.am catalogs) — the same product id can carry genuinely different prices per country, so it's a separate bucket dimension from region_code (a finer, often-absent delivery-address signal).
The dedicated GET /products/{id}/price-history call is only for trend analysis — if the current price is all you need, skip it entirely.

When you need history

GET /products/{id}/price-history returns the full time series of observations — for charting, tracking how often price changes, or computing an average over a period.

curl -G -H "Authorization: Bearer mn_live_..." \
  "https://data.marketninja.ru/v1/products/e86bee19-9cc9-4a83-b9cc-6b61f1209d90/price-history" \
  --data-urlencode "from=2026-08-01T00:00:00Z" \
  --data-urlencode "to=2026-08-02T23:59:59Z"
{
  "data": [
    { "price": 7093, "old_price": 8651, "recorded_at": "2026-08-02T23:21:53.185302+00:00", "...": "..." },
    { "price": 6993, "old_price": 8688, "recorded_at": "2026-08-01T01:03:17.999423+00:00", "...": "..." }
  ],
  "meta": { "total": 2, "page": 1, "page_size": 100 }
}

from and to are optional — omit them for the full available history, newest first. Need a specific country, region, or auth status (guest vs. logged-in)? Add country_code, region_code, and/or user_auth_status.

Ongoing monitoring

You don't need to store a local copy of the entire history to track price over time — poll the endpoint periodically (e.g. once a day) with from set to your last successful poll's timestamp, and only append the new records to your own database:

# Example: only fetch records since the last check
curl -G -H "Authorization: Bearer mn_live_..." \
  "https://data.marketninja.ru/v1/products/e86bee19-9cc9-4a83-b9cc-6b61f1209d90/price-history" \
  --data-urlencode "from=2026-08-02T23:21:53Z"
The product's id never changes — same as every other scenario, save it after your first search (see API Overview) and don't repeat GET /products on every check.

Last updated on

On this page