- Developers
- Mapas Sygic
- Analytics API
- Get Road Info
Get Road Info
- Move to section
Please note Sygic does no longer issue new Sygic Maps API keys. This documentation is for existing customers only. If you wish to include maps & navigation into your project, please refer to Sygic Maps SDK.
Overview
Road info is a cloud based service that provides various information about the selected road or road segments. Data returned by Road info API are ready to visualize on the web using Leaflet. Data such as road class, if road is a toll road, restricted for trucks, speed limit or speed profile help to create powerful statistics in real time.
Request
API Reference
https://routing.api.sygic.com/v0/api/roadinfo?key=yourAPIkey
Request authentication is done via parameter key, which must be included in the request URL.
Methods
- GET
Parameters
Required Parameters
Parameter | Data type | Description |
lat | string | Latitude. | lng | string | Longitude. |
key | string | The API key. |
Optional Parameters
Parameter | Data type | Value | Description |
time | integer | UNIX timestamp | Time used to determine truck related attributes. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. Default: current UTC time |
vehicle_heading | integer | 0-359 | Angle in degrees in which vehicle travels (0 for north, 90 for east, 180 for south, 270 for west etc.). Used for vehicles in move - the angle is used to reduce possibility of u-turns in resulting polyline. |
Response
GET https://routing.api.sygic.com/v0/api/roadinfo?lat=48.15021&lng=17.12543&key=yourAPIkey
Response Body
{
"units": "Metric",
"lat": 48.15021,
"lng": 17.12543,
"has_general_tolls": false,
"general_speed_limit": 50,
"truck_speed_limit": 0,
"unpaved_road": false,
"is_general_hazard_restricted": false,
"is_water_hazard_restricted": false,
"has_truck_tolls": false,
"polyline": "al{dHsyogBhCl@",
"status": "OK",
"name": "Karadžičova",
"road_class": "EtRoadClass2",
"directional_info": {
"direction_of_traffic": "Negative",
"vehicle_direction": "Unspecified"
},
"time": 1531731969,
"time_related_speed_info": {
"speed_limit": 50,
"negative_speed_profile": 44.52
},
"entry_restrictions": {
"is_car_entry_restricted": false,
"is_truck_entry_restricted": false
},
"copyright": "© 2018 Sygic a.s."
}
- Previous article: Speeding report
- Next article: Cost calculation API