Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Le point de terminaison currentConditions fournit des informations horaires actuelles sur la qualité de l'air. Vous pouvez contrôler les indices de qualité de l'air et les informations pertinentes qui sont renvoyés (comme le niveau de concentration des polluants et les recommandations de santé).
Vous pouvez demander la qualité de l'air horaire actuelle à l'aide du point de terminaison currentConditions en envoyant une requête HTTP POST à l'adresse suivante :
Incluez les options de votre requête dans le corps de la requête JSON.
Le corps de la requête contient le lieu pour lequel vous souhaitez obtenir les conditions actuelles de qualité de l'air, ainsi que diverses options permettant de contrôler les informations sur la qualité de l'air à inclure dans la réponse.
APIs Explorer vous permet d'envoyer des requêtes en direct pour vous familiariser avec l'API et ses options :
Le code suivant montre comment créer un corps de requête de base pour une requête currentConditions. Dans cet exemple, vous ne définissez que l'emplacement.
L'appel ci-dessus génère la réponse JSON suivante.
Pour en savoir plus sur les données de réponse, consultez Données de réponse.
{"dateTime":"2023-10-26T18:00:00Z","regionCode":"us","indexes":[{"code":"uaqi","displayName":"Universal AQI","aqi":52,"aqiDisplay":"52","color":{"red":0.9490196,"green":0.98039216,"blue":0.019607844},"category":"Moderate air quality","dominantPollutant":"no2"}]}
Exemple de requête avec plusieurs paramètres
Demande avec plusieurs paramètres
Le code suivant montre comment créer un corps de requête pour une requête currentConditions.
Dans cet exemple, en plus de la position, plusieurs calculs supplémentaires et la langue de la réponse sont spécifiés.
L'appel ci-dessus génère la réponse JSON suivante.
Pour en savoir plus sur les données de réponse, consultez Données de réponse.
{"dateTime":"2023-06-15T10:00:00Z","regionCode":"us","indexes":[{"code":"uaqi","displayName":"Universal AQI","aqi":89,"aqiDisplay":"89","color":{"red":48,"green":175,"blue":55,"alpha":255},"category":"Excellent air quality","dominantPollutant":"o3"},{"code":"usa_epa","displayName":"AQI (US)","aqi":41,"aqiDisplay":"41","color":{"green":228,"alpha":255},"category":"Good air quality","dominantPollutant":"pm25"}],"pollutants":[{"code":"co","displayName":"CO","fullName":"Carbon monoxide","concentration":{"value":334.24,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"Typically originates from incomplete combustion...","effects":"When inhaled, carbon monoxide can prevent the blood from..."}},{"code":"no2","displayName":"NO2","fullName":"Nitrogen dioxide","concentration":{"value":13.12,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"Main sources are fuel burning processes, such as...","effects":"Exposure may cause increased bronchial reactivity..."}},{"code":"o3","displayName":"O3","fullName":"Ozone","concentration":{"value":13.88,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"Ozone is created in a chemical reaction between atmospheric oxygen...","effects":"Ozone can irritate the airways and cause coughing, a burning..."}},{"code":"pm10","displayName":"PM10","fullName":"Inhalable particulate matter (<10µm)","concentration":{"value":5.07,"units":"MICROGRAMS_PER_CUBIC_METER"},"additionalInfo":{"sources":"Main sources are combustion processes (e.g. indoor heating, wildfires)...","effects":"Inhalable particles can penetrate into the lungs. Short term exposure..."}},{"code":"pm25","displayName":"PM2.5","fullName":"Fine particulate matter (<2.5µm)","concentration":{"value":2.83,"units":"MICROGRAMS_PER_CUBIC_METER"},"additionalInfo":{"sources":"Main sources are combustion processes (e.g. power plants, indoor heating...","effects":"Fine particles can penetrate into the lungs and bloodstream. Short term..."}},{"code":"so2","displayName":"SO2","fullName":"Sulfur dioxide","concentration":{"value":0.02,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"Main sources are burning processes of sulfur-containing fuel in industry...","effects":"Exposure causes irritation of the respiratory tract, coughing and generates..."}}],"healthRecommendations":{"generalPopulation":"With this level of air quality, you have no limitations. Enjoy the outdoors!","elderly":"If you start to feel respiratory discomfort such as coughing or breathing difficulties...","lungDiseasePopulation":"...","heartDiseasePopulation":"...","athletes":"...","pregnantWomen":"...","children":"..."}}
Essayer
APIs Explorer vous permet d'effectuer des exemples de requêtes pour vous familiariser avec l'API et ses options.
Sélectionnez l'icône API api à droite de la page.
Vous pouvez également modifier les paramètres de la requête.
Sélectionnez le bouton Exécuter. Dans la boîte de dialogue, sélectionnez le compte que vous souhaitez utiliser pour envoyer la demande.
Dans le panneau APIs Explorer, sélectionnez l'icône plein écran fullscreen pour développer la fenêtre APIs Explorer.
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).
[null,null,["Dernière mise à jour le 2025/08/31 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003ecurrentConditions\u003c/code\u003e endpoint provides access to hourly air quality data, including AQI, pollutant concentrations, and health recommendations.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the response to include specific AQIs and extra computations like health recommendations and dominant pollutant information.\u003c/p\u003e\n"],["\u003cp\u003eRequests are made via HTTP POST to the endpoint URL with an API key and a JSON request body containing location and optional parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides current air quality information for the specified location, including relevant AQIs, pollutant concentrations, and optional health recommendations.\u003c/p\u003e\n"]]],["The `currentConditions` endpoint provides hourly air quality data. To use it, send an HTTP POST request to `https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY`, including a JSON request body with the desired location. You can specify various options like AQIs, pollutant levels, health recommendations, and language. The response contains current conditions, indexes, pollutants details, and health advice. You can modify your request to get more specific information. The API Explorer allows testing the requests.\n"],null,["The [`currentConditions`](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup) endpoint\nprovides current hourly air quality information. You can control which AQIs and\npertinent information are returned (such as pollutants concentration level and\nhealth recommendations).\n\nYou can request current hourly air quality using the\n[`currentConditions`](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup)\nendpoint by sending an HTTP POST request to: \n\n```html\nhttps://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY\n```\n\nInclude your request options in the JSON\n[request body](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup#request-body).\nThe request body contains the location for which you would like to get the air\nquality current conditions and various options to control what air quality\ninformation to include in the response.\n\nThe APIs Explorer lets you make live requests so that you can get familiar with\nthe API and the API options: \n[Try it!](#try_it)\n\nExample of basic request\n\nBasic request body\n\nThe following code shows how to construct a basic request body for a\n[`currentConditions`](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup)\nrequest. In this example, you set only the location. \n\n```bash\ncurl -X POST -d '{\n \"location\": {\n \"latitude\": 37.419734,\n \"longitude\": -122.0827784\n }\n}' \\\n-H 'Content-Type: application/json' \\\n'https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY'\n```\n\nBasic request response\n\nThe call above generates the following\n[JSON response](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup#response-body).\nFor more details about the response data, see [Response data](/maps/documentation/air-quality/response-data).\n**Note:** By default, the response includes the Universal AQI with the basic AQI information. The AQI can be removed or replaced with a different AQI by setting the corresponding parameters. \n\n```json\n{\n \"dateTime\": \"2023-10-26T18:00:00Z\",\n \"regionCode\": \"us\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 52,\n \"aqiDisplay\": \"52\",\n \"color\": {\n \"red\": 0.9490196,\n \"green\": 0.98039216,\n \"blue\": 0.019607844\n },\n \"category\": \"Moderate air quality\",\n \"dominantPollutant\": \"no2\"\n }\n ]\n}\n```\n| **Note:** If a `color` field value is `0`, that field is omitted from the response.\n\nExample of request with multiple parameters\n\nMultiple parameters request\n\nThe following code shows how to construct a request body for a\n[`currentConditions`](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup) request.\nIn this example, in addition to the location, several extra computations and\nthe response language are specified. \n\n```bash\ncurl -X POST -d '{\n \"universalAqi\": true,\n \"location\": {\n \"latitude\": 37.419734,\n \"longitude\": -122.0827784\n },\n \"extraComputations\": [\n \"HEALTH_RECOMMENDATIONS\",\n \"DOMINANT_POLLUTANT_CONCENTRATION\",\n \"POLLUTANT_CONCENTRATION\",\n \"LOCAL_AQI\",\n \"POLLUTANT_ADDITIONAL_INFO\"\n ],\n \"languageCode\": \"en\"\n}' \\\n-H 'Content-Type: application/json' \\\n'https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY'\n```\n\nMultiple parameters response\n\nThe call above generates the following\n[JSON response](/maps/documentation/air-quality/reference/rest/v1/currentConditions/lookup#response-body).\nFor more details about the response data, see [Response data](/maps/documentation/air-quality/response-data). \n\n```json\n{\n \"dateTime\": \"2023-06-15T10:00:00Z\",\n \"regionCode\": \"us\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 89,\n \"aqiDisplay\": \"89\",\n \"color\": {\n \"red\": 48,\n \"green\": 175,\n \"blue\": 55,\n \"alpha\": 255\n },\n \"category\": \"Excellent air quality\",\n \"dominantPollutant\": \"o3\"\n },\n {\n \"code\": \"usa_epa\",\n \"displayName\": \"AQI (US)\",\n \"aqi\": 41,\n \"aqiDisplay\": \"41\",\n \"color\": {\n \"green\": 228,\n \"alpha\": 255\n },\n \"category\": \"Good air quality\",\n \"dominantPollutant\": \"pm25\"\n }\n ],\n \"pollutants\": [\n {\n \"code\": \"co\",\n \"displayName\": \"CO\",\n \"fullName\": \"Carbon monoxide\",\n \"concentration\": {\n \"value\": 334.24,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"Typically originates from incomplete combustion...\",\n \"effects\": \"When inhaled, carbon monoxide can prevent the blood from...\"\n }\n },\n {\n \"code\": \"no2\",\n \"displayName\": \"NO2\",\n \"fullName\": \"Nitrogen dioxide\",\n \"concentration\": {\n \"value\": 13.12,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"Main sources are fuel burning processes, such as...\",\n \"effects\": \"Exposure may cause increased bronchial reactivity...\"\n }\n },\n {\n \"code\": \"o3\",\n \"displayName\": \"O3\",\n \"fullName\": \"Ozone\",\n \"concentration\": {\n \"value\": 13.88,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"Ozone is created in a chemical reaction between atmospheric oxygen...\",\n \"effects\": \"Ozone can irritate the airways and cause coughing, a burning...\"\n }\n },\n {\n \"code\": \"pm10\",\n \"displayName\": \"PM10\",\n \"fullName\": \"Inhalable particulate matter (\u003c10µm)\",\n \"concentration\": {\n \"value\": 5.07,\n \"units\": \"MICROGRAMS_PER_CUBIC_METER\"\n },\n \"additionalInfo\": {\n \"sources\": \"Main sources are combustion processes (e.g. indoor heating, wildfires)...\",\n \"effects\": \"Inhalable particles can penetrate into the lungs. Short term exposure...\"\n }\n },\n {\n \"code\": \"pm25\",\n \"displayName\": \"PM2.5\",\n \"fullName\": \"Fine particulate matter (\u003c2.5µm)\",\n \"concentration\": {\n \"value\": 2.83,\n \"units\": \"MICROGRAMS_PER_CUBIC_METER\"\n },\n \"additionalInfo\": {\n \"sources\": \"Main sources are combustion processes (e.g. power plants, indoor heating...\",\n \"effects\": \"Fine particles can penetrate into the lungs and bloodstream. Short term...\"\n }\n },\n {\n \"code\": \"so2\",\n \"displayName\": \"SO2\",\n \"fullName\": \"Sulfur dioxide\",\n \"concentration\": {\n \"value\": 0.02,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"Main sources are burning processes of sulfur-containing fuel in industry...\",\n \"effects\": \"Exposure causes irritation of the respiratory tract, coughing and generates...\"\n }\n }\n ],\n \"healthRecommendations\": {\n \"generalPopulation\": \"With this level of air quality, you have no limitations. Enjoy the outdoors!\",\n \"elderly\": \"If you start to feel respiratory discomfort such as coughing or breathing difficulties...\",\n \"lungDiseasePopulation\": \"...\",\n \"heartDiseasePopulation\": \"...\",\n \"athletes\": \"...\",\n \"pregnantWomen\": \"...\",\n \"children\": \"...\"\n }\n}\n```\n\nTry it!\n\nThe APIs Explorer lets you make sample requests so\nthat you can get familiar with the API and the API options.\n\n1. Select the API icon api\n on the right side of the page.\n\n2. Optionally edit the request parameters.\n\n3. Select the **Execute** button. In the dialog, choose the account\n that you want to use to make the request.\n\n4. In the APIs Explorer panel, select the fullscreen icon\n fullscreen to expand the APIs Explorer window."]]