Cheapest fuel near a user
The five cheapest diesel stations within 3 km of a point, with how fresh each price is.
Every plan2 callsUses: Find stations, Get a station
1
Ask for stations near the point, cheapest first
Give the point, a radius and the fuel, and sort by price. Each station comes with its price and when it last changed.
curl -G "https://api.oilapi.net/v1/stations" \ -d near=48.8566,2.3522 \ -d radius_km=3 \ -d fuel=diesel \ -d sort=price \ -d per_page=5 \ -H "X-API-Key: YOUR_API_KEY"
2
Show how fresh each price is
Every price carries changed_at. Show "changed 12 minutes ago" so people trust the number. A price unchanged for over 30 days is left out, since the station has most likely closed; add include_stale=true to see those too, each marked stale.
3
Open one station
When someone taps a station, read it by its id for every fuel it sells.
curl "https://api.oilapi.net/v1/stations/st_7qk3m2xa" \ -H "X-API-Key: YOUR_API_KEY"