Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Desarrolladores del Espacio Económico Europeo (EEE)
La API de Geocoding es un servicio que proporciona geocodificación y geocodificación inversa de direcciones.
La geocodificación es el proceso que convierte direcciones (como una dirección particular) en coordenadas geográficas (como latitud y longitud) que puedes usar para colocar marcadores en un mapa o posicionarlo.
La geocodificación inversa es el proceso de conversión de coordenadas geográficas en direcciones legibles por humanos.
También puedes usar la API de Geocoding para buscar la dirección de un ID de lugar específico.
Ejemplo de solicitud y respuesta
Puedes acceder a la API de Geocoding a través de una interfaz HTTP. A continuación, se incluyen ejemplos de solicitudes de geocodificación y geocodificación inversa.
Solicitud y respuesta de geocodificación (búsqueda de latitud y longitud)
En el siguiente ejemplo, se solicita la latitud y la longitud de "1600 Amphitheatre
Parkway, Mountain View, CA" y se especifica que el resultado debe estar en formato JSON.
Para probar esto, ingresa la URL en tu navegador web (asegúrate de reemplazar
YOUR_API_KEY por tu clave de API real).
En la respuesta se incluyen la latitud y longitud de la dirección.
A continuación, se muestra un ejemplo de respuesta de geocodificación, en JSON:
{"results":[{"address_components":[{"long_name":"1600","short_name":"1600","types":["street_number"]},{"long_name":"Amphitheatre Parkway","short_name":"Amphitheatre Pkwy","types":["route"]},{"long_name":"Mountain View","short_name":"Mountain View","types":["locality","political"]},{"long_name":"Santa Clara County","short_name":"Santa Clara County","types":["administrative_area_level_2","political"]},{"long_name":"California","short_name":"CA","types":["administrative_area_level_1","political"]},{"long_name":"United States","short_name":"US","types":["country","political"]},{"long_name":"94043","short_name":"94043","types":["postal_code"]}],"formatted_address":"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA","geometry":{"location":{"lat":37.4267861,"lng":-122.0806032},"location_type":"ROOFTOP","viewport":{"northeast":{"lat":37.4281350802915,"lng":-122.0792542197085},"southwest":{"lat":37.4254371197085,"lng":-122.0819521802915}}},"place_id":"ChIJtYuu0V25j4ARwu5e4wwRYgE","plus_code":{"compound_code":"CWC8+R3 Mountain View, California, United States","global_code":"849VCWC8+R3"},"types":["street_address"]}],"status":"OK"}
Solicitud y respuesta de geocodificación inversa (búsqueda de dirección)
En el siguiente ejemplo, se solicita la dirección correspondiente a una latitud o longitud determinada en Brooklyn, Nueva York, EE.UU. Se especifica que la salida debe tener un formato JSON.
Para probar esto, ingresa la URL en tu navegador web (asegúrate de reemplazar
"YOUR_API_KEY" por tu clave de API real).
La respuesta incluye una dirección legible por humanos para la ubicación de latitud y longitud.
A continuación, se muestra un ejemplo de respuesta de geocodificación inversa, en JSON:
{"plus_code":{"compound_code":"P27Q+MC New York, NY, USA","global_code":"87G8P27Q+MC"},"results":[{"address_components":[{"long_name":"279","short_name":"279","types":["street_number"]},{"long_name":"Bedford Avenue","short_name":"Bedford Ave","types":["route"]},{"long_name":"Williamsburg","short_name":"Williamsburg","types":["neighborhood","political"]},{"long_name":"Brooklyn","short_name":"Brooklyn","types":["political","sublocality","sublocality_level_1"]},{"long_name":"Kings County","short_name":"Kings County","types":["administrative_area_level_2","political"]},{"long_name":"New York","short_name":"NY","types":["administrative_area_level_1","political"]},{"long_name":"United States","short_name":"US","types":["country","political"]},{"long_name":"11211","short_name":"11211","types":["postal_code"]}],"formatted_address":"279 Bedford Ave, Brooklyn, NY 11211, USA","geometry":{"location":{"lat":40.7142484,"lng":-73.9614103},"location_type":"ROOFTOP","viewport":{"northeast":{"lat":40.71559738029149,"lng":-73.9600613197085},"southwest":{"lat":40.71289941970849,"lng":-73.96275928029151}}},"place_id":"ChIJT2x8Q2BZwokRpBu2jUzX3dE","plus_code":{"compound_code":"P27Q+MC Brooklyn, New York, United States","global_code":"87G8P27Q+MC"},"types":["bakery","cafe","establishment","food","point_of_interest","store"]},...Additionalresultstruncatedinthisexample[]...],"status":"OK"}
Comienza a realizar codificaciones con nuestras bibliotecas de cliente
Las bibliotecas cliente facilitan el desarrollo con las APIs de servicios web de Google Maps, ya que proporcionan implementaciones nativas simples de tareas comunes, como la autenticación, la limitación de solicitudes y la reintento automático. La API de Geocoding está disponible en los clientes de Java, Python, Go y Node.js para los servicios de Google Maps.
Autenticación, cuotas, precios y políticas
Autenticación
Para usar la API de Geocoding, primero debes habilitarla y obtener las credenciales de autenticación adecuadas. Para obtener más información, consulta Cómo comenzar a utilizar Google Maps Platform.
Cuotas y precios
Revisa la página Uso y facturación para obtener detalles sobre las cuotas y los precios establecidos para la API de Geocoding.
Puedes hacer mucho más con la API de Geocoding. Consulta la
guía para desarrolladores de la API de Geocoding para obtener demostraciones, ejemplos, parámetros disponibles, códigos de estado y mensajes de error, y otros detalles adicionales.
En la
guía para desarrolladores de la API de Geocoding, se describe el servicio web de la API de Geocoding. Está destinada a desarrolladores de sitios web y dispositivos móviles que desean usar datos de geocodificación en los mapas que proporciona una de las APIs de Google Maps Platform.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-31 (UTC)"],[[["\u003cp\u003eThe Geocoding API converts addresses into geographic coordinates (geocoding) and vice versa (reverse geocoding).\u003c/p\u003e\n"],["\u003cp\u003eYou need a Google Cloud project with billing enabled and the Geocoding API enabled before using the service.\u003c/p\u003e\n"],["\u003cp\u003eAccess the Geocoding API through HTTP requests, specifying the address or coordinates and desired output format.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries are available for Java, Python, Go, and Node.js to simplify development with the API.\u003c/p\u003e\n"],["\u003cp\u003eUsage of the Geocoding API is subject to quotas, pricing, and policies outlined in the documentation.\u003c/p\u003e\n"]]],[],null,["**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n| **Before you begin:** Before you start using the Geocoding API, you need a project with a billing account and the Geocoding API enabled. We recommend creating multiple Project Owners and Billing Administrators, so that you'll always have someone with these roles available to your team. To learn more, see [Set up in Cloud console](/maps/documentation/geocoding/cloud-setup).\n\nThe Geocoding API is a service that provides geocoding and reverse geocoding\nof addresses.\n| This service is also available as part of the client-side [Google Maps JavaScript\n| API](/maps/documentation/javascript/geocoding), or for server-side use with the [Java Client,\n| Python Client, Go Client and Node.js Client for Google Maps Services](/maps/documentation/geocoding/client-library).\n\n**Geocoding** is the process of converting addresses (like a street address)\ninto geographic coordinates (like latitude and longitude), which you can use to place markers\non a map, or position the map.\n\n**Reverse geocoding** is the process of converting geographic coordinates\ninto a human-readable address.\n\nYou can also use the Geocoding API to find the address for a\ngiven [place ID](/maps/documentation/geocoding/requests-places-geocoding).\n\nSample request and response\n\nYou access the Geocoding API through an HTTP interface. Following\nare examples of geocoding and [reverse geocoding](#reverse) requests.\n\nGeocoding request and response (latitude/longitude lookup)\n\nThe following example requests the latitude and longitude of \"1600 Amphitheatre\nParkway, Mountain View, CA\", and specifies that the output must be in JSON format. \n\n```carbon\nhttps://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY\n```\n\nYou can test this by entering the URL into your web browser (be sure to replace\n`YOUR_API_KEY` with [your actual API key](/maps/documentation/geocoding/get-api-key)).\nThe response includes the latitude and longitude of the address.\n\nView the [developer's guide](/maps/documentation/geocoding/overview)\nfor more information about\n[building geocoding request URLs](/maps/documentation/geocoding/overview#geocoding-requests) and\n[available parameters](/maps/documentation/geocoding/overview#geocoding)\nand [understanding the response](/maps/documentation/geocoding/overview#geocoding-requests).\n\nBelow is a sample geocoding response, in JSON: \n\n```carbon\n{\n \"results\" : [\n {\n \"address_components\" : [\n {\n \"long_name\" : \"1600\",\n \"short_name\" : \"1600\",\n \"types\" : [ \"street_number\" ]\n },\n {\n \"long_name\" : \"Amphitheatre Parkway\",\n \"short_name\" : \"Amphitheatre Pkwy\",\n \"types\" : [ \"route\" ]\n },\n {\n \"long_name\" : \"Mountain View\",\n \"short_name\" : \"Mountain View\",\n \"types\" : [ \"locality\", \"political\" ]\n },\n {\n \"long_name\" : \"Santa Clara County\",\n \"short_name\" : \"Santa Clara County\",\n \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n },\n {\n \"long_name\" : \"California\",\n \"short_name\" : \"CA\",\n \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n },\n {\n \"long_name\" : \"United States\",\n \"short_name\" : \"US\",\n \"types\" : [ \"country\", \"political\" ]\n },\n {\n \"long_name\" : \"94043\",\n \"short_name\" : \"94043\",\n \"types\" : [ \"postal_code\" ]\n }\n ],\n \"formatted_address\" : \"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA\",\n \"geometry\" : {\n \"location\" : {\n \"lat\" : 37.4267861,\n \"lng\" : -122.0806032\n },\n \"location_type\" : \"ROOFTOP\",\n \"viewport\" : {\n \"northeast\" : {\n \"lat\" : 37.4281350802915,\n \"lng\" : -122.0792542197085\n },\n \"southwest\" : {\n \"lat\" : 37.4254371197085,\n \"lng\" : -122.0819521802915\n }\n }\n },\n \"place_id\" : \"ChIJtYuu0V25j4ARwu5e4wwRYgE\",\n \"plus_code\" : {\n \"compound_code\" : \"CWC8+R3 Mountain View, California, United States\",\n \"global_code\" : \"849VCWC8+R3\"\n },\n \"types\" : [ \"street_address\" ]\n }\n ],\n \"status\" : \"OK\"\n}\n```\n\nReverse geocoding request and response (address lookup)\n\nThe following example requests the address corresponding to a given latitude/longitude\nin Brooklyn, NY, USA. It specifies that the output must be in JSON format. \n\n```scdoc\nhttps://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY\n```\n\nYou can test this by entering the URL into your web browser (be sure to replace\n'YOUR_API_KEY' with [your actual API key](#get-a-key)).\nThe response includes a human-readable address for the latitude and longitude\nlocation.\n\nView the [developer's guide](/maps/documentation/geocoding/overview)\nfor more information about\n[building reverse geocoding request URLs](/maps/documentation/geocoding/overview#GeocodingRequests) and\n[available parameters](/maps/documentation/geocoding/overview#ReverseGeocoding)\nand [understanding the response](/maps/documentation/geocoding/overview#reverse-response).\n\nBelow is a sample reverse geocoding response, in JSON: \n\n```carbon\n{\n \"plus_code\" : {\n \"compound_code\" : \"P27Q+MC New York, NY, USA\",\n \"global_code\" : \"87G8P27Q+MC\"\n },\n \"results\" : [\n {\n \"address_components\" : [\n {\n \"long_name\" : \"279\",\n \"short_name\" : \"279\",\n \"types\" : [ \"street_number\" ]\n },\n {\n \"long_name\" : \"Bedford Avenue\",\n \"short_name\" : \"Bedford Ave\",\n \"types\" : [ \"route\" ]\n },\n {\n \"long_name\" : \"Williamsburg\",\n \"short_name\" : \"Williamsburg\",\n \"types\" : [ \"neighborhood\", \"political\" ]\n },\n {\n \"long_name\" : \"Brooklyn\",\n \"short_name\" : \"Brooklyn\",\n \"types\" : [ \"political\", \"sublocality\", \"sublocality_level_1\" ]\n },\n {\n \"long_name\" : \"Kings County\",\n \"short_name\" : \"Kings County\",\n \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n },\n {\n \"long_name\" : \"New York\",\n \"short_name\" : \"NY\",\n \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n },\n {\n \"long_name\" : \"United States\",\n \"short_name\" : \"US\",\n \"types\" : [ \"country\", \"political\" ]\n },\n {\n \"long_name\" : \"11211\",\n \"short_name\" : \"11211\",\n \"types\" : [ \"postal_code\" ]\n }\n ],\n \"formatted_address\" : \"279 Bedford Ave, Brooklyn, NY 11211, USA\",\n \"geometry\" : {\n \"location\" : {\n \"lat\" : 40.7142484,\n \"lng\" : -73.9614103\n },\n \"location_type\" : \"ROOFTOP\",\n \"viewport\" : {\n \"northeast\" : {\n \"lat\" : 40.71559738029149,\n \"lng\" : -73.9600613197085\n },\n \"southwest\" : {\n \"lat\" : 40.71289941970849,\n \"lng\" : -73.96275928029151\n }\n }\n },\n \"place_id\" : \"ChIJT2x8Q2BZwokRpBu2jUzX3dE\",\n \"plus_code\" : {\n \"compound_code\" : \"P27Q+MC Brooklyn, New York, United States\",\n \"global_code\" : \"87G8P27Q+MC\"\n },\n \"types\" : [\n \"bakery\",\n \"cafe\",\n \"establishment\",\n \"food\",\n \"point_of_interest\",\n \"store\"\n ]\n },\n\n ... Additional results truncated in this example[] ...\n\n ],\n \"status\" : \"OK\"\n}\n```\n\nStart coding with our client libraries\n\nClient libraries make\ndeveloping with the Google Maps web service APIs easier by providing simple,\nnative implementations of common tasks, such as authentication, request\nthrottling and automatic retry. The Geocoding API is available\nin the\n[Java Client,\nPython Client, Go Client and Node.js Client for Google Maps Services](/maps/documentation/geocoding/client-library).\n\nAuthentication, quotas, pricing, and policies\n\nAuthentication\n\nTo use the Geocoding API, you must first enable the API\nand obtain the proper authentication credentials. For more information, see\n[Get Started with Google Maps Platform](https://developers.google.com/maps/get-started).\n\nQuotas and pricing\n\nReview the [usage and billing](/maps/documentation/geocoding/usage-and-billing)\npage for details on the quotas and pricing set for the Geocoding API.\n\nPolicies\n\nUse of the Geocoding API must be in accordance with the\n[API policies](/maps/documentation/geocoding/policies).\n\nLearn more\n\nThere's more you can do with the Geocoding API. See the\n[Geocoding API developer guide](/maps/documentation/geocoding/overview) for additional demos,\nexamples, available parameters, status codes and error messages, and other details.\n\nThe [Geocoding API developer guide](/maps/documentation/geocoding/overview) describes the\nGeocoding API web service. It is intended for website and mobile developers\nwho want to use geocoding data within maps provided by one of the Google Maps Platform\nAPIs."]]