history.hours এন্ডপয়েন্ট শেষ ঘন্টা থেকে শুরু করে একটি নির্দিষ্ট স্থানে প্রতি ঘন্টায় 24 ঘন্টা পর্যন্ত ঐতিহাসিক আবহাওয়ার তথ্য প্রদান করে। API নিম্নলিখিতগুলি প্রদান করে:
- একটি নির্দিষ্ট ঘন্টার জন্য একটি সংশ্লিষ্ট আইকন সহ আবহাওয়া পরিস্থিতির একটি বিবরণ৷
- দৈনিক সর্বোচ্চ এবং সর্বনিম্ন তাপমাত্রা
- দৈনিক সর্বোচ্চ এবং সর্বনিম্ন আপাত ("মনে হয়") তাপমাত্রা
- শিশির বিন্দু
- তাপ সূচক
- ভেজা বাল্বের তাপমাত্রা
- আপেক্ষিক আর্দ্রতা
- UV সূচক
- সম্ভাবনা, শতাংশ, পরিমাণ এবং বৃষ্টিপাতের ধরন
- বজ্রঝড়ের সম্ভাবনা
- সমুদ্রপৃষ্ঠের চাপ
- শীতল বাতাস
- বাতাসের দিক , গতি এবং দমকা
- বরফের পুরুত্ব
- দৃশ্যমানতা এবং মেঘের আবরণ
APIs এক্সপ্লোরার আপনাকে লাইভ অনুরোধ করতে দেয় যাতে আপনি 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
পরামিতি ব্যবহার করে একটি নির্দিষ্ট সময়ের জন্য আপনার অনুরোধের সুযোগ দিতে পারেন।
নিম্নলিখিত উদাহরণটি মাউন্টেন ভিউ, CA-তে গত তিন ঘণ্টার ইতিহাসের তথ্যের জন্য অনুরোধ করে:
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
মানটি পাস করুন।
নিম্নলিখিত উদাহরণটি মাউন্টেন ভিউ, CA-এর জন্য প্রতি পৃষ্ঠায় পাঁচ ঘণ্টার ডেটা সহ আট ঘণ্টার আবহাওয়ার পূর্বাভাস ডেটার অনুরোধ করে:
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 এক্সপ্লোরার আপনাকে নমুনা অনুরোধ করতে দেয় যাতে আপনি API এবং API বিকল্পগুলির সাথে পরিচিত হতে পারেন।
পৃষ্ঠার ডানদিকে API আইকন api নির্বাচন করুন।
ঐচ্ছিকভাবে অনুরোধের পরামিতি সম্পাদনা করুন।
এক্সিকিউট বোতামটি নির্বাচন করুন। ডায়ালগে, আপনি অনুরোধ করতে যে অ্যাকাউন্টটি ব্যবহার করতে চান সেটি বেছে নিন।
APIs এক্সপ্লোরার প্যানেলে, APIs এক্সপ্লোরার উইন্ডোটি প্রসারিত করতে ফুলস্ক্রিন আইকন পূর্ণস্ক্রীন নির্বাচন করুন।