RapidAPI logo

Petrol Diesel Prices India

PAID
By newsrain
Updated 4 months ago
9.4/10
Popularity Score
12211ms
Latency
70%
Success Rate

Petrol Diesel Prices India API Documentation

Daily petrol diesel prices in India Capitals and State districts with history.

More endpoints coming soon. Send requirements/feedbacks to newsrain.in@gmail.com

View API Details
GETCapitals+India History
GETCapitals 7 day history
India Level
GETCapitals
State Level
GETState
GETState districts and State price history
GETCapitals+India History

Get everything in capitals + 30 days price history for India

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Code Snippet
unirest.get("https://newsrain-petrol-diesel-prices-india-v1.p.rapidapi.com/capitals/history")
.header("X-RapidAPI-Host", "newsrain-petrol-diesel-prices-india-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://newsrain-petrol-diesel-prices-india-v1.p.rapidapi.com/capitals/history
Request Method: GET
Response Headers
Response Body
Log inSign up

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.get("https://newsrain-petrol-diesel-prices-india-v1.p.rapidapi.com/capitals/history")
.header("X-RapidAPI-Host", "newsrain-petrol-diesel-prices-india-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication