API reference
A read-only JSON API for the daily petrol and diesel prices in PPAC’s metro table. No key, no signup, CORS open to every origin. Base URL: https://india-petroleum-api.vercel.app
Conventions
- Every success answer is
{ "success": true, "data": …, "meta": … }.metaalways hasattribution,source_posted_date(the date printed on PPAC’s table) andlatest_fetched_at(when this service last downloaded it). - Every error answer is
{ "success": false, "error": { "code": …, "message": … } }, with the HTTP status shown in the table below. Unknown paths under/v1answer JSON, never HTML. - Rate limit: 100 requests per 15 minutes per IP address, counted separately on each server instance. Past it, that instance answers 429 RATE_LIMITED. The count is not shared between instances, so treat the limit as approximate.
- Answers come from files stored with the service, so they do not wait on PPAC. Responses are cacheable by a CDN for five minutes. The API checks the repository for newer data about every ten minutes, so a new day appears within roughly fifteen minutes of the daily job committing it.
Newest prices
GET /v1/prices/latest
The newest day in the stored data: all four cities, petrol and diesel.
curl "https://india-petroleum-api.vercel.app/v1/prices/latest"{
"success": true,
"data": {
"date": "2026-11-03",
"petrol": {
"delhi": 102.12,
"mumbai": 111.21,
"chennai": 107.77,
"kolkata": 113.51
},
"diesel": {
"delhi": 95.2,
"mumbai": 97.83,
"chennai": 99.55,
"kolkata": 99.82
}
},
"meta": {
"count": 1,
"last_change": {
"petrol": {
"delhi": {
"date": "2026-05-25",
"from": 99.51,
"to": 102.12
},
…Prices over a date range
GET /v1/prices
One row per calendar day between from and to, both included. Every day has a row, including days on which no price moved.
| Parameter | Values | Required | Notes |
|---|---|---|---|
from | YYYY-MM-DD | yes | First day. Dates before 2017-06-16 have no rows. |
to | YYYY-MM-DD | yes | Last day. The range may span at most 3,660 days. |
city | delhi | mumbai | chennai | kolkata | no | Limit the answer to one city. Left out, all four cities are returned. Any other value is a 404 UNKNOWN_CITY that lists the valid ones. |
fuel | petrol | diesel | no | Limit the answer to one fuel. Left out, both fuels are returned. Any other value is a 404 UNKNOWN_FUEL that lists the valid ones. |
curl "https://india-petroleum-api.vercel.app/v1/prices?city=delhi&from=2026-10-28&to=2026-11-03"{
"success": true,
"data": [
{
"date": "2026-10-28",
"petrol": {
"delhi": 102.12
},
"diesel": {
"delhi": 95.2
}
},
{
"date": "2026-10-29",
"petrol": {
"delhi": 102.12
},
"diesel": {
"delhi": 95.2
}
},
{
"date": "2026-10-30",
"petrol": {
"delhi": 102.12
},
…Price changes
GET /v1/prices/changes
Only the moves: one row for each date on which a price changed, with the price before and after.
| Parameter | Values | Required | Notes |
|---|---|---|---|
from | YYYY-MM-DD | no | First day. Defaults to 365 days before to. |
to | YYYY-MM-DD | no | Last day. Defaults to the newest date in the data. |
city | delhi | mumbai | chennai | kolkata | no | Limit the answer to one city. Left out, all four cities are returned. Any other value is a 404 UNKNOWN_CITY that lists the valid ones. |
fuel | petrol | diesel | no | Limit the answer to one fuel. Left out, both fuels are returned. Any other value is a 404 UNKNOWN_FUEL that lists the valid ones. |
curl "https://india-petroleum-api.vercel.app/v1/prices/changes?city=delhi&fuel=petrol&from=2025-11-04&to=2026-11-03"{
"success": true,
"data": [
{
"date": "2026-05-15",
"fuel": "petrol",
"city": "delhi",
"from": 94.77,
"to": 97.77
},
{
"date": "2026-05-19",
"fuel": "petrol",
"city": "delhi",
"from": 97.77,
"to": 98.64
},
{
"date": "2026-05-23",
"fuel": "petrol",
"city": "delhi",
"from": 98.64,
"to": 99.51
},
{
"date": "2026-05-25",
…Cities
GET /v1/cities
The four cities the table covers, with the slug to use in the city parameter.
curl "https://india-petroleum-api.vercel.app/v1/cities"{
"success": true,
"data": [
{
"slug": "delhi",
"name": "Delhi"
},
{
"slug": "mumbai",
"name": "Mumbai"
},
{
"slug": "chennai",
"name": "Chennai"
},
{
"slug": "kolkata",
"name": "Kolkata"
}
],
"meta": {
"count": 4,
"attribution": "Source: Petroleum Planning & Analysis Cell (PPAC), Ministry of Petroleum and Natural Gas, Government of India",
"source_posted_date": "2026-11-03",
"latest_fetched_at": "2026-11-03T11:03:49.734Z"
}
…Data provenance and freshness
GET /v1/meta
Where the stored data came from and how current it is: the PPAC file URL and its SHA-256, when it was downloaded, the first and last date, and days_behind.
curl "https://india-petroleum-api.vercel.app/v1/meta"{
"success": true,
"data": {
"source": "PPAC",
"attribution": "Source: Petroleum Planning & Analysis Cell (PPAC), Ministry of Petroleum and Natural Gas, Government of India",
"source_url": "https://ppac.gov.in/uploads/page-images/1793687501_PP_9_a_DailyPriceMSHSD_Metro_03.11.2026.pdf",
"source_posted_date": "2026-11-03",
"sha256": "7717e11a64c2c5e91f8bfc20e79646a555214682e932ff6e457c7922b665f934",
"fetched_at": "2026-11-03T11:03:49.734Z",
"first_date": "2017-06-16",
"last_date": "2026-11-03",
"day_count": 3428,
"fuels": [
"petrol",
"diesel"
],
"days_behind": 0,
"data_source": "bundled",
"checked_at": null,
"refresh_error": null
},
"meta": {
"attribution": "Source: Petroleum Planning & Analysis Cell (PPAC), Ministry of Petroleum and Natural Gas, Government of India",
"source_posted_date": "2026-11-03",
"latest_fetched_at": "2026-11-03T11:03:49.734Z"
}
…Health
GET /health
Returns 200 with the API name, coverage and the endpoint list while the service is up. Never cached.
curl "https://india-petroleum-api.vercel.app/health"{
"success": true,
"data": {
"name": "India Petroleum API (PPAC fuel prices)",
"description": "Free, keyless REST API for official daily retail petrol and diesel prices in Delhi, Mumbai, Chennai and Kolkata since 16 June 2017, from PPAC.",
"coverage": {
"first_date": "2017-06-16",
"last_date": "2026-11-03"
},
"data_source": "bundled",
"endpoints": [
"GET /health",
"GET /v1/prices/latest",
"GET /v1/prices?from=YYYY-MM-DD&to=YYYY-MM-DD[&city=][&fuel=]",
"GET /v1/prices/changes[?from=&to=&city=&fuel=]",
"GET /v1/cities",
"GET /v1/meta"
],
"rate_limit": "100 requests per 15 minutes per IP address, counted on each server instance",
"status": "operational"
},
"meta": {
"attribution": "Source: Petroleum Planning & Analysis Cell (PPAC), Ministry of Petroleum and Natural Gas, Government of India",
"source_posted_date": "2026-11-03",
"latest_fetched_at": "2026-11-03T11:03:49.734Z"
}
…Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | MISSING_PARAM | A required parameter is missing. The message names it. |
| 400 | INVALID_DATE | from or to is not a real calendar date in YYYY-MM-DD form. |
| 400 | INVALID_RANGE | from is after to. |
| 400 | RANGE_TOO_LARGE | The range spans more than 3,660 days. Ask for several ranges. |
| 404 | UNKNOWN_CITY | city is not one of the four slugs. valid_values lists them. |
| 404 | UNKNOWN_FUEL | fuel is not petrol or diesel. valid_values lists them. |
| 404 | NOT_FOUND | No such route. |
| 429 | RATE_LIMITED | More than 100 requests from one IP address in 15 minutes on one server instance. |
| 500 | INTERNAL_ERROR | An unexpected failure on the server. |
curl "https://india-petroleum-api.vercel.app/v1/prices?city=delhi"{
"success": false,
"error": {
"code": "MISSING_PARAM",
"message": "Missing required query parameter(s): from, to. Dates are YYYY-MM-DD."
}
}curl "https://india-petroleum-api.vercel.app/v1/prices?city=delhi&fuel=kerosene&from=2026-10-30&to=2026-11-03"{
"success": false,
"error": {
"code": "UNKNOWN_FUEL",
"message": "Unknown fuel 'kerosene'. Valid values: petrol, diesel.",
"valid_values": [
"petrol",
"diesel"
]
}
}Dates and prices
dateis PPAC’s Date of Revision, copied as printed. A note under PPAC’s table says a daily price change applies from 6:00 AM; the API does not claim what a pump charged at a given hour.- Prices are rupees per litre with two decimals. A footnote on the table says they are Indian Oil Corporation’s retail selling prices.
- There is a row for every day from 16 June 2017, whether or not a price moved. Use
/v1/prices/changesto list only the days that did. days_behindin/v1/metacounts calendar days in India between today and the newest price date. The example above shows the value on the day the site was built.
Source: PPAC’s table, reused under PPAC’s terms: free of charge if reproduced accurately and with the source prominently acknowledged. Keep meta.attribution next to the figures you show.