Մոտակա վառելիքի կայանների API Online
Կետին կամ քաղաքին ամենամոտ բենզալցակայանները՝ վառելիքի յուրաքանչյուր տեսակի ընթացիկ գներով, դասավորված ըստ հեռավորության։ Կայանի մակարդակի ընդգրկումը ներառում է Եվրոպայի 39 երկիր և ՉԱՓՎՈՒՄ Է, այլ ոչ թե ամրագրված է․ ցանկացած դատարկ պատասխան coverage օբյեկտում վերադարձնում է երկրների ընթացիկ ցանկը՝ ըստ երկրի կայանների քանակով, սահմանափակված հարցված տեսակով, ուստի հենց դա կարդացեք, այլ ոչ թե այս նկարագրության մեջ գրված ցանկը — նույն տվյալներն են, ինչ nakordoni.eu-ի վառելիքի էջերում; այլ դեպքերում ազգային միջին ցուցանիշների համար օգտագործեք fuel API-ի country ռեժիմը։ Գները վերադարձվում են յուրաքանչյուր կայանի սեփական արժույթով (PLN՝ լեհական կայանների համար, EUR՝ մնացած դեպքերում) — կարդացեք յուրաքանչյուր կայանի currency դաշտը, երբեք մի՛ համեմատեք հում թվերը։ Երբ ոչ մի կայան չի համընկնում, պատասխանը լուռ դատարկ ցանկի փոխարեն ներառում է coverage օբյեկտ․ ակտիվ ինդեքսից չափված station_countries և station_counts (fuel_type նշված լինելու դեպքում՝ սահմանափակված `grade`-ով), sparse_coverage՝ 25 կամ ավելի քիչ գնով կայաններ ունեցող երկրների համար, measured_at, և fuel_type_note, որը տարանջատում է դատարկ պատասխանի երկու հնարավոր պատճառը՝ տեսակի անուն, որը մենք չկարողացանք ճանաչել, ընդդեմ տեսակի, որը մենք ճանաչում ենք, բայց տվյալ երկրում գին չենք հայտարարում։
GET https://nakordoni.eu/api/v2/data/fuel-stations
— քվոտայի դաս: fuel
| Պարամետր | Նկարագրություն |
|---|---|
lat | Լայնություն |
lon | Երկայնություն |
city | Քաղաքի անվանումը — lat/lon-ի այլընտրանք, փոխարկվում է կոորդինատների |
country | ISO-2 երկրի կոդը, ճշտում է քաղաքը |
radius_km | Որոնման շառավիղը կմ-ով (լռելյայն 25, առավելագույնը 25; alias: 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) |
truck_friendly | Optional filter: 1 = only stations flagged as usable by trucks (truck_friendly true). Any other value is ignored. |
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; where we hold only the town and a matched operator site record carries the street address, that street address is given. |
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 across countries. Prices are always given in the currency of the station's country (PLN in Poland, CZK in Czechia, NOK in Norway, EUR in euro countries) — a border station that posts its price in a neighbour's currency is converted with the daily ECB rate. 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[].truck_friendly | true when the station is flagged as usable by trucks, false when it is flagged as not usable, null when we hold no truck information for it (a matched operator site record that marks the site as truck-suitable, with truck parking or truck diesel fills a null with true). Filter with truck_friendly=1; combine with fuel_type=lng for truck LNG stations. |
data.stations[].details | Object, only on stations we could match to an operator site record (omitted otherwise, never empty): amenities (array of tokens for facilities held as PRESENT, never one listed as absent; same vocabulary as truck-parkings, e.g. toilets, shower, shop, food, restaurant, wifi, car_wash, washing, parking, truck_access, adblue, lpg, ev_charging, atm, accessible, open_24h), opening_hours ("24/7" when the site is open round the clock; absent otherwise) and services (English labels, e.g. "Truck parking"). The station-level `amenities` object (is_24h, has_shop, has_car_wash ...) is unchanged and stays where it was. |
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. |
data.empty_reason | Only when nothing matched — machine-readable why: no_station_in_radius (try a wider radius_km; see nearest_station_km) | no_price_for_fuel_type (stations in the radius, none quoting this grade) | fuel_type_not_priced_in_country (no feed prices this grade in `country`) | unknown_fuel_type | no_fresh_price_in_radius. The radius is never widened for you. |
data.suggestion | Only when nothing matched — one short sentence in your `lang` that turns empty_reason into advice, e.g. "No station within 5 km — the nearest is 6.4 km away; try radius_km=10." (the advised radius is rounded up to a 5 km step and never above the 25 km maximum), "We have no hvo prices in DE; try diesel, truckdiesel.", or the list of valid fuel_type values. Advice for people, not a contract: branch on empty_reason / nearest_station_km, show suggestion to users. |
data.nearest_station_km | Only when nothing matched — distance to the nearest station quoting the requested grade (any grade when none was named), searched up to data.nearest_search_km (50); null = none that close. |
data.country | Only when nothing matched — ISO-2 country of the point (your ?country= wins). |
Գնի տարիքը
Կայանների գներն ունեն տարիքի երկու սահման, երկուսն էլ հաշվվում են այն պահից, երբ մենք վերջին անգամ հաստատել ենք գինը (age_hours)։ 7 օր հետո գինը դեռ վերադարձվում է՝ stale = true-ով։ 90 օր հետո այն ընդհանրապես չի վերադարձվում (2026-10-24-ից)։ Վառելիքի տեսակը, որն ունի միայն նման գին, այդ դեպքում բացակայում է prices-ում, առանց մնացած գնի կայանը ցուցակում չէ (կամ ունի դատարկ prices օբյեկտ այնտեղ, որտեղ ցուցադրվում են առանց գնի կայաններ), իսկ պատասխանը կարող է դատարկ լինել — այդ դեպքում empty_reason-ը նշում է պատճառը։ Այդ դեպքում fuel-local-ը կարող է պատասխանել տարածաշրջանի կամ երկրի մակարդակից։ Գների պատմությունը պահպանվում է. ազգային և քաղաքային միջին գների վրա դա չի ազդում։
Դատարկ պատասխաններ
Երբ ոչ մի լցակայան չի համապատասխանում, պատասխանը միևնույն է HTTP 200 է՝ դատարկ stations ցանկով, և նշում է պատճառը։ data-ին ավելացվում են չորս դաշտ՝ միայն դատարկ պատասխանի դեպքում. empty_reason (մեքենայաբար ընթեռնելի պատճառ), nearest_station_km (հեռավորությունը ձեր տեսակն առաջարկող մոտակա լցակայանից, որոնումը մինչև nearest_search_km = 50 կմ. null, եթե չկա), country (կետի ISO-2 կոդը) և suggestion (մեկ կարճ նախադասություն ձեր lang-ով)։ Շառավիղը ձեր փոխարեն երբեք չենք մեծացնում։
| empty_reason | Նկարագրություն |
|---|---|
no_station_in_radius | radius_km-ի սահմաններում ընթացիկ գնով լցակայան չկա։ nearest_station_km-ը ցույց է տալիս մոտակա լցակայանի հեռավորությունը (null, եթե 50 կմ-ի սահմաններում չկա)։ |
no_price_for_fuel_type | Շառավղի մեջ լցակայաններ կան, բայց ոչ մեկը չի առաջարկում ձեր նշած fuel_type-ը։ nearest_station_km-ը այն մոտակա լցակայանն է, որն առաջարկում է այն։ |
fuel_type_not_priced_in_country | Վառելիքի տեսակը ճանաչում ենք, բայց այս երկրում ոչ մի լցակայանի տվյալների աղբյուր դրա գինը չի տալիս (օրինակ՝ HVO Գերմանիայում)։ Ավելի մեծ շառավիղը չի օգնի. խնդրեք այլ տեսակ։ |
unknown_fuel_type | fuel_type-ը չհաջողվեց համապատասխանեցնել մեզ հայտնի որևէ տեսակի։ suggestion-ը թվարկում է վավեր արժեքները. տեղական անվանումները ըստ երկրների՝ /api/v2/data/fuel-grades-ում։ |
no_fresh_price_in_radius | Շառավղի մեջ գտնվող լցակայանների գները շատ հին են՝ մատուցելու համար։ Փորձեք մի փոքր ավելի մեծ շառավիղ կամ կրկին կանչեք ավելի ուշ։ |
suggestion-ը խորհուրդ է մարդկանց համար, այլ ոչ թե պայմանագիր. դրա ձևակերպումը կարող է փոխվել։ Ձեր կոդի ճյուղավորումը կատարեք ըստ empty_reason-ի և nearest_station_km-ի. suggestion-ը ցուցադրեք օգտատերերին կամ գրանցեք լոգում։ Խորհուրդ տրվող շառավիղը կլորացվում է դեպի վեր 5 կմ քայլով և երբեք չի գերազանցում 25 կմ առավելագույնը։
Ցանցային որոնում: Եթե տարածքը կամ երթուղին նմուշառում եք ցանցով, օգտագործեք radius_km 10–15։ 5 կմ-ի դեպքում գյուղական ցանցային կետերի մեծ մասը հայտնվում է լցակայանների արանքում և վերադարձնում է դատարկ պատասխան (no_station_in_radius), նույնիսկ եթե լցակայանը ընդամենը մի քանի կիլոմետր հեռու է։
Օրինակ՝ դատարկ պատասխան ?lat=47.73&lon=18.225&radius_km=5&fuel_type=diesel
{
"ok": true,
"data": {
"count": 0,
"stations": [],
"empty_reason": "no_station_in_radius",
"suggestion": "No station within 5 km — the nearest is 6.4 km away; try radius_km=10.",
"nearest_station_km": 6.4,
"nearest_search_km": 50,
"country": "HU",
"coverage": { "grade": "diesel", "station_countries": ["AT", "BE", "…"], "…": "…" }
}
}
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"
Թարմացվել է