{
"openapi": "3.0.3",
"info": {
"title": "Google Maps Platform",
"description": "API Specification for Google Maps Platform",
"version": "1.22.5"
},
"servers": [
{
"url": "https://www.googleapis.com"
}
],
"paths": {
"/geolocation/v1/geolocate": {
"post": {
"operationId": "geolocate",
"servers": [
{
"url": "https://www.googleapis.com"
}
],
"tags": [
"Geolocation API"
],
"description": "Geolocation API returns a location and accuracy radius based on information about cell towers and WiFi nodes that the mobile client can detect. This document describes the protocol used to send this data to the server and to return a response to the client.\n\nCommunication is done over HTTPS using POST. Both request and response are formatted as JSON, and the content type of both is `application/json`.\n\nYou must specify a key in your request, included as the value of a`key` parameter. A `key` is your application's API key. This key identifies your application for purposes of quota management. Learn how to [get a key](https://developers.google.com/maps/documentation/geolocation/get-api-key).",
"requestBody": {
"description": "The request body must be formatted as JSON.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeolocationRequest"
},
"examples": {
"WIFI": {
"value": {
"considerIp": "false",
"wifiAccessPoints": [
{
"macAddress": "84:d4:7e:09:a5:f1",
"signalStrength": -43,
"signalToNoiseRatio": 0
},
{
"macAddress": "44:48:c1:a6:f3:d0",
"signalStrength": -55,
"signalToNoiseRatio": 0
}
]
}
},
"Cell Towers": {
"value": {
"cellTowers": [
{
"cellId": 170402199,
"locationAreaCode": 35632,
"mobileCountryCode": 310,
"mobileNetworkCode": 410,
"age": 0,
"signalStrength": -60,
"timingAdvance": 15
}
]
}
},
"IP Only": {
"value": {
"considerIp": "true"
}
}
}
}
},
"required": false
},
"responses": {
"200": {
"description": "200 OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeolocationResponse"
},
"examples": {
"WIFI": {
"value": {
"location": {
"lat": 37.421925,
"lng": -122.0841293
},
"accuracy": 30
}
},
"Cell Towers": {
"value": {
"location": {
"lat": 37.7777247,
"lng": -122.4162853
},
"accuracy": 1073
}
},
"IP Only": {
"value": {
"location": {
"lat": 37.7802545,
"lng": -122.41590829999998
},
"accuracy": 926
}
}
}
}
}
},
"400": {
"description": "400 BAD REQUEST",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"Bad Request": {
"value": {
"error": {
"code": 400,
"message": "Invalid value at 'cell_tower' (type.googleapis.com/maps_api.CellTower), \"foo\"",
"errors": [
{
"message": "Invalid value at 'cell_tower' (type.googleapis.com/maps_api.CellTower), \"foo\"",
"reason": "invalid"
}
],
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "cell_tower",
"description": "Invalid value at 'cell_tower' (type.googleapis.com/maps_api.CellTower), \"foo\""
}
]
}
]
}
}
},
"Invalid Key": {
"value": {
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"errors": [
{
"message": "API key not valid. Please pass a valid API key.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_INVALID",
"domain": "googleapis.com",
"metadata": {
"service": "geolocation.googleapis.com"
}
}
]
}
}
}
}
}
}
},
"404": {
"description": "404 NOT FOUND",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"Invalid": {
"value": {
"error": {
"code": 404,
"message": "Not Found",
"errors": [
{
"message": "Not Found",
"domain": "geolocation",
"reason": "notFound"
}
]
}
}
}
}
}
}
}
}
}
},
"/maps/api/directions/json": {
"get": {
"operationId": "directions",
"servers": [
{
"url": "https://maps.googleapis.com"
}
],
"tags": [
"Directions API"
],
"description": "The Directions API is a web service that uses an HTTP request to return JSON or XML-formatted directions between locations. You can receive directions for several modes of transportation, such as transit, driving, walking, or cycling.",
"parameters": [
{
"$ref": "#/components/parameters/arrival_time"
},
{
"$ref": "#/components/parameters/departure_time"
},
{
"$ref": "#/components/parameters/directions_alternatives"
},
{
"$ref": "#/components/parameters/directions_avoid"
},
{
"$ref": "#/components/parameters/directions_destination"
},
{
"$ref": "#/components/parameters/directions_origin"
},
{
"$ref": "#/components/parameters/directions_units"
},
{
"$ref": "#/components/parameters/directions_waypoints"
},
{
"$ref": "#/components/parameters/language"
},
{
"$ref": "#/components/parameters/mode"
},
{
"$ref": "#/components/parameters/region"
},
{
"$ref": "#/components/parameters/traffic_model"
},
{
"$ref": "#/components/parameters/transit_mode"
},
{
"$ref": "#/components/parameters/transit_routing_preference"
}
],
"responses": {
"200": {
"description": "200 OK",
"content": {
"application/json": {
"examples": {
"available_travel_modes_response": {
"value": {
"geocoded_waypoints": [
{
"geocoder_status": "OK",
"place_id": "ChIJwZNMti1fawwRO2aVVVX2yKg",
"types": [
"locality",
"political"
]
},
{
"geocoder_status": "OK",
"place_id": "ChIJ3aPgQGtXawwRLYeiBMUi7bM",
"types": [
"locality",
"political"
]
}
],
"routes": [
{
"bounds": {
"northeast": {
"lat": 27.7564327,
"lng": -17.9710024
},
"southwest": {
"lat": 27.6411131,
"lng": -18.0481367
}
},
"copyrights": "Map data ©2022 Inst. Geogr. Nacional",
"legs": [
{
"distance": {
"text": "38.5 km",
"value": 38482
},
"duration": {
"text": "55 mins",
"value": 3312
},
"end_address": "38917 La Restinga, Santa Cruz de Tenerife, Spain",
"end_location": {
"lat": 27.6412095,
"lng": -17.9818845
},
"start_address": "38911 La Frontera, Santa Cruz de Tenerife, Santa Cruz de Tenerife, Spain",
"start_location": {
"lat": 27.7548015,
"lng": -18.0095701
},
"steps": [
{
"distance": {
"text": "64 m",
"value": 64
},
"duration": {
"text": "1 min",
"value": 9
},
"end_location": {
"lat": 27.7550564,
"lng": -18.0089896
},
"html_instructions": "Head northeast on C. el Rumbaso toward C. Cruz Alta/
place_id, then use that Place ID to make a Place Details request. For more information on the fields that are unavailable in a Place Search request, see Places API fields support.location parameter may be overriden if the query contains an explicit location such as Market in Barcelona. Using quotes around the query may also influence the weight given to the location and radius.