history.hours एंडपॉइंट, किसी जगह के लिए पिछले 24 घंटों का हर घंटे का मौसम का ऐतिहासिक डेटा दिखाता है. यह डेटा, पिछले घंटे से शुरू होता है. एपीआई, यह जानकारी दिखाता है:
- किसी दिए गए घंटे के लिए, मौसम की स्थितियों की जानकारी और उससे जुड़ा आइकॉन
- हर दिन का ज़्यादा से ज़्यादा और कम से कम तापमान
- हर दिन का ज़्यादा से ज़्यादा और कम से कम तापमान, जो असल में महसूस होता है
- ड्यू पॉइंट
- हीट इंडेक्स
- वेट बल्ब से लिया गया तापमान
- संबंधित आर्द्रता
- यूवी इंडेक्स
- बारिश या बर्फ़बारी वगैरह होने की संभावना, प्रतिशत, मात्रा, और टाइप
- आंधी-तूफ़ान आने की संभावना
- सी लेवल प्रेशर
- ठंडी हवाएं
- हवा की दिशा, रफ़्तार, और झोंका
- बर्फ़ की मोटाई
- विज़िबिलिटी और क्लाउड कवर
एपीआई एक्सप्लोरर की मदद से, लाइव अनुरोध किए जा सकते हैं. इससे आपको एपीआई और एपीआई के विकल्पों के बारे में जानकारी मिलती है:
हर घंटे के इतिहास के अनुरोधों के बारे में जानकारी
हर घंटे के इतिहास की जानकारी का अनुरोध करने के लिए, यह एचटीटीपी जीईटी अनुरोध भेजें:
https://weather.googleapis.com/v1/history/hours:lookup?key=YOUR_API_KEY&location.latitude=LATITUDE&location.longitude=LONGITUDE
अपने अनुरोध के यूआरएल पैरामीटर में, जगह के अक्षांश और देशांतर के कोऑर्डिनेट शामिल करें.
हर घंटे के इतिहास के अनुरोध के उदाहरण
डिफ़ॉल्ट रूप से, the
history.hours
एंडपॉइंट, मौसम के ऐतिहासिक डेटा के 24 घंटे दिखाता है. यह डेटा, पिछले
घंटे से शुरू होता है. hours पैरामीटर का इस्तेमाल करके, अपने अनुरोध को किसी खास समयावधि तक सीमित किया जा सकता है.
यहां दिए गए उदाहरण में, कैलिफ़ोर्निया के माउंटेन व्यू में पिछले तीन घंटों के हर घंटे के इतिहास की जानकारी का अनुरोध किया गया है:
curl -X GET "https://weather.googleapis.com/v1/history/hours:lookup?key=YOUR_API_KEY&location.latitude=37.4220 &location.longitude=-122.0841 &hours=3"
जवाब में, interval ऑब्जेक्ट, हर घंटे की जानकारी दिखाता है:
{ "historyHours": [ { "interval": { "startTime": "2025-02-12T22:00:00Z", "endTime": "2025-02-12T23:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 14, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, "temperature": { "degrees": 12.4, "unit": "CELSIUS" }, "feelsLikeTemperature": { "degrees": 12.4, "unit": "CELSIUS" }, "dewPoint": { "degrees": 6.1, "unit": "CELSIUS" }, "heatIndex": { "degrees": 12.4, "unit": "CELSIUS" }, "windChill": { "degrees": 12.4, "unit": "CELSIUS" }, "wetBulbTemperature": { "degrees": 9.1, "unit": "CELSIUS" }, "relativeHumidity": 65, "uvIndex": 1, "precipitation": { "probability": { "percent": 10, "type": "RAIN" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "airPressure": { "meanSeaLevelMillibars": 1010.4 }, "wind": { "direction": { "degrees": 135, "cardinal": "SOUTHEAST" }, "speed": { "value": 3, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 6, "unit": "KILOMETERS_PER_HOUR" } }, "visibility": { "distance": 16, "unit": "KILOMETERS" }, "cloudCover": 95, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-12T21:00:00Z", "endTime": "2025-02-12T22:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 13, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ }, { "interval": { "startTime": "2025-02-12T20:00:00Z", "endTime": "2025-02-12T21:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 12, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ } ], "timeZone": { "id": "America/Los_Angeles" } }
हर पेज पर दिखाए जाने वाले घंटों की संख्या तय करना
pageSize यूआरएल पैरामीटर का इस्तेमाल करके, हर पेज पर दिखाए जाने वाले डेटा के घंटों की संख्या तय की जा सकती है. डिफ़ॉल्ट रूप से, हर पेज पर मौसम के पूर्वानुमान की 24 घंटों की जानकारी दिखती है.
एक से ज़्यादा पेजों की जानकारी वाले जवाबों में, nextPageToken शामिल होता है. जानकारी का अगला पेज देखने के लिए, अपने अनुरोध में pageToken पैरामीटर में nextPageToken की वैल्यू पास करें.
यहां दिए गए उदाहरण में, कैलिफ़ोर्निया के माउंटेन व्यू के लिए, मौसम के पूर्वानुमान के आठ घंटों के डेटा का अनुरोध किया गया है. इसमें हर पेज पर पांच घंटों का डेटा दिखाया गया है:
curl -X GET "https://weather.googleapis.com/v1/history/hours:lookup?key=YOUR_API_KEY&location.latitude=37.4220 &location.longitude=-122.0841 &hours=8&pageSize=5"
जवाब में, पहले तीन घंटों का डेटा इस फ़ॉर्मैट में दिखता है:
{ "historyHours": [ { "interval": { "startTime": "2025-02-12T23:00:00Z", "endTime": "2025-02-13T00:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 15, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, "temperature": { "degrees": 11.6, "unit": "CELSIUS" }, "feelsLikeTemperature": { "degrees": 11.6, "unit": "CELSIUS" }, "dewPoint": { "degrees": 6.3, "unit": "CELSIUS" }, "heatIndex": { "degrees": 11.6, "unit": "CELSIUS" }, "windChill": { "degrees": 11.6, "unit": "CELSIUS" }, "wetBulbTemperature": { "degrees": 8.8, "unit": "CELSIUS" }, "relativeHumidity": 70, "uvIndex": 0, "precipitation": { "probability": { "percent": 10, "type": "RAIN" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "airPressure": { "meanSeaLevelMillibars": 1010.07 }, "wind": { "direction": { "degrees": 65, "cardinal": "EAST_NORTHEAST" }, "speed": { "value": 5, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 10, "unit": "KILOMETERS_PER_HOUR" } }, "visibility": { "distance": 16, "unit": "KILOMETERS" }, "cloudCover": 95, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-12T22:00:00Z", "endTime": "2025-02-12T23:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 14, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ }, { "interval": { "startTime": "2025-02-12T21:00:00Z", "endTime": "2025-02-12T22:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 13, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ }, { "interval": { "startTime": "2025-02-12T20:00:00Z", "endTime": "2025-02-12T21:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 12, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ }, { "interval": { "startTime": "2025-02-12T19:00:00Z", "endTime": "2025-02-12T20:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 11, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ } ], "timeZone": { "id": "America/Los_Angeles" }, "nextPageToken": "ChYKEgm8dJMYBLZCQL0xvc19BbmdlbGVz" }
डेटा का अगला पेज ऐक्सेस करने के लिए, अपने अनुरोध में pageToken पैरामीटर में nextPageToken की वैल्यू पास करें:
curl -X GET "https://weather.googleapis.com/v1/history/hours:lookup?key=YOUR_API_KEY&location.latitude=37.4220 &location.longitude=-122.0841 &hours=8 &pageSize=5 &pageToken=ChYKEgm8dJMYBLZCQL0xvc19BbmdlbGVz"
जवाब इस फ़ॉर्मैट में दिखता है:
{ "historyHours": [ { "interval": { "startTime": "2025-02-12T18:00:00Z", "endTime": "2025-02-12T19:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 10, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, "temperature": { "degrees": 8.9, "unit": "CELSIUS" }, "feelsLikeTemperature": { "degrees": 8.9, "unit": "CELSIUS" }, "dewPoint": { "degrees": 5.9, "unit": "CELSIUS" }, "heatIndex": { "degrees": 8.9, "unit": "CELSIUS" }, "windChill": { "degrees": 8.9, "unit": "CELSIUS" }, "wetBulbTemperature": { "degrees": 7.3, "unit": "CELSIUS" }, "relativeHumidity": 82, "uvIndex": 1, "precipitation": { "probability": { "percent": 10, "type": "RAIN" }, "qpf": { "quantity": 0, "unit": "MILLIMETERS" } }, "thunderstormProbability": 0, "airPressure": { "meanSeaLevelMillibars": 1012.1 }, "wind": { "direction": { "degrees": 135, "cardinal": "SOUTHEAST" }, "speed": { "value": 3, "unit": "KILOMETERS_PER_HOUR" }, "gust": { "value": 8, "unit": "KILOMETERS_PER_HOUR" } }, "visibility": { "distance": 16, "unit": "KILOMETERS" }, "cloudCover": 100, "iceThickness": { "thickness": 0, "unit": "MILLIMETERS" } }, { "interval": { "startTime": "2025-02-12T17:00:00Z", "endTime": "2025-02-12T18:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 9, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ }, { "interval": { "startTime": "2025-02-12T16:00:00Z", "endTime": "2025-02-12T17:00:00Z" }, "displayDateTime": { "year": 2025, "month": 2, "day": 12, "hours": 8, "utcOffset": "-28800s" }, "isDaytime": true, "weatherCondition": { "iconBaseUri": "https://maps.gstatic.com/weather/v1/cloudy", "description": { "text": "Cloudy", "languageCode": "en" }, "type": "CLOUDY" }, /.../ } ], "timeZone": { "id": "America/Los_Angeles" } }
इसे आज़माएं!
एपीआई एक्सप्लोरर की मदद से, सैंपल अनुरोध किए जा सकते हैं. इससे आपको एपीआई और एपीआई के विकल्पों के बारे में जानकारी मिलती है.
पेज की दाईं ओर मौजूद, एपीआई आइकॉन api को चुनें.
ज़रूरत पड़ने पर, अनुरोध के पैरामीटर में बदलाव करें.
सबमिट करें बटन को चुनें. डायलॉग बॉक्स में, वह खाता चुनें जिसका इस्तेमाल करके आपको अनुरोध करना है.
एपीआई एक्सप्लोरर पैनल में, फ़ुलस्क्रीन आइकॉन fullscreen को चुनकर, एपीआई एक्सप्लोरर विंडो को बड़ा करें.