Stay organized with collections Save and categorize content based on your preferences.
The
Roads APIis a service that accepts HTTPS requests with latitude/longitude coordinates for one or more points on a map. It uses these points to find nearby road segments and returns a Place ID along with metadata such as the nearest road segment and speed limits.
Why use the Roads APIWith the Roads API, you can get speed limits, estimated arrival times, or other road metadata. With this road metadata, you can enhance your driving apps with the follow capabilities:
With the Roads API, you can map GPS coordinates to the geometry of the road, and determine the speed limit along road segments.
The Roads API uses three endpoints which accept latitude/longitude coordinates or place IDs to provide road paths, segments, or speed limit data. The following example shows a request for nearest roads based on a set of latitude/longitude coordinates:
https://roads.googleapis.com/v1/nearestRoads ?points=60.170880%2C24.942795%7C60.170879%2C24.942796%7C60.170877%2C24.942796 &key=YOUR_API_KEYResources
The following table summarizes the resources available through the Roads API along with the data it returns.
Data resources Data returned Return format Snap to roadsReturns an array of up to 100 GPS points from a route. Includes road-snapped longitude/latitude coordinates along with place IDs. See details in Responses in the Snap to roads guide.
An array of up to 100 independent latitude/longitude coordinates along with place IDs for the nearest road for each specified point. Points do not need to be continuous. See details in Responses in the Nearest roads guide.
Speed limitsAn array of up to 100 road metadata elements. These contain speed limits and place IDs, with units either in KPH or MPH. See details in Responses in the Speed limits guide.
How to use the Roads API 1 Try the snap to roads demo Click the demo to create a track and see how the snap to roads endpoint provides smooth data. See Demo in the Snap to roads guide. You don't need an API key. 2 Get set up Start with Set up your Google Cloud project and complete the setup instructions that follow and then learn how to use your API key. 3 Try a snap to roads request Use one of the snap to roads examples and try one relevant to your use case. 4 Get speed limits for your road path Using the same path data you provided for your snap to roads request, issue a speed limit query. See the Example request using a path. 5 Learn how to process long paths Follow the sections on Processing long paths in the Advanced concepts guide. 6 Incorporate road data into your own app! See the detailed code example from the road snapped demo to start building road data functionality into your own app. Available client librariesCall this API in the language of your choice through one of the following client libraries:
The Java Client, Python Client, Go Client and Node.js Client for Google Maps Services are community-supported client libraries, open sourced under the Apache 2.0 License. Download them from GitHub, where you can also find installation instructions and sample code.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["The Roads API enhances maps applications by connecting coordinates with roads, finding nearby roads, and providing speed limit data."],["It offers three core functionalities: snapping GPS points to roads, identifying nearest roads, and retrieving speed limits."],["Developers can leverage client libraries for Java, Python, Go, and Node.js to integrate the Roads API."],["The API accepts latitude/longitude coordinates and returns data like Place IDs, road segments, and speed limits in JSON format."],["You can get started by exploring the documentation, trying the demo, setting up a Google Cloud project, and experimenting with code examples."]]],["The Roads API processes HTTPS requests with latitude/longitude coordinates to identify nearby road segments. It offers three main services: Snap to Roads, which maps up to 100 GPS points to road geometry; Nearest Roads, which identifies the closest road segment for up to 100 independent GPS points; and Speed Limits, which returns posted speed limits and place IDs for road segments. Users can integrate these functionalities using client libraries or by making direct requests with an API key.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4