Direction API

A comprehensive driving directions service that provides accurate, real-time navigation to ensure a seamless travel experience..

The Directions API enables users to find the optimal route between two locations, providing essential information such as travel time, distance, traffic conditions, and detailed turn-by-turn instructions.

Use Cases

🚗

Fastest Route Finder

Discover the quickest route to your destination while avoiding traffic jams and road closures.

  • Receive real-time traffic updates to optimize travel.
  • Access alternate routes to minimize delays.
  • Enhance user satisfaction with timely arrivals.
🗺️

Navigation Integration

Incorporate navigation features into your app or website to provide directions, maps, and estimated travel times.

  • Offer users a seamless navigation experience.
  • Display interactive maps for easy route visualization.
  • Enhance user engagement with estimated travel time features.
📦

Delivery Route Optimization

Find the shortest or most efficient routes for delivering goods or services to multiple locations.

  • Streamline delivery processes to save time and resources.
  • Minimize fuel costs by optimizing routes.
  • Improve customer satisfaction with faster deliveries.
🎮

Interactive Experiences

Create engaging applications using directions and maps for games, quizzes, and tours.

  • Enhance user engagement through interactive map-based activities.
  • Utilize directions for gameplay mechanics and storytelling.
  • Develop educational tools that leverage mapping and navigation.
📊

Traffic Data Access

Utilize real-time and historical traffic data for research, planning, or forecasting purposes.

  • Analyze traffic patterns for better decision-making.
  • Plan future infrastructure projects based on traffic flow data.
  • Support academic research with comprehensive traffic analytics.

Usage

curl https://mapapi.gebeta.app/api/route/direction/?origin={${origin.lat},${origin.lng}}&destination={${destination.lat},${destination.lng}}${waypointsString}&apiKey=${token.token}

Parameter

ParameterTypeDescriptionRequired
originstringSpecifies the latitude and longitude of the origin location in the format lat,lon.yes
destinationstringSpecifies the latitude and longitude of the destination location in the format lat,lon.yes
apiKeystringYour API key for accessing Gebeta Maps.yes
instructionstringA turn by turn instruction from the origin point to destnation. use value 1 to include instruction and 0 to ignore.no
waypointsstring[]An optional array of latitude and longitude pairs (formatted as "lat,lon") separated by semicolons, indicating intermediate locations to visit en route.no

Response Codes for Directions API

Status CodeMessageDescription
200OKThe request was successful. The system found a valid route and returned the requested data.
404NoRouteNo route exists between the specified locations. Confirm that the locations are accessible by route.
401Not Authorized - No TokenAuthentication failed. No valid token was provided. Please include a valid authentication token.
401Not Authorized - Invalid TokenThe authentication token provided is either invalid or expired. Use a current, valid token.
422InvalidInputThe request parameters are incorrect. Review the input values and adjust as needed.

Directions API - CURL Request

To get directions from one location to another using the Directions API, you can use the following curl command:

curl "curl https://mapapi.gebeta.app/api/route/direction/?origin={${origin.lat},${origin.lng}}&destination={${destination.lat},${destination.lng}}${waypointsString}&apiKey=${token.token}"

Example

fetch('https://mapapi.gebeta.app/api/route/direction/?origin={8.989022,38.79036}&destination={9.03045,38.76530}&apiKey=your-api-key')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

API Limits and Restrictions**

The Geocoding API has a rate limit of 50 requests per second per API token. Exceeding this limit will result in an error and rejected requests. To manage this, consider:

  • Throttling your requests.
  • Using multiple tokens for different applications or users.

On this page