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.
Delivery Route Optimization
Optimize your delivery routes by finding the best order to visit multiple destinations.
Trip Planning
Plan your trips effectively by identifying the best routes to multiple destinations.
Transportation Cost Estimation
Estimate transportation costs by calculating travel distances, fuel prices, and vehicle efficiency.
Traffic Data Access
Utilize real-time and historical traffic data for research, planning, or forecasting purposes.
Usage
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
json | string | An array of semicolon-separated latitude and longitude pairs to specify which places to visit along the way. | yes |
apiKey | string | Your API key for accessing Gebeta Maps. | yes |
Response Codes for Matrix API
| Status Code | Message | Description |
|---|---|---|
200 | OK | The request was successful. The system found a valid route and returned the requested data. |
404 | NoRoute | No route exists between the specified locations. Confirm that the locations are accessible by route. |
401 | Not Authorized - No Token | Authentication failed. No valid token was provided. Please include a valid authentication token. |
401 | Not Authorized - Invalid Token | The authentication token provided is either invalid or expired. Use a current, valid token. |
422 | InvalidInput | The 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:
Example
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.