forecast.days एंडपॉइंट, किसी जगह के लिए अगले 10 दिनों के मौसम के पूर्वानुमान की जानकारी दिखाता है. यह जानकारी, मौजूदा दिन से शुरू होती है. एपीआई से यह जानकारी मिलती है:
- दिन के समय (सुबह 7:00 बजे से शाम 7:00 बजे) और रात के समय (शाम 7:00 बजे से सुबह 7:00 बजे) के मौसम की जानकारी के साथ-साथ, उससे जुड़े आइकॉन
- हर दिन का सबसे ज़्यादा और सबसे कम तापमान
- दिन के लिए, महसूस होने वाला ज़्यादा से ज़्यादा और कम से कम तापमान
- हीट इंडेक्स
- संबंधित आर्द्रता
- यूवी इंडेक्स
- बारिश या बर्फ़बारी वगैरह होने की संभावना, प्रतिशत, मात्रा, और टाइप
- गरज के साथ तूफ़ान आने की संभावना
- समुद्र के लेवल पर दबाव
- ठंडी हवा
- हवा की दिशा, रफ़्तार, और झोंका
- बर्फ़ की मोटाई
- विज़िबिलिटी और बादल
- हर दिन का सूर्योदय, सूर्यास्त, चांद निकलने, और चांद के डूबने का समय
रोज़ के अनुमान के अनुरोधों के बारे में जानकारी
मौजूदा स्थिति का अनुरोध करने के लिए, यहां दिए गए पते पर एचटीटीपी GET अनुरोध भेजें:
https://weather.googleapis.com/v1/forecast/days:lookup?key=YOUR_API_KEY &location.latitude=LATITUDE &location.longitude=LONGITUDE
अपने अनुरोध के यूआरएल के पैरामीटर में, जगह के अक्षांश और देशांतर के निर्देशांक शामिल करें.
रोज़ के अनुमान के अनुरोध के उदाहरण
डिफ़ॉल्ट रूप से, forecast.days एंडपॉइंट, मौजूदा घंटे से शुरू होकर 10 दिनों का डेटा दिखाता है. days
पैरामीटर का इस्तेमाल करके, अपने अनुरोध को कुछ दिनों के लिए सीमित किया जा सकता है.
इस उदाहरण में, कैलिफ़ोर्निया के माउंटेन व्यू के लिए, अगले दो दिनों के लिए हर दिन के मौसम के पूर्वानुमान की जानकारी का अनुरोध किया गया है:
curl -X GET "https://weather.googleapis.com/v1/forecast/days:lookup?key=YOUR_API_KEY &location.latitude=37.4220 &location.longitude=-122.0841 &days=2"
जवाब में, interval
ऑब्जेक्ट से हर दिन की जानकारी का पता चलता है:
{ "forecastDays": [ { "interval": { "startTime": "2025-02-10T15:00:00Z", "endTime": "2025-02-11T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 10 }, "daytimeForecast": { "interval": { "startTime": "2025-02-10T15:00:00Z", "endTime": "2025-02-11T03:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/party_cloudy", "description": { "text": "Partly sunny", "languageCode": "en" }, "type": "PARTLY_CLOUDY" }, "relativeHumidity": 54, "uvIndex": 3, "precipitation": { "probability": { "percent": 5, "type": "RAIN" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "wind": { "direction": { "degrees": 280, "cardinal": "WEST" }, "speed": { "value": 6, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 14, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 53 }, "nighttimeForecast": { "interval": { "startTime": "2025-02-11T03:00:00Z", "endTime": "2025-02-11T15:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/partly_clear", "description": { "text": "Partly cloudy", "languageCode": "en" }, "type": "PARTLY_CLOUDY" }, "relativeHumidity": 85, "uvIndex": 0, "precipitation": { "probability": { "percent": 10, "type": "RAIN_AND_SNOW" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "wind": { "direction": { "degrees": 201, "cardinal": "SOUTH_SOUTHWEST" }, "speed": { "value": 6, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 14, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 70 }, "maxTemperature": { "degrees": 13.3, "unit": "CELSIUS" }, "minTemperature": { "degrees": 1.5, "unit": "CELSIUS" }, "feelsLikeMaxTemperature": { "degrees": 13.3, "unit": "CELSIUS" }, "feelsLikeMinTemperature": { "degrees": 1.5, "unit": "CELSIUS" }, "sunEvents": { "sunriseTime": "2025-02-10T15:02:35.703929582Z", "sunsetTime": "2025-02-11T01:43:00.762932858Z" }, "moonEvents": { "moonPhase": "WAXING_GIBBOUS", "moonriseTimes": [ "2025-02-10T23:54:17.713157984Z" ], "moonsetTimes": [ "2025-02-10T14:13:58.625181191Z" ] }, "maxHeatIndex": { "degrees": 13.3, "unit": "CELSIUS" }, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-11T15:00:00Z", "endTime": "2025-02-12T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 11 }, "daytimeForecast": { "interval": { "startTime": "2025-02-11T15:00:00Z", "endTime": "2025-02-12T03:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/scattered_showers", "description": { "text": "Scattered showers", "languageCode": "en" }, "type": "SCATTERED_SHOWERS" }, /.../ } } ], "timeZone": { "id": "America/Los_Angeles" } }
हर पेज पर सामान लौटाने के लिए, दिनों की संख्या बताएं
pageSize
यूआरएल पैरामीटर का इस्तेमाल करके, यह तय किया जा सकता है कि हर पेज के लिए कितने दिनों का डेटा दिखाना है. डिफ़ॉल्ट रूप से, हर पेज पर पांच दिनों के पूर्वानुमान की जानकारी दिखती है.
कई पेजों की जानकारी वाले जवाबों में nextPageToken
शामिल होता है. जानकारी का अगला पेज देखने के लिए, अपने अनुरोध में nextPageToken
वैल्यू को pageToken
पैरामीटर में पास करें.
इस उदाहरण में, माउंटेन व्यू, कैलिफ़ोर्निया के लिए छह दिन के मौसम के पूर्वानुमान का डेटा मांगा गया है. इसमें हर पेज पर तीन दिन का डेटा है:
curl -X GET "https://weather.googleapis.com/v1/forecast/days:lookup?key=YOUR_API_KEY &location.latitude=37.4220 &location.longitude=-122.0841 &days=6&pageSize=3"
जवाब में, पहले तीन दिनों का डेटा इस फ़ॉर्मैट में होता है:
{ "forecastDays": [ { "interval": { "startTime": "2025-02-10T15:00:00Z", "endTime": "2025-02-11T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 10 }, "daytimeForecast": { "interval": { "startTime": "2025-02-10T15:00:00Z", "endTime": "2025-02-11T03:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/party_cloudy", "description": { "text": "Partly sunny", "languageCode": "en" }, "type": "PARTLY_CLOUDY" }, "relativeHumidity": 52, "uvIndex": 3, "precipitation": { "probability": { "percent": 5, "type": "RAIN" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "wind": { "direction": { "degrees": 280, "cardinal": "WEST" }, "speed": { "value": 6, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 14, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 53 }, "nighttimeForecast": { "interval": { "startTime": "2025-02-11T03:00:00Z", "endTime": "2025-02-11T15:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/partly_clear", "description": { "text": "Partly cloudy", "languageCode": "en" }, "type": "PARTLY_CLOUDY" }, "relativeHumidity": 85, "uvIndex": 0, "precipitation": { "probability": { "percent": 10, "type": "RAIN_AND_SNOW" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "wind": { "direction": { "degrees": 201, "cardinal": "SOUTH_SOUTHWEST" }, "speed": { "value": 6, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 14, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 69 }, "maxTemperature": { "degrees": 13.5, "unit": "CELSIUS" }, "minTemperature": { "degrees": 1.5, "unit": "CELSIUS" }, "feelsLikeMaxTemperature": { "degrees": 13.5, "unit": "CELSIUS" }, "feelsLikeMinTemperature": { "degrees": 1.5, "unit": "CELSIUS" }, "sunEvents": { "sunriseTime": "2025-02-10T15:02:35.703929582Z", "sunsetTime": "2025-02-11T01:43:00.762932858Z" }, "moonEvents": { "moonPhase": "WAXING_GIBBOUS", "moonriseTimes": [ "2025-02-10T23:54:17.713157984Z" ], "moonsetTimes": [ "2025-02-10T14:13:58.625181191Z" ] }, "maxHeatIndex": { "degrees": 13.5, "unit": "CELSIUS" }, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-11T15:00:00Z", "endTime": "2025-02-12T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 11 }, /.../ }, { "interval": { "startTime": "2025-02-12T15:00:00Z", "endTime": "2025-02-13T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 12 }, /.../ } ], "timeZone": { "id": "America/Los_Angeles" }, "nextPageToken": "ChYKEgm8dJMYBLZCQBH-ZffkYYVewBAGEAMYAyILCKyAqr0GEKOR6lUqE0FtZXJpY2EvTG9zX0FuZ2VsZXM=" }
डेटा का अगला पेज ऐक्सेस करने के लिए, अपने अनुरोध में pageToken
पैरामीटर में nextPageToken
वैल्यू पास करें:
curl -X GET "https://weather.googleapis.com/v1/forecast/days:lookup?key=YOUR_API_KEY &location.latitude=37.4220 &location.longitude=-122.0841 &days=6 &pageSize=3 &pageToken=ChYKEgm8dJMYBLZCQBH-ZffkYYVewBAGEAMYAyILCKyAqr0GEKOR6lUqE0FtZXJpY2EvTG9zX0FuZ2VsZXM="
जवाब इस फ़ॉर्मैट में है:
{ "forecastDays": [ { "interval": { "startTime": "2025-02-13T15:00:00Z", "endTime": "2025-02-14T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 13 }, "daytimeForecast": { "interval": { "startTime": "2025-02-13T15:00:00Z", "endTime": "2025-02-14T03:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/drizzle", "description": { "text": "Light rain", "languageCode": "en" }, "type": "LIGHT_RAIN" }, "relativeHumidity": 81, "uvIndex": 2, "precipitation": { "probability": { "percent": 75, "type": "RAIN" }, "qpf": { "quantity": 15.588, "unit": "MILLIMETERS" } }, "thunderstormProbability": 20, "wind": { "direction": { "degrees": 181, "cardinal": "SOUTH" }, "speed": { "value": 14, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 32, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 100 }, "nighttimeForecast": { "interval": { "startTime": "2025-02-14T03:00:00Z", "endTime": "2025-02-14T15:00:00Z" }, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/showers", "description": { "text": "Rain showers", "languageCode": "en" }, "type": "RAIN_SHOWERS" }, "relativeHumidity": 87, "uvIndex": 0, "precipitation": { "probability": { "percent": 75, "type": "RAIN" }, "qpf": { "quantity": 11.3513, "unit": "MILLIMETERS" } }, "thunderstormProbability": 10, "wind": { "direction": { "degrees": 222, "cardinal": "SOUTHWEST" }, "speed": { "value": 14, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 31, "unit": "KILOMETERS_PER_HOUR" } }, "cloudCover": 95 }, "maxTemperature": { "degrees": 15.9, "unit": "CELSIUS" }, "minTemperature": { "degrees": 11.2, "unit": "CELSIUS" }, "feelsLikeMaxTemperature": { "degrees": 15.9, "unit": "CELSIUS" }, "feelsLikeMinTemperature": { "degrees": 11, "unit": "CELSIUS" }, "sunEvents": { "sunriseTime": "2025-02-13T14:59:17.439839464Z", "sunsetTime": "2025-02-14T01:46:14.345904643Z" }, "moonEvents": { "moonPhase": "WANING_GIBBOUS", "moonriseTimes": [ "2025-02-14T03:08:04.049988754Z" ], "moonsetTimes": [ "2025-02-13T15:44:40.326916694Z" ] }, "maxHeatIndex": { "degrees": 15.9, "unit": "CELSIUS" }, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-14T15:00:00Z", "endTime": "2025-02-15T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 14 }, /.../ }, { "interval": { "startTime": "2025-02-15T15:00:00Z", "endTime": "2025-02-16T15:00:00Z" }, "displayDate": { "year": 2025, "month": 2, "day": 15 }, /.../ } ], "timeZone": { "id": "America/Los_Angeles" } }