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
Prices returned by the request, rupees per litreStep chart of the 30 days returned, from 5 Oct 2026 to 3 Nov 2026.959697989910010110210310-0510-1010-1510-2010-2510-30
Move across the chart to read a day.
DateDelhi petrolDelhi diesel
3 Nov 2026102.1295.20
2 Nov 2026102.1295.20
1 Nov 2026102.1295.20
31 Oct 2026102.1295.20
30 Oct 2026102.1295.20
29 Oct 2026102.1295.20
28 Oct 2026102.1295.20
27 Oct 2026102.1295.20
26 Oct 2026102.1295.20
25 Oct 2026102.1295.20
24 Oct 2026102.1295.20
23 Oct 2026102.1295.20
22 Oct 2026102.1295.20
21 Oct 2026102.1295.20
20 Oct 2026102.1295.20
19 Oct 2026102.1295.20
18 Oct 2026102.1295.20
17 Oct 2026102.1295.20
16 Oct 2026102.1295.20
15 Oct 2026102.1295.20
14 Oct 2026102.1295.20
13 Oct 2026102.1295.20
12 Oct 2026102.1295.20
11 Oct 2026102.1295.20
10 Oct 2026102.1295.20
9 Oct 2026102.1295.20
8 Oct 2026102.1295.20
7 Oct 2026102.1295.20
6 Oct 2026102.1295.20
5 Oct 2026102.1295.20
Code samples and the raw response
curl
curl "https://india-petroleum-api.vercel.app/v1/prices?city=delhi&from=2026-10-05&to=2026-11-03"
JavaScript
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);
Response (first 5 of 30 rows)
{
  "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
      }
    },
  …