Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Développeurs situés dans l'Espace économique européen (EEE)
L'API Geocoding est un service qui fournit le géocodage et le géocodage inversé des adresses.
Le geocoding consiste à convertir des adresses (comme une adresse postale) en coordonnées géographiques (comme la latitude et la longitude), que vous pouvez utiliser pour placer des repères sur une carte ou pour positionner celle-ci.
Le geocoding inversé consiste à convertir des coordonnées géographiques en adresses lisibles.
Vous pouvez également utiliser l'API Geocoding pour trouver l'adresse correspondant à un identifiant de lieu donné.
Exemple de requête et de réponse
Vous accédez à l'API Geocoding via une interface HTTP. Vous trouverez ci-dessous des exemples de requêtes de géocodage et de géocode inversé.
Requête de géocodage et réponse (recherche de latitude/longitude)
L'exemple suivant demande la latitude et la longitude de "1600 Amphitheatre Parkway, Mountain View, CA", et spécifie que la sortie doit être au format JSON.
Pour le tester, saisissez l'URL dans votre navigateur Web (assurez-vous de remplacer YOUR_API_KEY par votre clé API réelle).
La réponse inclut la latitude et la longitude de l'adresse.
Un exemple de réponse à une requête de géocodage est fourni ci-dessous, au format 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"}
Requête de géocodage inversé et réponse (recherche d'une adresse)
L'exemple suivant demande l'adresse correspondant à une latitude/longitude donnée à Brooklyn (New York, États-Unis). Il indique également que la réponse doit être au format JSON.
Pour le tester, saisissez l'URL dans votre navigateur Web (assurez-vous de remplacer "YOUR_API_KEY" par votre clé API réelle).
La réponse inclut une adresse lisible par l'humain pour la latitude et la longitude.
Un exemple de réponse à une requête de géocodage inversé est fourni ci-dessous, au format 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"}
Commencer à coder avec nos bibliothèques clients
Les bibliothèques clientes facilitent le développement avec les API de service Web Google Maps en fournissant des implémentations natives simples de tâches courantes, telles que l'authentification, le débit limité des requêtes et les nouvelles tentatives automatiques. L'API Geocoding est disponible dans les clients Java, Python, Go et Node.js pour les services Google Maps.
Authentification, quotas, tarifs et règles
Authentification
Pour utiliser l'API Geocoding, vous devez d'abord l'activer et obtenir les identifiants d'authentification appropriés. Pour en savoir plus, consultez la section Premiers pas avec Google Maps Platform.
Quotas et tarifs
Consultez la page Utilisation et facturation pour en savoir plus sur les quotas et les tarifs définis pour l'API Geocoding.
Règles
L'utilisation de l'API Geocoding doit être conforme aux Règles de l'API.
Le
guide du développeur de l'API Geocoding décrit le service Web de l'API Geocoding. Il est destiné aux développeurs de sites Web et mobiles qui souhaitent utiliser des données de géocodage dans les cartes fournies par l'une des API Google Maps Platform.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/31 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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."]]