Matrix API

A comprehensive service that provides travel times and distances between multiple origins and destinations.

Harness the power of the Matrix API to efficiently calculate optimal routes tailored to various scenarios. Whether you're looking to streamline delivery routes, plan seamless trips, or analyze traffic patterns, this API offers valuable insights to enhance your decision-making. With its ability to handle multiple origins and destinations simultaneously, the Matrix API is an essential tool for logistics, travel planning, and urban mobility analysis.

Use Cases

πŸͺ

Nearest Point of Interest

Locate the nearest points of interest from your current location, such as restaurants, hospitals, or gas stations.

  • Quickly find essential services nearby.
  • Enhance user convenience with instant location-based suggestions.
  • Improve decision-making for emergency or everyday needs.
πŸ“¦

Delivery Route Optimization

Optimize your delivery routes by finding the best order to visit multiple destinations.

  • Streamline delivery processes to save time and resources.
  • Minimize fuel costs by optimizing routes.
  • Improve customer satisfaction with faster deliveries.
πŸ—ΊοΈ

Trip Planning

Plan your trips effectively by identifying the best routes to multiple destinations.

  • Organize multi-stop trips with ease.
  • Enhance travel experience with well-planned itineraries.
  • Save time by avoiding unnecessary detours.
πŸ’°

Transportation Cost Estimation

Estimate transportation costs by calculating travel distances, fuel prices, and vehicle efficiency.

  • Provide users with accurate cost projections for trips.
  • Assist in budgeting for travel expenses.
  • Support decision-making for vehicle selection and trip planning.
πŸ“Š

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/matrix/?json=[]&apiKey={}

Parameters

ParameterTypeDescriptionRequired
jsonstringAn array of semicolon-separated latitude and longitude pairs to specify which places to visit along the way.yes
apiKeystringYour API key for accessing Gebeta Maps.yes

Response Codes for Matrix 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.

Matrix API - CURL Request

To get a route matrix using the Matrix API, you can use the following curl command:

curl "https://mapapi.gebeta.app/api/route/matrix/?json=[{latitude1,longitude1},{latitude2,longitude2}]&apiKey={your-api-key}"

Example

fetch('https://mapapi.gebeta.app/api/route/matrix/?json=[{8.989022,38.79036},{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 Matrix API has some restrictions and limits that you need to be aware of before using it:

  • Coordinates Waypoints: Should only be less than or equal to 10.
  • Rate Limit: 50 requests per second from a single API token. If you exceed this limit, you will receive an error message and your requests will be rejected. To avoid this, you can throttle your requests or use multiple tokens for different applications or users.
  • Inter-Country Requests: Not allowed. You can only request directions within the same country or region. If you try to request directions across different countries or regions, you will receive an error message, and your request will be invalid. For inter-country travel, consider using other map services or APIs that support this feature.

On this page