Description
π£οΈ Fuel Price Direction En route API
This document serves as a guide for utilizing the Fuel Price Direction En route API, which provides comprehensive information on:
πΊοΈ Fuel prices of states en route
π Comparison of fuel prices
π Route details (distance & time) between a starting point and destination
By integrating fuel price data into route planning, users can efficiently plan refueling stops, enhancing convenience and cost-effectiveness.
β¨ Features & Capabilities
π§ Route Planning β Input starting location & destination β get route details (distance, duration, bounds).
π« Avoidance Options β Option to avoid tolls or highways for customized routes.
π Alternative Routes β Provides alternate route suggestions if requested.
β½ Fuel Price Info β Returns petrol, diesel, CNG, and electricity prices (if available) for states along the route.
π Distance & Time β Includes total distance and estimated travel time.
π Convenience β Identifies optimal refueling stops to save time and money.
π° Cost-effectiveness β Helps users pick cheaper fuel options along the way.
π Geographic Coordinates β Latitude & longitude for states (currently India, expandable globally).
π§© Polyline Representation β Encoded polyline format for efficient route geometry storage.
β‘ Scalability β Designed to support large volumes of route & fuel price requests.
π₯ Required Parameters
π start_location (string) β Starting location of the journey.
π destination (string) β Destination of the journey.
π οΈ Optional Parameters
π alternatives (boolean) β Whether alternative routes should be considered (true/false).
π« avoid_tolls (boolean) β Whether toll roads should be avoided (true/false).
π avoid_highways (boolean) β Whether highways should be avoided (true/false).
π€ Response Format (JSON)
The API response includes:
π start_location (string) β The starting location provided.
π destination (string) β The destination provided.
π£οΈ routes (array) β Each route object contains:
π route (string) β Identifier for the route.
π distance (string) β Route distance in km.
β±οΈ duration (string) β Route duration in hours/minutes.
π distance_value (integer) β Distance in meters.
β±οΈ duration_value (integer) β Duration in seconds.
πΊοΈ bounds (object) β Geographic bounds (northeast & southwest corners).
π waypoints (array, optional) β Each waypoint may contain:
π waypoint_start_location (object)
π waypoint_end_location (object)
π waypoint_distance (object)
β±οΈ waypoint_duration (object)
π§© waypoint_polyline (object) β Encoded polyline for the waypoint.
π§ maneuver (string, optional) β Specific maneuver instructions.
π html_instructions (string, optional) β Step instructions (HTML formatted).
π§© polylinePoints (string) β Encoded polyline representing the route. To decode, refer to the Google Polyline Utility documentation by below link:
β½ fuel_prices (array) β Fuel prices along the route. Each entry includes:
π·οΈ state (string) β Name of the state (en route).
π lat (float) β Latitude.
π long (float) β Longitude.
β½ fuel_prices (object) β Petrol, Diesel, CNG, and Electricity (if available).
π lowest_fueldata (object) β Lowest petrol, diesel, CNG prices on the route.
π highest_fueldata (object) β Highest petrol, diesel, CNG prices on the route.
API Details
API Version
1.0.0
This is the current version of the API available for use.
No description provided.
Parameters
| Parameter | Type | Description | Example |
end_location* |
Text (String) |
Enter the destination location latitude and longitude |
26.9124, 75.7873 |
start_location* |
Text (String) |
Enter the start location latitude and longitude |
28.7041, 77.1025 |
Example Request
{
"start_location": "Delhi",
"end_location": "Jaipur"
}
Example Response
{
"start_location": "Delhi ",
"destination": "Jaipur",
"routes": [
{
"route": "R1",
"distance": "315 km",
"duration": "5 hours 6 mins",
"distance_value": 314912,
"duration_value": 18383,
"bounds": {
"northeast": {
"lat": 28.7040873,
"lng": 77.15188409999999
},
"southwest": {
"lat": 26.8549099,
"lng": 75.7511454
}
},
"waypoints": [
{
"waypoint_start_location": {
"lat": 28.7040873,
"lng": 77.1024072
},
"waypoint_end_location": {
"lat": 28.70391189999999,
"lng": 77.1022401
},
"waypoint_distance": {
"text": "25 m",
"value": 25
},
"waypoint_duration": {
"text": "1 min",
"value": 6
},
"waypoint_polyline": {
"points": "qgenDaaruMb@`@"
},
"maneuver": null,
"html_instructions": "Head southwest
Restricted usage road
"
},
{
"waypoint_start_location": {
"lat": 28.70391189999999,
"lng": 77.1022401
},
"waypoint_end_location": {
"lat": 28.7037663,
"lng": 77.1021109
},
"waypoint_distance": {
"text": "35 m",
"value": 35
},
"waypoint_duration": {
"text": "1 min",
"value": 12
},
"waypoint_polyline": {
"points": "mfenD_`ruMEF?BA@?@?B@@JHDB@?@?@?HI"
},
"maneuver": "turn-right",
"html_instructions": "Turn right
Restricted usage road
"
},
{
"waypoint_start_location": {
"lat": 28.7037663,
"lng": 77.1021109
},
"waypoint_end_location": {
"lat": 28.7035249,
"lng": 77.1019008
},
"waypoint_distance": {
"text": "34 m",
"value": 34
},
"waypoint_duration": {
"text": "1 min",
"value": 12
},
"waypoint_polyline": {
"points": "qeenDe_ruMp@h@"
},
"maneuver": "turn-right",
"html_instructions": "Turn right
Restricted usage road
"
}
],
"fuel_prices": [
{
"state": "Rajasthan",
"lat": 26.911909,
"long": 76.4290235,
"fuel_prices": {
"petrol_price": 105.32,
"diesel_price": 90.73,
"cng_price": 89.42
}
},
{
"state": "Delhi",
"lat": 28.7040873,
"long": 77.1024072,
"fuel_prices": {
"petrol_price": 94.74,
"diesel_price": 87.64,
"cng_price": 76.61
}
},
{
"state": "Haryana",
"lat": 27.7872526,
"long": 77.0068131,
"fuel_prices": {
"petrol_price": 95.38,
"diesel_price": 88.21,
"cng_price": 82.66
}
}
]
}
],
"lowest_fueldata": {
"petrol": {
"state": "Delhi",
"lat": 28.7040873,
"long": 77.1024072,
"fuel_prices": {
"petrol_price": 94.74,
"diesel_price": 87.64,
"cng_price": 76.61
}
},
"diesel": {
"state": "Delhi",
"lat": 28.7040873,
"long": 77.1024072,
"fuel_prices": {
"petrol_price": 94.74,
"diesel_price": 87.64,
"cng_price": 76.61
}
},
"cng": {
"state": "Delhi",
"lat": 28.7040873,
"long": 77.1024072,
"fuel_prices": {
"petrol_price": 94.74,
"diesel_price": 87.64,
"cng_price": 76.61
}
}
},
"highest_fueldata": {
"petrol": {
"state": "Rajasthan",
"lat": 26.911909,
"long": 76.4290235,
"fuel_prices": {
"petrol_price": 105.32,
"diesel_price": 90.73,
"cng_price": 89.42
}
},
"diesel": {
"state": "Rajasthan",
"lat": 26.911909,
"long": 76.4290235,
"fuel_prices": {
"petrol_price": 105.32,
"diesel_price": 90.73,
"cng_price": 89.42
}
},
"cng": {
"state": "Rajasthan",
"lat": 26.911909,
"long": 76.4290235,
"fuel_prices": {
"petrol_price": 105.32,
"diesel_price": 90.73,
"cng_price": 89.42
}
}
}
}
Support
For any questions or issues, please contact our support team at info@ssrinnovationlab.com