ONM API
A comprehensive service that provides travel times and distances between multiple origins and destinations.
Use the ONM API to calculate the best routes for different scenarios, such as optimizing delivery routes, planning trips, or analyzing traffic patterns.
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 |
|---|---|---|---|
origin | string | The origin in latitude and longitude format, e.g., {longitude, latitude}. | yes |
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 ONM 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. |
ONM API - CURL Request
To get a route using the ONM API, you can use the following curl command:
Example
API Limits and Restrictions
The ONM 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 5.
- 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.