Данные продаж по товарам, брендам и датам. Все запросы к /api/* требуют передачу API-ключа в заголовке.
https://sales-api.5-star-roi.ruX-API-Key: <key> или Authorization: Bearer <key>Во всех примерах ниже замени YOUR_API_KEY на ключ выше. Даты в формате YYYY-MM-DD.
Проверка доступности API.
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/health"{
"ok": true
}Список всех дат, по которым есть продажи (для выбора диапазона from/to).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/dates"{
"dates": [
"2025-01-04",
"2025-01-05",
"2025-01-09",
"..."
]
}Список брендов и количество товаров по каждому.
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/brands"{
"brands": [
{
"brand": "KANGAROO",
"products_count": 2625
}
]
}Параметры: limit (1–500, по умолч. 50), offset (для пагинации), brand (опционально — фильтр по бренду).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/products?limit=2&offset=0"{
"total": 2625,
"offset": 0,
"limit": 2,
"products": [
{
"articul": "320805",
"name": "Choke&carb cleaner...",
"brand": "KANGAROO",
"code": 643
},
{
"articul": "125219",
"name": "Compound - полироль...",
"brand": "KANGAROO",
"code": 1660
}
]
}Один товар и его продажи по дням. :articul — артикул в URL. Параметры: from, to (даты YYYY-MM-DD, опционально).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/products/320805?from=2025-01-01&to=2025-01-31"{
"articul": "320805",
"name": "Choke&carb cleaner - Очист.карбюр...",
"brand": "KANGAROO",
"code": 643,
"salesByDate": {
"2025-05-10": 1437,
"2025-05-30": -108.31,
"2025-11-29": 596.79
}
}Детализация продаж по дням: по каждой дате список товаров с объёмом. Параметры: from, to (YYYY-MM-DD).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/sales?from=2025-01-01&to=2025-01-07"{
"from": "2025-01-01",
"to": "2025-01-07",
"byDate": {
"2025-01-04": [
{
"articul": "310400",
"name": "Cosmic - полироль...",
"value": 912
},
{
"articul": "320119-M",
"name": "Fine glass...",
"value": 294
}
],
"2025-01-05": []
}
}Сумма продаж по периодам. Параметры: from, to, granularity=day|week|month|quarter.
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/aggregates/sales-by-date?from=2025-01-01&to=2025-03-31&granularity=month"{
"from": "2025-01-01",
"to": "2025-03-31",
"granularity": "month",
"data": [
{
"period": "2025-01-01",
"total": 12345.67
},
{
"period": "2025-02-01",
"total": 15200.3
},
{
"period": "2025-03-01",
"total": 18900.12
}
]
}Продажи по брендам с гранулярностью по времени. Параметры: from, to, granularity (day|week|month|quarter), brand (опционально — один бренд).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/aggregates/sales-by-brand?from=2025-01-01&to=2025-06-30&granularity=month"{
"from": "2025-01-01",
"to": "2025-06-30",
"granularity": "month",
"data": [
{
"brand": "KANGAROO",
"period": "2025-01-01",
"total": 45000.5
},
{
"brand": "KANGAROO",
"period": "2025-02-01",
"total": 52100.2
}
]
}Продажи по товарам с гранулярностью. Параметры: from, to, granularity, articul (опционально — один товар; без него до 10k строк). limit (по умолч. 10000, макс. 50000).
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/aggregates/sales-by-product?from=2025-01-01&to=2025-12-31&granularity=month&articul=320805"{
"from": "2025-01-01",
"to": "2025-12-31",
"granularity": "month",
"data": [
{
"articul": "320805",
"name": "Choke&carb cleaner...",
"brand": "KANGAROO",
"period": "2025-05-01",
"total": 1328.69
},
{
"articul": "320805",
"name": "Choke&carb cleaner...",
"brand": "KANGAROO",
"period": "2025-11-01",
"total": 596.79
}
]
}Эндпоинт для приложений: скачать все товары и продажи одним запросом. Ответ — NDJSON (одна строка = один JSON-объект), стримится батчами, сервер не держит весь датасет в памяти. Рекомендуется передавать Accept-Encoding: gzip (сжатие включено).
Параметры: batch (50–500, по умолч. 200 — размер батча на сервере), brand (опционально — только один бренд). Заголовок ответа X-Total-Products — общее число строк.
curl -s -H "X-API-Key: 4103c53b4fccf207500581211db61ef5f45bc4e3fc01bd09" "https://sales-api.5-star-roi.ru/api/export?batch=200"{"articul":"320805","name":"Choke&carb cleaner...","brand":"KANGAROO","code":643,"sales":[["2025-05-10",1437],["2025-05-30",-108.31]]}
{"articul":"125219","name":"Compound - полироль...","brand":"KANGAROO","code":1660,"sales":[["2025-01-04",120],["2025-02-01",85.5]]}https://sales-api.5-star-roi.ru. Заголовок: X-API-Key: <key> или Authorization: Bearer <key>.YYYY-MM-DD. Периоды from/to включительно.day, week (понедельник), month, quarter. В ответе period — дата начала интервала.limit (макс. 500 для products), offset. Импорт всех данных: GET /api/export — потоковый NDJSON (одна строка = один товар с полем sales: [[date, value], ...]).{"error":"Invalid or missing API key..."}.