ঘন্টার ইতিহাস পান

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

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

এপিআই এক্সপ্লোরার আপনাকে সরাসরি অনুরোধ করার সুযোগ দেয়, যাতে আপনি এপিআই এবং এর অপশনগুলোর সাথে পরিচিত হতে পারেন:

ঘণ্টাভিত্তিক ইতিহাস অনুরোধ সম্পর্কে

ঘণ্টাভিত্তিক ইতিহাসের তথ্য অনুরোধ করতে, এখানে একটি 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 অন্তর্ভুক্ত থাকে। তথ্যের পরবর্তী পৃষ্ঠাটি দেখতে, আপনার রিকোয়েস্টের 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"
  }
}

চেষ্টা করে দেখুন!

এপিআই এক্সপ্লোরার আপনাকে নমুনা অনুরোধ করার সুযোগ দেয়, যাতে আপনি এপিআই এবং এর অপশনগুলোর সাথে পরিচিত হতে পারেন।

  1. পৃষ্ঠার ডানদিকে থাকা API আইকনটি (api) নির্বাচন করুন।

  2. ইচ্ছা হলে অনুরোধের প্যারামিটারগুলো সম্পাদনা করুন।

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

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