Google Maps Platform Reporting

It’s important to monitor your Google Maps Platform usage, quota, and billing numbers on a regular basis. Monitoring these numbers can help you track requests made by projects, stay within predefined consumption limits, and control costs through planned budgets. Monitoring these numbers can also help you detect any unexpected interactions that might occur between your projects and the Google Maps Platform services.

Cloud Console

You can monitor your Google Maps Platform usage, quota, and billing numbers using the Google Cloud Platform Console (also referred to as the Cloud Console).

APIs & Services

The Cloud Console APIs & Services provides usage metrics for all APIs enabled for your project: the Google Maps Platform APIs and SDKs as well as other Google APIs and services.

apis & services

To access APIs & Services:

  1. Open the Google Cloud Platform Console.
  2. Select a project.
  3. Click the menu button menu and then click APIs & Services.

Google Maps Platform

The Cloud Console Google Maps Platform provides usage and quota metrics for the Google Maps Platform APIs and SDKs only (referred to, going forward, as the Google Maps Platform APIs or simply the APIs).

Google Maps dashboard

To access Google Maps Platform:

  1. Open the Google Cloud Platform Console.
  2. Select a project.
  3. Click the menu button menu, scroll down to OTHER GOOGLE SOLUTIONS, and then click Google Maps Platform.

Billing

The Cloud Console Billing provides billing and related cost information for the project you have selected.

Billing dashboard

To access Billing:

  1. Open the Google Cloud Platform Console.
  2. Select a project.
  3. Click the menu button menu and then click Billing.
  4. If you have multiple billing accounts, click Go to linked billing account.
    This will take you to the Overview page for the linked billing account.
  5. In the left menu, click Reports.
    This will take you to the billing Reports page for the linked billing account.

Usage reports

Usage is based on the number of requests your project makes to the Google Maps Platform APIs using the credentials associated with your project. Requests include successful requests, requests that result in server errors, and requests that result in client errors. Credentials include API keys and client IDs (for Premium Plan and migrated Premium Plan projects).

Usage metrics are displayed in tables (Requests, Errors, and Latency) and graphs (Traffic, Errors, and Latency). For tracking purposes:

  • Usage metrics for all APIs can be filtered by time period and API; you can also see traffic, error, and latency grouped by response code, API and credential.
  • Usage metrics for a specific API can be filtered by time period and the API’s versions, credentials and methods; you can also see traffic, error and latency grouped by response code, API method and version, and credential.

APIs & Services Dashboard page

The APIs & Services Dashboard page provides an overview of the usage metrics for all APIs enabled for your project (the Google Maps Platform APIs as well as other APIs and services).

The Dashboard page features three graphs and a table. You can filter the usage displayed in the graphs and tables by selecting a time period (from 1 hour up to the last 30 days).

The Traffic graph shows usage in queries per second (QPS) per API. The Errors graph shows percentage of the requests that resulted in errors per API. The Latency graph shows the median latency of the requests per API.

Beneath the graphs, a table lists the enabled APIs and services. Requests are the number of requests (for the selected time period). Errors are the number of these requests that resulted in errors. Latency (medium latency and percentile) is the latency for these requests.

For more information, see Monitoring your API Usage.

monitoring apis

Google Maps Overview page

The Google Maps Overview page includes a table listing enabled APIs and usage requests for the last 30 days. Requests by API are also shown in graph form. A billing graph shows your current bill and total usage for the last 3 months.

Note: If you click the name of any enabled API, you will be directed to the Google Maps Metrics page for that API.

overview

Google Maps Platform APIs page

The Google Maps APIs page includes two tables. The Enabled APIs table shows the number of requests, the number of errors, and the average latency for each enabled API for the last 30 days. The Additional APIs table lists APIs that have not been enabled (hence, no usage is reported).

Note: If you click the name of any enabled API, you will be directed to the Google Maps Metrics page for that API.

apis

Google Maps Credentials page

The Google Maps Credentials page shows the credentials you have created, either API keys, OAuth client IDs, and/or service account keys. The corresponding tables list the attributes that identify each credential, including the credential name, creation date, and credential restrictions, as well as the API key number, client ID number, and service account email.

For API and service account keys, credential usage is also provided:

  • Usage with this service (last 30 days): The number of times a credential has been used to call this service. This number includes billable and non-billable usage.
  • Usage with all services (last 30 days): The number of times a credential has been used to call any service. This number includes billable and non-billable usage.

Note that "this service" refers to the Google Maps Platform API currently selected, while "all services" refers to any and all Google Maps Platform APIs using the credential.

Google Maps Metrics page

On the Google Maps Metrics page you can select (and display) up to 10 Traffic, Errors, and Latency graphs — grouped by response code, API, or credential. You can filter the results by selecting a specific API or multiple APIs.

Beneath the graphs, the Metrics page includes an APIs table that shows requests, errors, and latency for the APIs you have selected.

Using the API drop-downs, you can filter results by setting values for the API’s versions, credentials, and methods. You can also filter results in the graphs by selecting a time period (from 1 hour up to the last 30 days).

The usage in the Traffic, Errors, and Latency graphs can be grouped by response code, API method, API version, and credential.

metrics

Response code graphs

The Traffic by response code and Error by response code graphs split usage by response code class. The table below shows the mapping between the Google Maps Platform API response status and response code class:

Response Status Response Code Class
(2xx, 4xx, 5xx)
Notes
OK 2xx Successful response.

This is a billable request and will consume quota.
ZERO_RESULTS 2xx Successful response returned no result.

This is a billable request and will consume quota.
NOT_FOUND 2xx For the Directions API this indicates that at least one of the locations specified in the request's origin, destination, or waypoints could not be geocoded.

For the Places API this indicates that the referenced location (place_id) was not found in the Places database.

This is a billable request and will consume quota.
REQUEST_DENIED 4xx Client error caused by authentication error, access error, etc. Check the API response for more details.
OVER_DAILY_LIMIT,
OVER_QUERY_LIMIT,
RESOURCE_EXHAUSTED,
rateLimitExceeded,
dailyLimitExceeded,
userRateLimitExceeded
4xx Client error caused by too many requests per allowed time period. Retry the request at a later time. Check the API response for more details.
INVALID_REQUEST (invalid parameter, missing parameter, request parsing error) 4xx Client error caused by invalid request. Check the API response for more details.
NOT_FOUND (404) 4xx For the Geolocation API, this indicates that the inputs were not sufficient to produce a location estimate.

For the Roads API, this indicates that the inputs could not be reasonably snapped to roads.

This is a billable request and will consume quota.
INVALID_REQUEST (invalid parameter value),
MAX_WAYPOINTS_EXCEEDED,
MAX_ROUTE_LENGTH_EXCEEDED, etc.
4xx Error caused by invalid parameter value, too many values provided, etc. Check the API response for more details.

This is a billable request and will consume quota.
UNKNOWN_ERROR 5xx Server error indicating that request cannot be proceeded: internal error, service overloaded, not available, time out, etc.

For more information about status codes and error messages, see the response documentation for the API you are interested in (for example, Geocoding Responses or Directions Responses).

Quota reports

Quotas set limits on the number of requests your project can make to the Google Maps Platform APIs. Requests can be limited in three ways: per day, per second, and per user per second. Only successful requests and requests that cause server errors count against quota (requests that cause client errors do not count against quota).

Quota usage is displayed in graphs and can be grouped in requests per day or per 100 seconds. The current quota limits for selected APIs are displayed in tables below the quota usage graphs.

Google Maps Quotas page

The Google Maps Quotas page shows quota limits and quota consumption for the specific API you have selected.

The quota usage chart on the Google Cloud Console shows the total traffic for your API keys and client IDs. Client ID traffic is also available in the Metrics chart on the Google Cloud Console. For more information, see Issue 158809616.

The page shows only requests that consume quota: successful requests (OK, ZERO_RESULTS) and requests that cause server errors (NOT_FOUND, INVALID_VALUE, UNKNOWN_ERROR).

Requests that cause client errors — authentication/authorization/invalid argument errors (REQUEST_DENIED, OVER_QUERY_LIMIT, INVALID_REQUEST) — do not consume quota and are not displayed.

The quota unit is a request for most of the Google Maps Platform APIs (Static Maps API, Street View Static API, Geocoding API, Directions API, Places API, Timezone API, Geolocation API, and Elevation API). But there are some exceptions:

  • For the Distance Matrix API, the quota unit is an element which is an origin-destination pair.
  • For the Maps JavaScript API, the quota unit is a map load.
  • For the Maps SDK for Android and Maps SDK for iOS, the quota unit is a Street View request/Panorama load (Map loads are free and do not consume quota).
quotas

Quota units

The table below shows the quota unit for the Google Maps Platform APIs.

Google Maps Platform API Quota Unit
Maps
Maps SDK for Android 1 Panorama
Maps SDK for iOS 1 Panorama
Maps Static API 1 Request
Maps JavaScript API 1 Map Load
Street View Static API 1 Request
Maps Embed API 1 Map Load
Routes
Directions API 1 Request
Distance Matrix API 1 Element (origin-destination pair)
Roads API 1 Request
Places
Places API 1 Request
Geocoding API 1 Request
Geolocation API 1 Request
Time Zone API 1 Request

Billing reports

View your billing report

Billing reports for your use of the Google Maps Platform products are available in the Google Cloud Console (see Billing).

How to read the billing report chart

Billing reports plot cost over time as a stacked line chart. The default view displays the current month’s daily usage-specific costs grouped by project (for all products), inclusive of any usage-specific credits applied, as well as the total forecasted cost for the entire current month. Each line in the chart (and row in the summary table) corresponds to the project, ranked largest to smallest by cost. Learn more about interpreting the billing report chart.

billing reports
Figure 1: The billing report displaying chart and table using the default preset view.

Tip: Analyze the usage and cost per SKU

To more accurately understand the details of the pay-as-you-go pricing model and how it impacts your implementation, look at your usage and cost by SKU.

Billing report grouped by SKU
Figure 2: The billing table displaying usage and cost line items by SKU.
Billing report filters
Figure 3: The billing report filters.
To change the report view to display line items by SKU:
  1. In the panel to the right of the chart, expand the Group by filter.
  2. Select SKU.

Other filters available in the billing report include Time range, Projects, Products, and SKUs.

You can change the chart view to exclude usage-specific credits by unchecking the Include credits in cost checkbox in the right panel.

Monitor and restrict consumption

To help you to plan your budget and control costs, you can do the following:

  • Set a budget alert, to track how your spend is growing toward a particular amount. Setting a budget does not cap API usage, it only alerts you when your spend amount gets near the specified amount.
  • Cap your daily API usage, to manage your cost of use of billable APIs. By setting caps on requests per day, you can limit your spend. Use a simple equation to determine your daily cap depending on how much you want to spend. For example: (Monthly spend /price per each SKU)/30 = requests per day cap (for one API). Note that your implementation may use multiple billable APIs, so adjust your equation as needed. Remember, a $200 USD Google Maps Platform credit is available each month, so be sure to factor that into your calculation.

Usage tracking per channel

You can now start tracking your usage via numeric channels. This is another way to categorize the source of your usage in addition to the product. To start doing this you need to add the 'channel' parameter to your requests. The only acceptable channel values are numbers from 0-999. Here are a few examples:

  • Geocoding Web Service API

    https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY&channel=1
  • Maps JavaScript API

    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&channel=2&callback=initMap"
    async defer></script>

You can monitor your channel usage directly on your Billing Report. Channels will reflect under Labels as Key: 'goog-maps-channel'.

Filter by Labels
Figure 4: Filter by SKU and Channels
To filter your billing report by SKU and channel:
  1. Use the Group by SKU filter.
  2. Click on the Labels caret.
  3. Click on the Key dropdown and select: goog-maps-channel
  4. Click on the Value dropdown and select the numerical channels you want to filter

Alternatively, you can also Group by Label key: 'goog-maps-channel' if you'd like to see the cost generated by each channel.

Once you have implemented channel usage data in your requests, there may be a short delay (up to 24 hours) before the data is reflected in your billing report.

Export your billing data with BigQuery

You can also export your billing data to BigQuery.

BigQuery Export enables you to export detailed Cloud Billing data (such as usage and cost estimate data) automatically throughout the day to a BigQuery dataset that you specify. Then you can access your billing data from BigQuery for detailed analysis. This gives an extra layer of granularity in understanding the source of your Google Maps Platform usage.

If you'd like to get started with BigQuery exports and querying the data, you can try the sample query below. Prior to running this query, you must:

  • Enable billing and BigQuery billing export on your account.
  • The table format is PROJECT_ID.DATASET_NAME.gcp_billing_export_v1_BILLING_ACCOUNT_ID where:
    • PROJECT_ID is your actual project ID (e.g. "my-project-123456").
    • DATASET_NAME is the name of the dataset you created (e.g. "SampleDataSet").
    • BILLING_ACCOUNT_ID is a reference of your Billing Account ID, prefixed with "gcp_billing_export_v1_", and changing dashes (-) to underscores (_). For example, billing account ID 123456-7890AB-CDEF01 would become gcp_billing_export_v1_123456_789AB_CDEF01.

Note: When you create a new DataSet it will appear in the interface right away, but the Table to query will not yet appear. The table will be automatically generated after a few hours. It will then take around 24 hours to see your data. Your BigQuery dataset only reflects usage and cost data incurred from the date you set up the billing export, and after. In other words, billing data is not added retroactively, so you won't see billing data from before you enable BigQuery export.

  #standardSQL
  SELECT   Date(usage_start_time, "America/Los_Angeles") AS billing_day,
           invoice.month                                 AS invoice_month,
           service.description                           AS service,
           sku.description                               AS sku,
           (
                  SELECT l.value
                  FROM   Unnest(labels) AS l
                  WHERE  l.KEY = 'goog-maps-channel' ) AS goog_maps_channel,
           Round(Sum(usage.amount), 2)                 AS usage_amount,
           usage.unit                                  AS usage_unit,
           Round(Sum(cost), 2)                         AS cost,
           cost_type,
           currency
  FROM     `PROJECT_ID.DATASET_NAME.gcp_billing_export_v1_BILLING_ACCOUNT_ID`
  WHERE    invoice.month = '202002' -- Change the invoice month with the same format as the example.
  GROUP BY billing_day,
           invoice_month,
           service,
           sku,
           goog_maps_channel,
           usage_unit,
           cost_type,
           currency
  ORDER BY billing_day,
           service,
           sku
  

Cloud Billing:

Google Maps Platform:

Response status and reports

The table below lists the response status and response code class, and indicates if the corresponding request appears in the Usage, Quota, and/or Billing reports.

Response Status Response Code Class
(2xx, 4xx, 5xx)
Usage Report Quota Report Billing Report
OK 2xx Yes Yes Yes
ZERO_RESULTS,
NOT_FOUND
2xx Yes Yes Yes
REQUEST_DENIED 4xx Yes No No
OVER_DAILY_LIMIT,
OVER_QUERY_LIMIT,
RESOURCE_EXHAUSTED,
dailyLimitExceeded,
rateLimitExceeded,
userRateLimitExceeded
4xx Yes No No
INVALID_REQUEST (invalid parameter, request parsing error) 4xx Yes No No
NOT_FOUND (Geolocation and Roads API) 4xx Yes Yes Yes
INVALID_REQUEST (invalid parameter value),
MAX_WAYPOINTS_EXCEEDED,
MAX_ROUTE_LENGTH_EXCEEDED,
etc.
4xx Yes Yes Yes
UNKNOWN_ERROR 5xx Yes Yes No