i-data

پایگاه خدمات آنلاین i-Data

wearther / وضعیت آب و هوا

شرح خدمت

سرویس ارائه وضعیت آب و هوا بر اساس شهر
برای فراخوانی api-key الزامیست.

1. دریافت وضعیت فعلی آب و هوا

url: https://api.i-data.ir/weather/current/{id_or_name}
method: get

      {id_or_name} : شناسه یا نام لاتین شهر مورد نظر
نمونه فراخوانی https://api.i-data.ir/weather/current/tehran
نمونه پاسخ برگشتی { "is_ok": true, "result": { "city": { "id": 101001, "name": "tehran", "caption": "تهران", "lat": "35.699731", "lon": "51.33805" }, "current": { "time": "2026-02-13 11:00:00", "temperature": 15.9, "windspeed": 8.8, "winddirection": 261, "is_day": true, "weather_code": 3, "weather_caption": "ابری" } }, "date": "2026-02-13 11:08:38" }
مقدار result شامل دو فیلد city و current می باشد:
اجزای کلاس city به شرح زیر می باشد:
  1. id : شناسه یکتا شهر
  2. name : نام لاتین شهر
  3. caption : عنوان شهر
  4. lat : مقدار lat در نقشه گوگل
  5. lon : مقدار lon در نقشه گوگل
اجزای کلاس current به شرح زیر می باشد:
  1. time : تاریخ و ساعت (به میلادی)
  2. temperature : دمای فعلی
  3. windspeed : سرعت باد بر حسب km/h
  4. winddirection : جهت باد که بین 1 الی 360 درجه می باشد.
  5. is_day : روز یا شب؛ مقدار true روز و مقدار false شب
  6. weather_code : کد وضعیت آب و هوا
  7. weather_caption : عنوان وضعیت آب و هوا

2. دریافت وضعیت آب و هوا در 24 ساعت آینده

url: https://api.i-data.ir/weather/24hour/{id_or_name}
method: get

      {id_or_name} : شناسه یا نام لاتین شهر مورد نظر
نمونه فراخوانی https://api.i-data.ir/weather/24hour/tehran
نمونه پاسخ برگشتی { "is_ok": true, "result": { "city": { "id": 101001, "name": "tehran", "caption": "تهران", "lat": "35.699731", "lon": "51.33805" }, "hourly": [ { "time": "2026-02-13T11:00", "temperature": 16.8, "weather_code": 3, "weather_caption": "ابری", "windspeed": 10.8 }, { "time": "2026-02-13T12:00", "temperature": 17.8, "weather_code": 3, "weather_caption": "ابری", "windspeed": 11.2 }, { "time": "2026-02-13T13:00", "temperature": 17.8, "weather_code": 3, "weather_caption": "ابری", "windspeed": 11.6 }, { "time": "2026-02-13T14:00", "temperature": 18.1, "weather_code": 3, "weather_caption": "ابری", "windspeed": 9.8 }, { "time": "2026-02-13T15:00", "temperature": 18.2, "weather_code": 0, "weather_caption": "صاف", "windspeed": 7.9 }, { "time": "2026-02-13T16:00", "temperature": 18.0, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 7.4 }, { "time": "2026-02-13T17:00", "temperature": 17.1, "weather_code": 0, "weather_caption": "صاف", "windspeed": 4.8 }, { "time": "2026-02-13T18:00", "temperature": 15.6, "weather_code": 0, "weather_caption": "صاف", "windspeed": 3.2 }, { "time": "2026-02-13T19:00", "temperature": 14.5, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 1.5 }, { "time": "2026-02-13T20:00", "temperature": 13.6, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 4.1 }, { "time": "2026-02-13T21:00", "temperature": 12.0, "weather_code": 2, "weather_caption": "نیمه‌ابری", "windspeed": 4.4 }, { "time": "2026-02-13T22:00", "temperature": 11.2, "weather_code": 2, "weather_caption": "نیمه‌ابری", "windspeed": 4.0 }, { "time": "2026-02-13T23:00", "temperature": 10.8, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 4.2 }, { "time": "2026-02-14T00:00", "temperature": 10.3, "weather_code": 0, "weather_caption": "صاف", "windspeed": 3.9 }, { "time": "2026-02-14T01:00", "temperature": 10.1, "weather_code": 0, "weather_caption": "صاف", "windspeed": 3.4 }, { "time": "2026-02-14T02:00", "temperature": 9.6, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 3.2 }, { "time": "2026-02-14T03:00", "temperature": 9.3, "weather_code": 0, "weather_caption": "صاف", "windspeed": 4.1 }, { "time": "2026-02-14T04:00", "temperature": 8.6, "weather_code": 0, "weather_caption": "صاف", "windspeed": 4.8 }, { "time": "2026-02-14T05:00", "temperature": 7.7, "weather_code": 0, "weather_caption": "صاف", "windspeed": 5.3 }, { "time": "2026-02-14T06:00", "temperature": 7.3, "weather_code": 3, "weather_caption": "ابری", "windspeed": 4.8 }, { "time": "2026-02-14T07:00", "temperature": 7.6, "weather_code": 3, "weather_caption": "ابری", "windspeed": 5.4 }, { "time": "2026-02-14T08:00", "temperature": 9.6, "weather_code": 2, "weather_caption": "نیمه‌ابری", "windspeed": 4.7 }, { "time": "2026-02-14T09:00", "temperature": 13.6, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 3.4 }, { "time": "2026-02-14T10:00", "temperature": 16.4, "weather_code": 1, "weather_caption": "عمدتاً صاف", "windspeed": 5.9 } ] }, "date": "2026-02-13 11:30:39" }
مقدار result شامل دو فیلد city و hourly می باشد:
اجزای کلاس city به شرح زیر می باشد:
  1. id : شناسه یکتا شهر
  2. name : نام لاتین شهر
  3. caption : عنوان شهر
  4. lat : مقدار lat در نقشه گوگل
  5. lon : مقدار lon در نقشه گوگل
hourly آرایه ای از کلاس زیر می باشد
  1. time : تاریخ و ساعت (به میلادی)
  2. temperature : دمای فعلی
  3. weather_code : کد وضعیت آب و هوا
  4. weather_caption : عنوان وضعیت آب و هوا
  5. windspeed : سرعت باد بر حسب km/h

3. دریافت وضعیت آب و هوا در 7 روز آینده

url: https://api.i-data.ir/weather/7day/{id_or_name}
method: get

      {id_or_name} : شناسه یا نام لاتین شهر مورد نظر
نمونه فراخوانی https://api.i-data.ir/weather/7day/tehran
نمونه پاسخ برگشتی { "is_ok": true, "result": { "city": { "id": 101001, "name": "tehran", "caption": "تهران", "lat": "35.699731", "lon": "51.33805" }, "daily": [ { "time": "2026-02-13", "temperature_max": 18.2, "temperature_min": 10.5, "weather_code": 3, "weather_caption": "ابری" }, { "time": "2026-02-14", "temperature_max": 19.4, "temperature_min": 7.3, "weather_code": 80, "weather_caption": "رگبار ضعیف" }, { "time": "2026-02-15", "temperature_max": 16.7, "temperature_min": 8.3, "weather_code": 95, "weather_caption": "رعد و برق" }, { "time": "2026-02-16", "temperature_max": 17.5, "temperature_min": 4.9, "weather_code": 0, "weather_caption": "صاف" }, { "time": "2026-02-17", "temperature_max": 19.7, "temperature_min": 8.5, "weather_code": 0, "weather_caption": "صاف" }, { "time": "2026-02-18", "temperature_max": 19.7, "temperature_min": 9.4, "weather_code": 3, "weather_caption": "ابری" }, { "time": "2026-02-19", "temperature_max": 21.1, "temperature_min": 14.1, "weather_code": 2, "weather_caption": "نیمه‌ابری" } ] }, "date": "2026-02-13 11:35:12" }
مقدار result شامل دو فیلد city و daily می باشد:
اجزای کلاس city به شرح زیر می باشد:
  1. id : شناسه یکتا شهر
  2. name : نام لاتین شهر
  3. caption : عنوان شهر
  4. lat : مقدار lat در نقشه گوگل
  5. lon : مقدار lon در نقشه گوگل
daily آرایه‌ای از کلاس به شرح زیر می‌باشد:
  1. time : تاریخ (به میلادی)
  2. temperature_max : بیشترین دما
  3. temperature_min : کمترین دما
  4. weather_code : کد وضعیت آب و هوا
  5. weather_caption : عنوان وضعیت آب و هوا

4. فهرست شهرهایی که امکان دریافت وضعیت آب و هوا را دارد

url: https://api.i-data.ir/weather/city
method: get

نمونه پاسخ برگشتی { "is_ok": true, "result": [ ... { "province_id": 27, "province_name": "mazandaran", "province_caption": "مازندران", "city_id": 2701001, "city_name": "sari", "city_caption": "ساری", "city_lat": "36.56559", "city_lon": "53.05894" }, ... ], "date": "2026-02-13 11:35:12" }
مقدار result شامل آرایه‌ای از فهرست شهرها می‌باشد.
اجزای کلاس به شرح زیر می باشد:
  1. province_id : شناسه یکتا استان
  2. province_name : نام لاتین استان
  3. province_caption : عنوان استان
  4. city_id : شناسه یکتا شهر
  5. city_name : نام لاتین شهر
  6. city_caption : عتوان شهر
  7. city_lat : مقدار lat در نقشه گوگل
  8. city_lon : مقدار lon در نقشه گوگل
برای دریافت وضعیت آب و هوا باید شناسه یا نام لاتین شهر را در فراخوانی استفاده کنید.
نمونه درست : https://api.i-data.ir/weather/current/sari
نمونه اشتباه : https://api.i-data.ir/weather/current/mazandaran