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.