Daily Fuel Price - India

FREEMIUM
By navii
Updated 5 months ago
Travel
8.9/10
Popularity Score
2906ms
Latency
61%
Success Rate

Daily Fuel Price - India API Documentation

Get prices of Petrol and Diesel in India. Prices are updated DAILY. Please report bugs.

View API Details
POSTMain Version
POSTTesting Version
POSTLast 7 Day Prices
POSTMain Version

Get daily fuel prices. You need a "BASIC" plan subscription to use this endpoint.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Content-TypeSTRING
OPTIONAL
Required Parameters
POSTJSON_STRING
REQUIREDFuel can be "p" for Petrol and "d" for Diesel. State codes are available on "Overview" page. Both parameters need to be in lowercase.
Code Snippet
unirest.post("https://fuelprice.p.rapidapi.com/")
.header("X-RapidAPI-Host", "fuelprice.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"fuel":"p","state":"dl"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://fuelprice.p.rapidapi.com/
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://fuelprice.p.rapidapi.com/")
.header("X-RapidAPI-Host", "fuelprice.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"fuel":"p","state":"dl"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication