প্রতি ঘণ্টার ইতিহাস পাওয়া

history.hours এন্ডপয়েন্ট কোনও নির্দিষ্ট লোকেশন থেকে শেষ ঘণ্টা শুরু করে, সর্বাধিক ২৪ ঘণ্টার প্রতি ঘণ্টার ঐতিহাসিক আবহাওয়ার ডেটা রিটার্ন করে। API নিম্নলিখিত তথ্য রিটার্ন করে:

  • নির্দিষ্ট ঘণ্টার জন্য আবহাওয়ার পরিস্থিতির বিবরণ এবং তার সাথে সম্পর্কিত আইকন
  • দৈনিক সর্বোচ্চ ও সর্বনিম্ন তাপমাত্রা
  • দৈনিক সর্বোচ্চ ও সর্বনিম্ন আপাত ("অনুভূত") তাপমাত্রা
  • শিশিরাঙ্ক
  • হিট ইন্ডেক্স
  • ওয়েট বাল্বের তাপমাত্রা
  • আপেক্ষিক আর্দ্রতা
  • UV ইনডেক্স
  • বৃষ্টিপাতের সম্ভাবনা, শতাংশ, পরিমাণ এবং প্রকার
  • বজ্রবিদ্যুৎ সহ বৃষ্টির সম্ভাবনা
  • সমুদ্রপৃষ্ঠের চাপ
  • কনকনে হাওয়া
  • বাতাসের দিক, গতি ও ঝোড়ো হাওয়া
  • বরফের ঘনত্ব
  • দৃশ্যমানতা ও মেঘের আড়াল

API এক্সপ্লোরার আপনাকে লাইভ অনুরোধ করতে দেয় যাতে আপনি 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 এন্ডপয়েন্ট শেষ ঘণ্টা থেকে শুরু করে ২৪ ঘণ্টার ঐতিহাসিক আবহাওয়ার ডেটা ফিরিয়ে দেয়। আপনি 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 প্যারামিটার ব্যবহার করে প্রতি পৃষ্ঠায় কত ঘণ্টার ডেটা দেখতে চান তা উল্লেখ করতে পারবেন। প্রতি পৃষ্ঠায় ২৪ ঘণ্টার পূর্বাভাস সংক্রান্ত তথ্য হল ডিফল্ট ভ্যালু ।

একাধিক পৃষ্ঠার তথ্য সহ উত্তরে nextPageToken অন্তর্ভুক্ত থাকে। তথ্যের পরের পৃষ্ঠা দেখতে, আপনার অনুরোধে nextPageToken ভ্যালু pageToken প্যারামিটারে পাস করুন।

নিম্নলিখিত উদাহরণে Mountain View, 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"
}

ডেটার পরবর্তী পৃষ্ঠা অ্যাক্সেস করতে, আপনার অনুরোধে nextPageToken ভ্যালু pageToken প্যারামিটারে পাস করুন:

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 এক্সপ্লোরার আপনাকে স্যাম্পেল অনুরোধ করতে দেয় যাতে আপনি API ও API বিকল্পগুলির সাথে পরিচিত হতে পারেন।

  1. পৃষ্ঠার ডানদিকে API আইকন api বেছে নিন।

  2. ঐচ্ছিকভাবে, অনুরোধের প্যারামিটার এডিট করুন।

  3. এক্সিকিউট করুন বোতামটি বেছে নিন। ডায়ালগে, অনুরোধ করার জন্য আপনি যে অ্যাকাউন্ট ব্যবহার করতে চান সেটি বেছে নিন।

  4. API এক্সপ্লোরার প্যানেলে, API এক্সপ্লোরার উইন্ডো বড় করতে, 'ফুলস্ক্রিন' আইকন ফুলস্ক্রিন বেছে নিন।