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 به شرح زیر می باشد:
- id : شناسه یکتا شهر
- name : نام لاتین شهر
- caption : عنوان شهر
- lat : مقدار lat در نقشه گوگل
- lon : مقدار lon در نقشه گوگل
- time : تاریخ و ساعت (به میلادی)
- temperature : دمای فعلی
- windspeed : سرعت باد بر حسب km/h
- winddirection : جهت باد که بین 1 الی 360 درجه می باشد.
- is_day : روز یا شب؛ مقدار true روز و مقدار false شب
- weather_code : کد وضعیت آب و هوا
- 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 به شرح زیر می باشد:
- id : شناسه یکتا شهر
- name : نام لاتین شهر
- caption : عنوان شهر
- lat : مقدار lat در نقشه گوگل
- lon : مقدار lon در نقشه گوگل
- time : تاریخ و ساعت (به میلادی)
- temperature : دمای فعلی
- weather_code : کد وضعیت آب و هوا
- weather_caption : عنوان وضعیت آب و هوا
- 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 به شرح زیر می باشد:
- id : شناسه یکتا شهر
- name : نام لاتین شهر
- caption : عنوان شهر
- lat : مقدار lat در نقشه گوگل
- lon : مقدار lon در نقشه گوگل
- time : تاریخ (به میلادی)
- temperature_max : بیشترین دما
- temperature_min : کمترین دما
- weather_code : کد وضعیت آب و هوا
- 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 شامل آرایهای از فهرست شهرها میباشد.
اجزای کلاس به شرح زیر می باشد:
- province_id : شناسه یکتا استان
- province_name : نام لاتین استان
- province_caption : عنوان استان
- city_id : شناسه یکتا شهر
- city_name : نام لاتین شهر
- city_caption : عتوان شهر
- city_lat : مقدار lat در نقشه گوگل
- city_lon : مقدار lon در نقشه گوگل
نمونه درست : https://api.i-data.ir/weather/current/sari
نمونه اشتباه : https://api.i-data.ir/weather/current/mazandaran
