A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/roads/speed-limits below:

Speed limits | Roads API

Skip to main content Speed limits

Stay organized with collections Save and categorize content based on your preferences.

Notice: The Speed Limit service is available to all customers with an Asset Tracking license. For Google Maps Platform Premium Plan customers who transitioned to pay-as-you-go pricing, the Speed Limit feature remains active on projects with Asset Tracking capabilities (projects with a project ID in the format maps-asset-xxx).

The Roads API returns the posted speed limit for a given road segment. In the case of road segments with variable speed limits, the default speed limit for the segment is returned.

The accuracy of speed limit data returned by the Roads API cannot be guaranteed. The speed limit data provided is not real-time, and may be estimated, inaccurate, incomplete, or outdated. See coverage details to see the regions where speed limit data is available.

Requests

Send requests for speed limits using HTTPS, in the following form:

https://roads.googleapis.com/v1/speedLimits?parameters&key=YOUR_API_KEY
Parameter usage

Required parameters

Optional parameters

Responses

The following elements may be present in a speedLimits response:

Example request using a path

This request gets the speed limit for each road segment nearest to the specified latitude/longitude pairs in a path crossing the Vasco da Gama bridge in Lisbon, Portugal.

Request

https://roads.googleapis.com/v1/speedLimits?path=38.75807927603043,-9.03741754643809|38.6896537,-9.1770515|41.1399289,-8.6094075&key=YOUR_API_KEY

Response

{
  speedLimits:
  [
    {
      placeId: "ChIJX12duJAwGQ0Ra0d4Oi4jOGE",
      speedLimit: 105,
      units: "KPH"
    },
    {
      placeId: "ChIJLQcticc0GQ0RoiNZJVa5GxU",
      speedLimit: 70,
      units: "KPH"
    },
    {
      placeId: "ChIJJ4vQRudkJA0RpednU70A-5M",
      speedLimit: 55,
      units: "KPH"
    }
  ],
  snappedPoints:
  [
    {
      location:
      {
        latitude: 38.75807927603043,
        longitude: -9.037417546438084
      },
      originalIndex: 0,
      placeId: "ChIJX12duJAwGQ0Ra0d4Oi4jOGE"
    },
    {
      location:
      {
        latitude: 38.689653701836896,
        longitude: -9.177051486847693
      },
      originalIndex: 1,
      placeId: "ChIJLQcticc0GQ0RoiNZJVa5GxU"
    },
    {
      location:
      {
        latitude: 41.13993011767777,
        longitude: -8.609400794783655
      },
      originalIndex: 2,
      placeId: "ChIJJ4vQRudkJA0RpednU70A-5M"
    }
  ],
  warningMessage: "Input path is too sparse. You should provide a path where consecutive points are closer to each other. Refer to the 'path' parameter in Google Roads API documentation."
}

Notice the warning message for point sparsity in the above response. If you are requesting speed limits for the nearest road segments at arbitrary points, you must call speedLimits with place IDs retrieved from the nearestRoads endpoint instead.

Example request using place IDs

Instead of using latitude/longitude pairs, you can pass the place IDs of the road segments. We recommend you obtain place IDs for road segments using snapToRoads or nearestRoads requests. When you pass place IDs, the API returns the speed limit for the road segment represented by each place ID. The API does not apply any road-snapping to the place IDs supplied.

The following example requests the speed limits for some of the road segments that cross the Vasco da Gama bridge in Lisbon, Portugal.

Request

https://roads.googleapis.com/v1/speedLimits?placeId=ChIJX12duJAwGQ0Ra0d4Oi4jOGE&placeId=ChIJLQcticc0GQ0RoiNZJVa5GxU&placeId=ChIJJ4vQRudkJA0RpednU70A-5M&key=YOUR_API_KEY

Response

{
  "speedLimits": [
    {
      placeId: "ChIJX12duJAwGQ0Ra0d4Oi4jOGE",
      speedLimit: 105,
      units: "KPH"
    },
    {
      placeId: "ChIJLQcticc0GQ0RoiNZJVa5GxU",
      speedLimit: 70,
      units: "KPH"
    },
    {
      placeId: "ChIJJ4vQRudkJA0RpednU70A-5M",
      speedLimit: 55,
      units: "KPH"
    }
  ]
}
Usage recommendations

To minimize the volume of calls to the Speed Limit service, we recommend sampling the locations of your assets at 5 to 15 minute intervals (the exact value depends on the speed at which an asset is traveling). If an asset is stationary, a single location sample is sufficient (there is no need to make multiple calls).

To minimize overall latency, we recommend calling the Speed Limit service once you have accumulated some data, rather than calling the API every time the location of a mobile asset is received.

Why are some/all speed limits missing?

The most common cause of missing speedLimits is requesting the speed limit of a place that is not a road segment.

The above example uses the Vasco da Gama bridge to illustrate concepts; the bridge supports the road E90 crossing over the Rio Tejo. The bridge itself has a place ID of ChIJUzt97ZEwGQ0RM1JzQfqoDtU. The first road segment in the above response is part of the E90 road and has a place ID of ChIJX12duJAwGQ0Ra0d4Oi4jOGE. In the example request, if you replace the road place ID with the bridge's place ID, then in the response there will only be two speed limits in the speedLimits array because the bridge's place ID does not refer to an individual road segment. Furthermore, if none of the place IDs are for road segments, then the response won't contain any speed limits.

When making speed limit requests using place IDs, make sure each place ID refers to a road segment and not a different type of place. Place IDs for individual road segments are best retrieved using snapToRoads or nearestRoads requests, either of which can return multiple place IDs from a single call.

Except 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 returns the posted speed limit for given road segments, but the accuracy of the data is not guaranteed and may not be real-time."],["You can request speed limits by providing a path of latitude/longitude pairs or place IDs of road segments, using the `path` or `placeId` parameters respectively."],["The response includes the speed limit, units (KPH or MPH), and may include snapped points if a path was provided."],["Speed limit data might be missing if the requested place ID is not a road segment; use `snapToRoads` or `nearestRoads` to obtain place IDs for road segments."],["To optimize usage, sample asset locations at intervals and batch speed limit requests for reduced latency and API calls."]]],["The Speed Limit service, available with an Asset Tracking license, returns posted speed limits for road segments via the Roads API. Requests, sent via HTTPS, require either a `path` (latitude/longitude pairs) or `placeId` of road segments. The API can snap paths to roads or directly use road segment place IDs. Optional parameters include `units` (KPH/MPH). Responses provide speed limit, units, and place ID. Accuracy isn't guaranteed. Optimal use includes sampling locations every 5-15 minutes, and batching requests. Ensure PlaceIds refer to road segments.\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