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