Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
forecast предоставляет информацию о почасовом прогнозе качества воздуха для заданного местоположения на срок до 96 часов (4 дня). Каждый прогноз включает почасовые индексы качества воздуха, а также дополнительную информацию:
Конкретное время и дата или период времени для прогноза
Код языка для переведенных полей
Местный или пользовательский индекс качества воздуха (AQI)
Рекомендации по здоровью
Доминирующие загрязняющие вещества
Концентрация загрязняющих веществ
Дополнительная информация о загрязняющих веществах
Размер страницы ответа
Цветовая палитра
API Explorer позволяет вам делать живые запросы, чтобы вы могли ознакомиться с API и его параметрами:
Включите параметры в тело запроса. В теле запроса указывается местоположение, для которого вы хотите получить почасовой прогноз качества воздуха, а также различные параметры для управления дополнительной информацией, которую следует включить в ответ.
О прогнозируемых ответах
В тексте ответа указываются дата и время UTC, на которые следует отображать прогноз качества воздуха, индексы качества воздуха и дополнительную персонализированную информацию. В тексте ответа также содержится токен для загрузки следующей страницы, если информация не помещается в запрошенный размер страницы.
Пример базового запроса
Следующий код показывает, как создать запрос на прогноз. В этом примере вы указываете местоположение, дату и время (начиная со следующего часа и до 96 часов), для которых требуется отображать почасовой прогноз качества воздуха.
{"hourlyForecasts":[{"dateTime":"2024-02-09T08:00:00Z","indexes":[{"code":"uaqi","displayName":"Universal AQI","aqi":80,"aqiDisplay":"80","color":{"red":0.34509805,"green":0.74509805,"blue":0.20784314},"category":"Excellent air quality","dominantPollutant":"pm25"}]}],"regionCode":"us"}
Пример запроса с несколькими параметрами
Следующий код показывает, как создать тело запроса с несколькими параметрами. В этом примере вы указываете следующее:
Расположение
Период времени, для которого следует отображать информацию о прогнозе качества воздуха
Код языка
Дополнительные вычисления (такие как рекомендации по здоровью, доминирующая концентрация загрязняющих веществ и дополнительная информация о загрязняющих веществах)
Это возвращает следующую страницу прогнозной информации:
{"hourlyForecasts":[{"dateTime":"2024-02-27T21:00:00Z","indexes":[{"code":"uaqi","displayName":"Universal AQI","aqi":74,"aqiDisplay":"74","color":{"red":0.44705883,"green":0.78431374,"blue":0.2},"category":"Good air quality","dominantPollutant":"o3"}],"pollutants":[{"code":"o3","displayName":"O3","fullName":"Ozone","concentration":{"value":32.07,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"...","effects":"..."}}],"healthRecommendations":{"generalPopulation":"...","elderly":"...","lungDiseasePopulation":"...","heartDiseasePopulation":"...","athletes":"...","pregnantWomen":"...","children":"..."}},{"dateTime":"2024-02-27T22:00:00Z","indexes":[{"code":"uaqi","displayName":"Universal AQI","aqi":75,"aqiDisplay":"75","color":{"red":0.43137255,"green":0.7764706,"blue":0.20392157},"category":"Good air quality","dominantPollutant":"o3"}],"pollutants":[{"code":"o3","displayName":"O3","fullName":"Ozone","concentration":{"value":30.94,"units":"PARTS_PER_BILLION"},"additionalInfo":{"sources":"...","effects":"..."}}],"healthRecommendations":{"generalPopulation":"...","lungDiseasePopulation":"...","heartDiseasePopulation":"...","athletes":"...","pregnantWomen":"...","children":"..."}},/.../]"regionCode":"us"}
Попробуйте!
API Explorer позволяет вам делать образцы запросов, чтобы вы могли ознакомиться с API и его параметрами.
Выберите значок API api на правой стороне страницы.
При желании отредактируйте параметры запроса.
Нажмите кнопку «Выполнить» . В диалоговом окне выберите учётную запись, которую вы хотите использовать для отправки запроса.
На панели обозревателя API выберите значок полноэкранного режима, чтобы развернуть окно обозревателя API.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-08-29 UTC."],[[["\u003cp\u003eThe Air Quality API's forecast endpoint provides hourly air quality forecasts for up to 96 hours (4 days) for a specified location.\u003c/p\u003e\n"],["\u003cp\u003eForecast data includes air quality indexes, dominant pollutants, health recommendations, pollutant concentrations, and more.\u003c/p\u003e\n"],["\u003cp\u003eRequests are made via HTTP POST to the endpoint with parameters specifying location, time, and optional data inclusions.\u003c/p\u003e\n"],["\u003cp\u003eResponses contain hourly forecast data, potentially paginated, with a token for retrieving subsequent pages if necessary.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize requests to include specific language codes, color palettes, and additional computations for a tailored response.\u003c/p\u003e\n"]]],[],null,["The [`forecast`](/maps/documentation/air-quality/reference/rest/v1/forecast/lookup) endpoint\nprovides up to 96 hours (4 days) of hourly air\nquality forecast information for a given location. Each forecast includes hourly\nair quality indexes as well as additional information:\n\n- Specific time and date or time period for forecast\n- Language code for translated fields\n- Local or custom air quality index (AQI)\n- Health recommendations\n- Dominant pollutants\n- Pollutant concentration\n- Additional information about pollutants\n- Response page size\n- Color palette\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| To get air quality forecasts, set the `dateTime` parameter to a future date and time, as shown in the [basic\n| request example](/maps/documentation/air-quality/forecast#example_of_basic_request) below.\n\nAbout forecast requests\n\nYou can request hourly air quality forecast information using the\nforecast endpoint by sending an HTTP POST request to: \n\n```html\nhttps://airquality.googleapis.com/v1/forecast:lookup?key=YOUR_API_KEY\n```\n\nInclude your\n[parameters](/maps/documentation/air-quality/reference/rest/v1/forecast/lookup#request-body)\nin the request body. The request body contains the location for which you would\nlike to get air quality hourly forecast information and various options to\ncontrol what additional information to include in the response.\n\nAbout forecast responses\n\nThe response body provides the UTC date and time for which to display air\nquality forecast information, air quality indexes, and additional customized\ninformation. The response body also includes a token to retrieve the next page\nif the information does not fit within the requested page size.\n\nExample of basic request\n\nThe following code shows how to construct a forecast request. In this example,\nyou specify the location, date and time (beginning from the next hour up to 96\nhours) for which to show hourly air quality forecast information. \n\n```bash\ncurl -X POST -d '{\n \"location\": {\n \"latitude\": 37.4125333,\n \"longitude\": -122.0840937\n },\n \"dateTime\": \"2024-02-09T08:00:00Z\"\n}' \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept-Language: *\" \\\n\"https://airquality.googleapis.com/v1/forecast:lookup?key=YOUR_API_KEY\"\n```\n\nThe call generates the following JSON response. \n\n```json\n{\n \"hourlyForecasts\": [\n {\n \"dateTime\": \"2024-02-09T08:00:00Z\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 80,\n \"aqiDisplay\": \"80\",\n \"color\": {\n \"red\": 0.34509805,\n \"green\": 0.74509805,\n \"blue\": 0.20784314\n },\n \"category\": \"Excellent air quality\",\n \"dominantPollutant\": \"pm25\"\n }\n ]\n }\n ],\n \"regionCode\": \"us\"\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\nThe following code shows how to construct a request body with multiple\nparameters. In this example, you specify the following:\n\n- Location\n- Time period for which to display air quality forecast information\n- Language code\n- Extra computations (such as health recommendations, the dominant pollutant concentration, and additional pollutant information)\n- Color palette\n\n```bash\ncurl -X POST -d '{\n \"pageSize\": \"10\",\n \"universalAqi\": \"true\",\n \"location\": {\n \"latitude\": \"40.741895\",\n \"longitude\": \"-73.989308\"\n },\n \"period\": {\n \"startTime\": \"2024-02-27T13:58:14+02:00\",\n \"endTime\": \"2024-02-28T16:58:14+02:00\"\n },\n \"languageCode\": \"en\",\n \"extraComputations\": [\n \"HEALTH_RECOMMENDATIONS\",\n \"DOMINANT_POLLUTANT_CONCENTRATION\",\n \"POLLUTANT_ADDITIONAL_INFO\"\n ],\n \"uaqiColorPalette\": \"RED_GREEN\"\n}' \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept-Language: *\" \\\n\"https://airquality.googleapis.com/v1/forecast:lookup?key=YOUR_API_KEY\"\n```\n\nThe call generates the following JSON response. \n\n```json\n{\n {\n \"hourlyForecasts\": [\n {\n \"dateTime\": \"2024-02-27T11:00:00Z\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 75,\n \"aqiDisplay\": \"75\",\n \"color\": {\n \"red\": 0.43137255,\n \"green\": 0.7764706,\n \"blue\": 0.20392157\n },\n \"category\": \"Good air quality\",\n \"dominantPollutant\": \"pm25\"\n }\n ],\n \"pollutants\": [\n {\n \"code\": \"pm25\",\n \"displayName\": \"PM2.5\",\n \"fullName\": \"Fine particulate matter (\\u003c2.5µm)\",\n \"concentration\": {\n \"value\": 15.1,\n \"units\": \"MICROGRAMS_PER_CUBIC_METER\"\n },\n \"additionalInfo\": {\n \"sources\": \"...\",\n \"effects\": \"...\"\n }\n }\n ],\n \"healthRecommendations\": {\n \"generalPopulation\": \"...\",\n \"lungDiseasePopulation\": \"...\",\n \"heartDiseasePopulation\": \"...\",\n \"athletes\": \"...\",\n \"pregnantWomen\": \"...\"\n }\n },\n {\n \"dateTime\": \"2024-02-27T12:00:00Z\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 67,\n \"aqiDisplay\": \"67\",\n \"color\": {\n \"red\": 0.5882353,\n \"green\": 0.8392157,\n \"blue\": 0.16862746\n },\n \"category\": \"Good air quality\",\n \"dominantPollutant\": \"pm25\"\n }\n ],\n \"pollutants\": [\n {\n \"code\": \"pm25\",\n \"displayName\": \"PM2.5\",\n \"fullName\": \"Fine particulate matter (\\u003c2.5µm)\",\n \"concentration\": {\n \"value\": 19.96,\n \"units\": \"MICROGRAMS_PER_CUBIC_METER\"\n },\n \"additionalInfo\": {\n \"sources\": \"...\",\n \"effects\": \"...\"\n }\n }\n ],\n \"healthRecommendations\": {\n \"generalPopulation\": \"...\",\n \"lungDiseasePopulation\": \"...\",\n \"heartDiseasePopulation\": \"...\",\n \"athletes\": \"...\",\n \"pregnantWomen\": \"...\",\n \"children\": \"...\"\n }\n },\n /.../\n ]\n }\n \"regionCode\": \"us\",\n \"nextPageToken\": \"CjMKEglwCFVq9l5EQBH0aoDSUH9SwBoQCgYI1pDirgYSBgiGiOiuBiABKgMCBAMyAmVuOAEQGA==\"\n}\n```\n\nTo view the next page of forecast information, pass in the `nextPageToken`\nreturned at the end of the response body: \n\n```bash\ncurl -X POST -d '{\n \"universalAqi\": \"true\",\n \"location\": {\n \"latitude\": \"40.741895\",\n \"longitude\": \"-73.989308\"\n },\n \"period\": {\n \"startTime\": \"2024-02-27T13:58:14+02:00\",\n \"endTime\": \"2024-02-28T16:58:14+02:00\"\n },\n \"languageCode\": \"en\",\n \"extraComputations\": [\n \"HEALTH_RECOMMENDATIONS\",\n \"DOMINANT_POLLUTANT_CONCENTRATION\",\n \"POLLUTANT_ADDITIONAL_INFO\"\n ],\n \"uaqiColorPalette\": \"RED_GREEN\",\n \"pageToken\": \"CjMKEglwCFVq9l5EQBH0aoDSUH9SwBoQCgYI1pDirgYSBgiGiOiuBiABKgMCBAMyAmVuOAEQGA==\"\n}' \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept-Language: *\" \\\n\"https://airquality.googleapis.com/v1/forecast:lookup?key=YOUR_API_KEY\"\n```\n\nThis returns the next page of forecast information: \n\n```json\n{\n \"hourlyForecasts\": [\n {\n \"dateTime\": \"2024-02-27T21:00:00Z\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 74,\n \"aqiDisplay\": \"74\",\n \"color\": {\n \"red\": 0.44705883,\n \"green\": 0.78431374,\n \"blue\": 0.2\n },\n \"category\": \"Good air quality\",\n \"dominantPollutant\": \"o3\"\n }\n ],\n \"pollutants\": [\n {\n \"code\": \"o3\",\n \"displayName\": \"O3\",\n \"fullName\": \"Ozone\",\n \"concentration\": {\n \"value\": 32.07,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"...\",\n \"effects\": \"...\"\n }\n }\n ],\n \"healthRecommendations\": {\n \"generalPopulation\": \"...\",\n \"elderly\": \"...\",\n \"lungDiseasePopulation\": \"...\",\n \"heartDiseasePopulation\": \"...\",\n \"athletes\": \"...\",\n \"pregnantWomen\": \"...\",\n \"children\": \"...\"\n }\n },\n {\n \"dateTime\": \"2024-02-27T22:00:00Z\",\n \"indexes\": [\n {\n \"code\": \"uaqi\",\n \"displayName\": \"Universal AQI\",\n \"aqi\": 75,\n \"aqiDisplay\": \"75\",\n \"color\": {\n \"red\": 0.43137255,\n \"green\": 0.7764706,\n \"blue\": 0.20392157\n },\n \"category\": \"Good air quality\",\n \"dominantPollutant\": \"o3\"\n }\n ],\n \"pollutants\": [\n {\n \"code\": \"o3\",\n \"displayName\": \"O3\",\n \"fullName\": \"Ozone\",\n \"concentration\": {\n \"value\": 30.94,\n \"units\": \"PARTS_PER_BILLION\"\n },\n \"additionalInfo\": {\n \"sources\": \"...\",\n \"effects\": \"...\"\n }\n }\n ],\n \"healthRecommendations\": {\n \"generalPopulation\": \"...\",\n \"lungDiseasePopulation\": \"...\",\n \"heartDiseasePopulation\": \"...\",\n \"athletes\": \"...\",\n \"pregnantWomen\": \"...\",\n \"children\": \"...\"\n }\n },\n /.../\n ]\n \"regionCode\": \"us\"\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."]]