API за близки бензиностанции Online
Найблизките бензиностанции до дадена точка или град, с актуални цени по вид гориво, подредени по разстояние. Покритието на ниво бензиностанция обхваща 39 европейски държави и е ИЗМЕРВАНО, а не фиксирано: всеки празен отговор връща актуалния списък с държави с брой бензиностанции по държава в неговия обект coverage, ограничен до grade, който сте поискали — затова четете него, а не списък в това описание — същите данни като страниците за гориво на nakordoni.eu; за национални средни стойности другаде използвайте режима country на fuel API. Цените се връщат във валутата на съответната бензиностанция (PLN за полските бензиностанции, EUR другаде) — четете полето currency за всяка бензиностанция, никога не сравнявайте суровите числа. Когато няма съвпадащи бензиностанции, отговорът включва обект coverage вместо мълчалив празен списък: station_countries и station_counts, измерени от живия индекс (ограничени до `grade`, когато сте посочили fuel_type), sparse_coverage за държавите с 25 или по-малко ценообразувани бензиностанции, measured_at, и fuel_type_note, който разграничава двете причини, поради които отговорът може да е празен — име на марка, което не сме успели да разпознаем, срещу марка, която разпознаваме, но не ценообразуваме в тази държава.
GET https://nakordoni.eu/api/v2/data/fuel-stations
— клас квота: cheap
| Параметър | Описание |
|---|---|
lat | Географска ширина |
lon | Географска дължина |
city | Име на град — алтернатива на lat/lon, преобразува се в координати |
country | ISO-2 код на държавата, уточнява града |
radius_km | Радиус на търсене в км (по подразбиране 25, максимум 25; псевдоним: radius) |
fuel_type | Незадължителен филтър: diesel | e5 | e10 | superplus | super100 | premdiesel | truckdiesel | hvo | lpg | cng | adblue | e85 | lng (наличността варира според бензиностанцията/региона; полските бензиностанции отчитат Pb95 като e5, Pb98 като superplus и ON като diesel). Приемат се и местните названия от колонките — ON, Olej napędowy, Pb95, Nafta, Dizel, Gázolaj, Motorină, Benzină 95, ДП, А-95, Motorin, Gasóleo, Sans plomb 95, Bleifrei … — те се разпознават спрямо `country` (или, при продуктите по координати, спрямо държавата, в която попада точката), защото едно и също название не означава навсякъде един и същ вид: „95“ е E10 на датска, финландска, френска, британска, белгийска или нидерландска колонка и E5 на полска или германска. Отговорът връща `fuel_type` (каноничен), `fuel_type_requested` (както сте го въвели) и `fuel_type_local`. Название, което не можем да разпознаем, никога не се подменя с вид по подразбиране — отговорът се връща празен и го заявява. Пълна таблица с названията по държави: /api/v2/data/fuel-grades. |
limit | Максимум бензиностанции (по подразбиране 5, максимум 20) |
lang | Език на етикетите (по подразбиране en) |
Полета на отговора — вътре в обекта data в плика на отговора. [] означава списък, така че data.items[].name е полето name на всеки елемент. Поле може да е null, да липсва или да е празен списък, когато нямаме стойност — никога не подставяме заместител.
| Поле | Описание |
|---|---|
data.anchor.lat | The point actually searched (after city geocoding), with lng, ppid and radius_km. |
data.anchor.fuel_type | The canonical grade the list was filtered to; fuel_type_requested is what you sent, fuel_type_local the local pump name and fuel_type_country the country the name was read in. |
data.stations[].name | Station, with brand and address. Each physical station appears ONCE: its grades are nested under prices, not spread over repeated rows. `brand` is the chain when we know it and null when we do not — never a placeholder token, so treat null as "independent or unknown" and fall back to `name`. Address detail varies by national feed: some report a full street address, others only the town. |
data.stations[].station_ref | Stable key for the station (name + position). Key your records on it whenever id is null — id is set only for rows that come from our station directory. |
data.stations[].prices | Object keyed by grade (diesel, e5, e10, lpg …): price, currency and currency_symbol, local_name (the pump name used in that country), label, updated_at, confirmed_at, age_hours and stale. Each station carries its own currency, so never compare the raw numbers. A station with no quote at all carries an empty object here. TWO CLOCKS, and they answer different questions — do not derive one from the other: `updated_at` is when this price last MOVED, so a forecourt that has held the same price for ten days keeps a ten-day-old stamp and that is correct, not stale data; `confirmed_at` is when we last CONFIRMED the quote against its feed, and it is the clock `age_hours` and `stale` are measured on (age_hours = now − confirmed_at). Read `confirmed_at`/`stale` for freshness and `updated_at` for price history. Both are floored to the hour, so `now − confirmed_at` can sit up to an hour above `age_hours`, which is measured before the floor; `confirmed_at` is never earlier than `updated_at`, because a price change is itself a confirmation. |
data.stations[].grades | The grade keys present in prices, alongside freshest_age_hours and a station-level stale flag (true only when NO quote of that station is current). |
data.stations[].distance_km | Distance from the anchor, with lat and lng of the station itself. |
data.count | Stations returned; data.total_found is how many matched inside the radius before limit was applied. |
data.notices | Present whenever we adjusted a parameter you sent: each entry names the param, the requested and the applied value, and the reason. |
data.coverage | Only when nothing matched. grade (the fuel_type your wording resolved to, or null), station_countries and station_counts measured from the live station index and scoped to that grade, sparse_coverage for countries with 25 priced stations or fewer, measured_at, a note explaining all of it, and fuel_type_note when the grade name could not be placed OR when we recognise the grade but price it nowhere in this country. |
curl "https://nakordoni.eu/api/v2/data/fuel-stations?city=Munich&country=DE&radius_km=20&fuel_type=diesel" \ -H "Authorization: Bearer NKD-DEV-XXXX-XXXX-XXXX"