Playground
Pick a city, a fuel and a date range. The request goes to this site’s own API.
Examples:
Result
GET /v1/prices?city=delhi&from=2026-10-05&to=2026-11-03 30 rows, captured when the site was built
- Petrol
- Diesel
| Date | Delhi petrol | Delhi diesel |
|---|---|---|
| 3 Nov 2026 | 102.12 | 95.20 |
| 2 Nov 2026 | 102.12 | 95.20 |
| 1 Nov 2026 | 102.12 | 95.20 |
| 31 Oct 2026 | 102.12 | 95.20 |
| 30 Oct 2026 | 102.12 | 95.20 |
| 29 Oct 2026 | 102.12 | 95.20 |
| 28 Oct 2026 | 102.12 | 95.20 |
| 27 Oct 2026 | 102.12 | 95.20 |
| 26 Oct 2026 | 102.12 | 95.20 |
| 25 Oct 2026 | 102.12 | 95.20 |
| 24 Oct 2026 | 102.12 | 95.20 |
| 23 Oct 2026 | 102.12 | 95.20 |
| 22 Oct 2026 | 102.12 | 95.20 |
| 21 Oct 2026 | 102.12 | 95.20 |
| 20 Oct 2026 | 102.12 | 95.20 |
| 19 Oct 2026 | 102.12 | 95.20 |
| 18 Oct 2026 | 102.12 | 95.20 |
| 17 Oct 2026 | 102.12 | 95.20 |
| 16 Oct 2026 | 102.12 | 95.20 |
| 15 Oct 2026 | 102.12 | 95.20 |
| 14 Oct 2026 | 102.12 | 95.20 |
| 13 Oct 2026 | 102.12 | 95.20 |
| 12 Oct 2026 | 102.12 | 95.20 |
| 11 Oct 2026 | 102.12 | 95.20 |
| 10 Oct 2026 | 102.12 | 95.20 |
| 9 Oct 2026 | 102.12 | 95.20 |
| 8 Oct 2026 | 102.12 | 95.20 |
| 7 Oct 2026 | 102.12 | 95.20 |
| 6 Oct 2026 | 102.12 | 95.20 |
| 5 Oct 2026 | 102.12 | 95.20 |
Code samples and the raw response
curl "https://india-petroleum-api.vercel.app/v1/prices?city=delhi&from=2026-10-05&to=2026-11-03"const res = await fetch('https://india-petroleum-api.vercel.app/v1/prices?city=delhi&from=2026-10-05&to=2026-11-03');
const { data, meta } = await res.json();
console.log(data.length, meta.attribution);{
"success": true,
"data": [
{
"date": "2026-10-05",
"petrol": {
"delhi": 102.12
},
"diesel": {
"delhi": 95.2
}
},
{
"date": "2026-10-06",
"petrol": {
"delhi": 102.12
},
"diesel": {
"delhi": 95.2
}
},
{
"date": "2026-10-07",
"petrol": {
"delhi": 102.12
},
"diesel": {
"delhi": 95.2
}
},
…