history.hours এন্ডপয়েন্টটি একটি নির্দিষ্ট স্থানে, শেষ ঘন্টা থেকে শুরু করে, ২৪ ঘন্টা পর্যন্ত প্রতি ঘন্টার ঐতিহাসিক আবহাওয়ার তথ্য প্রদান করে। API নিম্নলিখিত তথ্য প্রদান করে:
- নির্দিষ্ট ঘন্টার জন্য সংশ্লিষ্ট আইকন সহ আবহাওয়ার পরিস্থিতির বর্ণনা
- দৈনিক সর্বোচ্চ এবং সর্বনিম্ন তাপমাত্রা
- দৈনিক সর্বোচ্চ এবং সর্বনিম্ন আপাত তাপমাত্রা ("মনে হচ্ছে")
- শিশিরাঙ্ক
- তাপ সূচক
- ভেজা বাল্বের তাপমাত্রা
- আপেক্ষিক আর্দ্রতা
- অতিবেগুনী সূচক
- বৃষ্টিপাতের সম্ভাবনা, শতাংশ, পরিমাণ এবং ধরণ
- বজ্রপাতের সম্ভাবনা
- সমুদ্রপৃষ্ঠের চাপ
- ঠান্ডা বাতাস
- বাতাসের দিক , গতি এবং ঝোড়ো হাওয়া
- বরফের ঘনত্ব
- দৃশ্যমানতা এবং মেঘের আবরণ
APIs Explorer আপনাকে লাইভ অনুরোধ করতে দেয় যাতে আপনি API এবং API বিকল্পগুলির সাথে পরিচিত হতে পারেন:
প্রতি ঘণ্টার ইতিহাসের অনুরোধ সম্পর্কে
প্রতি ঘণ্টার ইতিহাসের তথ্যের জন্য অনুরোধ করতে, একটি HTTP GET অনুরোধ পাঠান:
https://weather.googleapis.com/v1/history/hours:lookup?key=YOUR_API_KEY&location.latitude=LATITUDE&location.longitude=LONGITUDE
আপনার অনুরোধের URL প্যারামিটারে অবস্থানের অক্ষাংশ এবং দ্রাঘিমাংশ স্থানাঙ্ক অন্তর্ভুক্ত করুন।
ঘন্টাভিত্তিক ইতিহাসের অনুরোধের উদাহরণ
ডিফল্টরূপে, 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 URL প্যারামিটার ব্যবহার করে আপনি প্রতি পৃষ্ঠায় কত ঘন্টার ডেটা ফেরত পাঠাতে হবে তা নির্দিষ্ট করতে পারেন। ডিফল্ট মান হল প্রতি পৃষ্ঠায় 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" } }
চেষ্টা করে দেখুন!
APIs Explorer আপনাকে নমুনা অনুরোধ করতে দেয় যাতে আপনি API এবং API বিকল্পগুলির সাথে পরিচিত হতে পারেন।
পৃষ্ঠার ডান দিকে API আইকন API নির্বাচন করুন।
ঐচ্ছিকভাবে অনুরোধের প্যারামিটারগুলি সম্পাদনা করুন।
এক্সিকিউট বোতামটি নির্বাচন করুন। ডায়ালগে, অনুরোধটি করার জন্য আপনি যে অ্যাকাউন্টটি ব্যবহার করতে চান তা নির্বাচন করুন।
APIs Explorer প্যানেলে, APIs Explorer উইন্ডোটি প্রসারিত করতে ফুলস্ক্রিন আইকন ফুলস্ক্রিন নির্বাচন করুন।