קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
נקודת הקצה forecast מספקת תחזית של איכות האוויר במיקום מסוים, עד 96 שעות (4 ימים) קדימה, לפי שעה. כל תחזית כוללת מדדי איכות אוויר לפי שעה וגם מידע נוסף:
שעה ותאריך ספציפיים או פרק זמן לתחזית
קוד השפה של השדות המתורגמים
מדד איכות אוויר (AQI) מקומי או מותאם אישית
המלצות בנושאי בריאות
מזהמים דומיננטיים
ריכוז חומרים מזהמים
מידע נוסף על מזהמים
גודל דף התגובה
לוח צבעים
APIs 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"}
רוצה לנסות?
באמצעות APIs Explorer אפשר לשלוח בקשות לדוגמה כדי להכיר את ה-API ואת האפשרויות שלו.
לוחצים על סמל ה-API api בצד שמאל של הדף.
אפשר לערוך את פרמטרים הבקשה.
לוחצים על הלחצן Execute (הפעלה). בתיבת הדו-שיח, בוחרים את החשבון שרוצים להשתמש בו כדי לשלוח את הבקשה.
בחלונית APIs Explorer, בוחרים בסמל המסך המלא
מסך מלא כדי להרחיב את החלון של APIs Explorer.
[null,null,["עדכון אחרון: 2025-08-31 (שעון 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."]]