Fuel Prices

Get current fuel prices for a specific African country or all countries at once.

GET https://afrotools.com/api/fuel
Authentication required. Pass your API key via x-api-key header. Learn more

Request Parameters

ParameterTypeDescription
country optional string ISO 3166-1 alpha-2 country code. Omit to get all countries.
fuel_type optional string Filter by fuel type: petrol, diesel, kerosene, or lpg.
currency optional string Convert prices to a different currency (e.g., USD). Default: local currency.
date optional string Historical date (YYYY-MM-DD). Pro plan required.

Response Fields

FieldTypeDescription
countrystringISO country code.
country_namestringFull country name.
currencystringCurrency of the prices.
fuelsobjectObject with fuel type keys.
fuels.*.pricenumberCurrent price per unit.
fuels.*.unitstringUnit of measurement (litre or kg).
fuels.*.changenumberChange since last update.
updatedstringDate of last price update.

Error Responses

StatusCodeDescription
400invalid_countryCountry code not supported.
400invalid_fuel_typeFuel type is not recognized.
401missing_api_keyNo API key was provided.
429rate_limit_exceededRate limit exceeded.
Request Examples
curl "https://afrotools.com/api/fuel?country=NG" \ -H "x-api-key: afro_live_your_key_here"
const res = await fetch( "https://afrotools.com/api/fuel?country=NG", { headers: { "x-api-key": "afro_live_your_key_here" } } ); const data = await res.json(); console.log(`Petrol: ${data.data.fuels.petrol.price} NGN/litre`);
import requests resp = requests.get( "https://afrotools.com/api/fuel", params={"country": "NG"}, headers={"x-api-key": "afro_live_your_key_here"} ) data = resp.json() print(f"Petrol: {data['data']['fuels']['petrol']['price']} NGN/litre")
const axios = require("axios"); const { data } = await axios.get( "https://afrotools.com/api/fuel", { params: { country: "NG" }, headers: { "x-api-key": "afro_live_your_key_here" } } ); console.log(`Petrol: ${data.data.fuels.petrol.price} NGN/litre`);
$ch = curl_init("https://afrotools.com/api/fuel?country=NG"); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "x-api-key: afro_live_your_key_here" ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); echo "Petrol: " . $data["data"]["fuels"]["petrol"]["price"] . " NGN/litre";

Response (200 OK)
{ "success": true, "data": { "country": "NG", "country_name": "Nigeria", "currency": "NGN", "fuels": { "petrol": { "price": 897.00, "unit": "litre", "change": 0 }, "diesel": { "price": 1420.00, "unit": "litre", "change": -30.00 }, "kerosene": { "price": 1250.00, "unit": "litre", "change": 0 }, "lpg": { "price": 1150.00, "unit": "kg", "change": 50.00 } }, "updated": "2026-03-10" } }

All Countries (no country param)
# Get fuel prices for all countries curl "https://afrotools.com/api/fuel" \ -H "x-api-key: afro_test_abc123"
{ "success": true, "data": { "countries": [ { "country": "NG", "currency": "NGN", "petrol": 897.00, ... }, { "country": "KE", "currency": "KES", "petrol": 217.36, ... }, { "country": "ZA", "currency": "ZAR", "petrol": 25.83, ... } ], "count": 54 } }