Track a country's prices
Today's pump prices for a country, then one fuel's history to chart.
Every plan2 callsUses: Pump prices, Get a country
1
Read every fuel now
Leave out fuel to get each fuel the country publishes, with its date and whether it is an average or a set price.
curl -G "https://api.oilapi.net/v1/prices/retail" \ -d country=de \ -H "X-API-Key: YOUR_API_KEY"
2
Read one fuel over time
Give a fuel and a start date for every point since; the answer says how often the country publishes.
curl -G "https://api.oilapi.net/v1/prices/retail" \ -d country=de \ -d fuel=diesel \ -d from=2024-01-01 \ -H "X-API-Key: YOUR_API_KEY"
3
Keep it current
Call again once a day, or as often as the interval in the answer; points never change once published.