دریافت هشدار آب و هوا

نقطه پایانی publicAlerts جزئیات هشدارهای مربوط به رویدادهای خاص آب و هوایی را که توسط آژانس‌های معتبر ملی و بین‌المللی صادر شده‌اند، ارائه می‌دهد. این هشدارها اطلاعات حیاتی و بالقوه نجات‌بخش را ارائه می‌دهند.

The endpoint returns weather alerts occurring in real time for a given latitude and longitude. Supported weather events include the following:

  • Precipitation: Rain, snow, hail, droughts, and more
  • Extreme temperatures: Cold, heat, freeze, frost, wind chill, and humidity
  • Wind and storm events: Blizzards, hurricanes, tornados, tropical storms, thunderstorms, and more
  • Visibility impairments: Fog, dust storms, and blowing snow
  • Water-related hazards: Floods, tsunamis, storm surges, coastal hazards, and more
  • Geophysical and geological events: Earthquakes, landslides, and volcanic activity
  • حوادث آتش‌سوزی: آتش‌سوزی‌های جنگلی، آب و هوای آتش‌سوزی و موارد دیگر

For a complete list of supported weather events, see Weather event types .

بسته به آنچه از منبع داده در دسترس است، هشدارها ممکن است حاوی توضیحات محلی باشند یا نباشند. به دلیل محدودیت‌های منبع داده، اطلاعات به همان صورت (محتوای خام) ارائه می‌شوند. برای اطلاعات بیشتر در مورد منابع هشدار آب و هوا، به منابع داده مراجعه کنید.

The API returns the following information for a given weather alert:

  • The type of weather event associated with the alert
  • A list of affected areas along with coordinates defining the geographical boundaries of those areas
  • خلاصه‌ای یک جمله‌ای از رویداد آب و هوایی
  • سطوح شدت، قطعیت و فوریت
  • A description of action-recommend instructions for the target audience
  • توصیه‌های ایمنی
  • زمان شروع و پایان هشدار
  • نام و وب‌سایت مرجع انتشار

مرورگر APIها به شما امکان می‌دهد درخواست‌های زنده ارسال کنید تا بتوانید با API و گزینه‌های API آشنا شوید:

درباره درخواست‌های هشدار آب و هوا

To request weather alert information, send an HTTP GET request to:

https://weather.googleapis.com/v1/publicAlerts:lookup?key=YOUR_API_KEY&location.latitude=LATITUDE&location.longitude=LONGITUDE&languageCode=LANGUAGE_CODE

Include the latitude and longitude coordinates of the location in your request URL parameters.

درباره پاسخ‌های هشدار آب و هوا

The Weather API returns the following fields in the response body:

میدان نوع توضیحات الزامی یا اختیاری
alertId رشته The alert ID. This can also be found on the data provider website. مورد نیاز
alertTitle رشته The title of the alert, which describes the weather event.

Note: This is the only string that is translated when a language code parameter is included in the request.
مورد نیاز
eventType شمارشی The type of weather event associated with the alert.

For a full list of supported weather events, see Weather event types .
مورد نیاز
areaName رشته The name of the geographic area affected by the alert, which includes the requested location. مورد نیاز
polygon رشته Coordinates defining a closed dimensional area of the alert. اختیاری
description رشته A short phrase that summarizes the event description in the specified language (for example, "Tornado warning"). اختیاری
severity شمارشی سطح شدت هشدار:
  • Extreme: Extraordinary threat to life or property
  • شدید: تهدید جدی برای جان یا مال
  • متوسط: احتمال تهدید جانی یا مالی
  • Minor: Minimal to no known threat to life or property
  • ناشناخته: شدت نامشخص
اختیاری
certainty شمارشی سطح اطمینان برای هشدار:
  • Observed: Determined to have occurred or to be ongoing
  • Very Likely: Very likely to have occurred or to be ongoing
  • Likely: Likely (p > ~50%) to have occurred or to be ongoing
  • Possible: Possible but not likely to have occurred or to be ongoing (p <= ~50%)
  • بعید: انتظار نمی‌رود رخ دهد (p ~ 0)
  • نامعلوم: قطعیت نامعلوم
اختیاری
urgency شمارشی میزان فوریت برای هشدار:
  • Immediate: Responsive action SHOULD be taken immediately
  • Expected: Responsive action SHOULD be taken soon (within the next hour)
  • Future: Responsive action SHOULD be taken in the near future
  • گذشته: دیگر نیازی به اقدام واکنشی نیست
  • ناشناخته: فوریت نامشخص
اختیاری
instruction رشته Description of responsive action instructions for the target audience. اختیاری
safetyRecommendations رشته Safety recommendations based on public authority codes. Includes top-level directives and subtext with additional information. اختیاری
timezoneOffset رشته The timezone offset of the event, in +/-HH:MM format. مورد نیاز
startTime تاریخ و زمان The effective Epoch date and time (UTC time) of the information in the alert message. اختیاری
expirationTime تاریخ و زمان The Epoch date and time (UTC time) that an alert is expected to end. It may be null for indefinitely long events, in which case the headline will indicate that the event is "in effect". اختیاری
dataSource شمارشی Authority details including publisher, name, and URL. مورد نیاز
regionCode شمارشی Region code of the location that has been requested. اختیاری

منابع داده

نقطه پایانی هشدارهای آب و هوایی، داده‌های منتشر شده توسط ارائه دهندگان ذکر شده در جدول زیر را برمی‌گرداند. بر اساس مختصات طول و عرض جغرافیایی ارائه شده در درخواست، بدنه پاسخ، داده‌ها را از مرجع محلی مربوطه ارائه می‌دهد.

Providers included in the feed follow Google's Public Alerts guidelines . Google may update the list of providers at any time.

کشور آژانس
استرالیا آژانس خدمات اضطراری ACT (ACT ESA)
خدمات آتش نشانی روستایی نیو ساوت ولز (NSW RFS)
سازمان آتش نشانی جنوب استرالیا (SA CFS)
سازمان آتش نشانی تاسمانی (TFS)
خدمات آتش نشانی و اورژانس کوئینزلند (QFES)
اتریش GeoSphere اتریش از طریق MeteoAlarm
بلژیک Royal Meteorological Institute of Belgium through MeteoAlarm
بوسنی و هرزگوین Federal Hydro-meteorological Institute (FHMZ) through MeteoAlarm
بلغارستان National Institute of Meteorology & Hydrology through MeteoAlarm
برزیل Centro Nacional de Gerenciamento de Riscos e Desastres (CENAD)
موسسه ملی هواشناسی (INMET)
کلمبیا Unidad Nacional para la Gestión del Riesgo de Desastres (UNGRD)
ساحل عاج Société d'Exploitation et de Développement Aéroportuaire, Aéronautique et Météorologique
کرواسی Croatian Meteorological and Hydrological Service through MeteoAlarm
قبرس اداره هواشناسی از طریق MeteoAlarm
چک Czech Hydrometeorological Institute through MeteoAlarm
دانمارک Danish Meteorological Institute through MeteoAlarm
اکوادور موسسه ملی هواشناسی و هیدرولوژی
استونی وزارت آب و هوا از طریق MeteoAlarm
فنلاند Finnish Meteorological Institute through MeteoAlarm
فرانسه Météo-France از طریق MeteoAlarm
آلمان DWD - سرویس هواشناسی آلمان
غنا آژانس ملی هواشناسی
یونان Hellenic National Meteorological Service through MeteoAlarm
مجارستان HungaroMet غیرانتفاعی Zrt از طریق MeteoAlarm
ایسلند Icelandic Meteorological Office through MeteoAlarm
ایرلند با Eirann از طریق MeteoAlarm آشنا شوید
ایتالیا Italian Meteorological Service through MeteoAlarm
جامائیکا سازمان هواشناسی جامائیکا
ژاپن سازمان هواشناسی ژاپن (JMA)
لتونی Latvian Environment, Geology and Meteorology Centre through MeteoAlarm
لیتوانی Lithuanian Hydrometeorological Service through MeteoAlarm
لوکزامبورگ MeteoLux از طریق MeteoAlarm
ماداگاسکار هواشناسی ماداگاسکار
مکزیک Centro de Instrumentación y Registro Sísmico AC (CIRES)
هلند Royal Netherlands Meteorological Institute through MeteoAlarm
مقدونیه شمالی National Hydrometeorological Service through MeteoAlarm
نروژ Norwegian Meteorological Institute through MeteoAlarm
نیوزیلند علوم GNS (GeoNet)
مت سرویس
فیلیپین Philippine Atmospheric, Geophysical & Astronomical Services Administration (PAGASA)
لهستان Institute of Meteorology and Water Management through MeteoAlarm
پرتغال Portuguese Institute for Sea and Atmosphere through MeteoAlarm
رومانی National Meteorological Administration through MeteoAlarm
صربستان Republic Hydrometeorological Institute of Serbia through MeteoAlarm
سنگاپور سازمان هواشناسی سنگاپور
اسلواکی Slovak Hydrometeorological Institute through MeteoAlarm
اسلوونی Hydrometeorological Institute of Slovenia through MeteoAlarm
جزایر سلیمان خدمات هواشناسی جزایر سلیمان
کره جنوبی اداره هواشناسی کره
اسپانیا سازمان هواشناسی ایالتی از طریق MeteoAlarm
سوئد Swedish Meteorological and Hydrological Institute through MeteoAlarm
سوئیس Federal Office of Meteorology and Climatology MeteoSwiss through MeteoAlarm
تایوان National Science and Technology Center for Disaster Reduction (NCDR)
تایلند اداره هواشناسی تایلند
بریتانیا اداره هواشناسی از طریق MeteoAlarm
آژانس محیط زیست بریتانیا
ایالات متحده مرکز ملی هشدار سونامی
سازمان هواشناسی ملی ایالات متحده
ویتنام مرکز ملی پیش‌بینی‌های آب و هواشناسی

انتساب

On all displays where the data is presented, the customer application must include an attribution to the original source using the dataSource field:

"dataSource": {
        "publisher": "NOAA",
        "name": "National Weather Service",
        "authorityUri": "https://www.weather.gov/"
      }

این انتساب باید شامل نام کامل منبع داده (مطابق با فیلد name ) و پیوند به منبع داده با استفاده از URL ارائه شده در فیلد authorityUri (برای مثال، « سرویس ملی هواشناسی ») باشد.

انواع رویدادهای آب و هوایی

انواع رویدادهای آب و هوایی زیر پشتیبانی می‌شوند:

انواع رویدادهای آب و هوایی
ACID_RAIN
AVALANCHE
BLIZZARD
BLOWING_SNOW
COASTAL_FLOOD
COASTAL_HAZARD
COLD
CYCLONE
DROUGHT
EXTRATROPICAL_CYCLONE
FIRE_WEATHER
FLASH_FLOOD
FLOOD
FOG
FREEZING
FREEZING_AIR_TEMPERATURE
FREEZING_DRIZZLE
FREEZING_RAIN
FROST
GALE
GLAZE
HAIL
HAZARDOUS_SEAS
HEAT
HUMIDITY
HURRICANE
ICE_STORM
LAKE_EFFECT_SNOW
MONSOON
MUDDY_FLOOD
OUTFLOW
RAIN
RIVER_FLOODING
SEVERE_THUNDERSTORM_WARNING
SNOW
SNOWSQUALL
STORM
STORM_SURGE
THUNDER
THUNDERSTORM
TORNADO
TORNADO_WARNING
TROPICAL_CYCLONE
TROPICAL_CYCLONE_WARNINGS_AND_WATCHES
TROPICAL_DISTURBANCE
TROPICAL_STORM
TYPHOON
WIND
WIND_CHILL
WIND_WAVE
WINTER_STORM
WILDFIRE
BUSHFIRE
FIRE
LANDSLIDE
EARTHQUAKE
DUST_STORM
AFTERSHOCK
TSUNAMI
VOLCANIC_ASH
VOLCANIC_ERUPTION
RADIATION

رفتار ترجمه پاسخ

گوگل فقط برای فیلد alertTitle ترجمه ارائه می‌دهد. فیلدهای دیگری مانند eventType ، areaName ، instruction و safetyRecommendations نیز ممکن است بسته به پشتیبانی زبان منبع داده اصلی ترجمه شوند؛ با این حال، گوگل نمی‌تواند ترجمه‌های مستقلی برای این فیلدها ارائه دهد.

Based on the languageCode parameter included in the request, the following behaviors are expected for the alertTitle field:

  • Supported languageCode : If the requested languageCode is both provided and supported, the response is returned in the requested language.
  • Unsupported languageCode : In cases where the requested languageCode is not supported and a close alternative cannot be found, the endpoint returns the response in English by default.
  • No languageCode provided: The endpoint returns the response in English by default.

مثال درخواست هشدار آب و هوا

The following example requests weather alert information for a town in North Carolina:

curl -X GET "https://weather.googleapis.com/v1/publicAlerts:lookup?key=YOUR_API_KEY&location.latitude=35.824635&location.longitude=-78.3168047&languageCode=en"

بدنه پاسخ به شرح زیر است:

{
  "weatherAlerts": [
    {
      "alertId": "urn:oid:2.49.0.1.840.0.2416b1b5a6f51d29ef4b94948328dca303fbbb5c.001.1",
      "alertTitle": {
        "text": "Flash Flood Warning",
        "languageCode": "en"
      },
      "eventType": "FLASH_FLOOD",
      "areaName": "Franklin, NC; Johnston, NC; Nash, NC; Wake, NC",
      "polygon": "{\"type\":\"Polygon\",\"coordinates\":[[[-78.450000,35.820000],[-78.410000,35.730000],[-78.280000,35.660000],
        [-78.180000,35.740000],[-77.840000,36.150000],[-77.890000,36.140000],[-77.900000,36.160000],[-77.920000,36.170000],
        [-77.930000,36.190000], [-77.940000,36.190000],[-77.950000,36.180000],[-77.970000,36.190000],[-77.970000,36.180000],
        [-77.980000,36.180000],[-78.010000,36.210000],[-78.040000,36.210000],[-78.110000,36.210000],[-78.130000,36.230000],
        [-78.350000,35.940000],[-78.450000,35.820000]]]}",
      "description": "FFWRAH\n\nThe National Weather Service in Raleigh has issued a\n\n* Flash Flood Warning for...
        \nEastern Franklin County in central North Carolina...\nNorth Central Johnston County in central North Carolina...
        \nWestern Nash County in central North Carolina...\nEast Central Wake County in central North Carolina...
        \n\n* Until 530 PM EDT.\n\n* At 224 PM EDT, local law enforcement reported flash flooding in\nSpring Hope. Between 3 and 5 inches of rain have fallen.
        \nAdditional rainfall amounts of 1 to 3 inches are possible in the\nwarned area.\n\nHAZARD...Life threatening flash flooding.
        Heavy rain producing\nflash flooding.\n\nSOURCE...Law enforcement reported.\n\nIMPACT...Life threatening flash flooding of creeks and streams,\nurban areas,
        highways, streets and underpasses.\n\n* Some locations that will experience flash flooding include...
        \nZebulon, Bunn, Wendell, Spring Hope, Middlesex, Castalia,\nCenterville, Pilot, Emit and Aventon.",
      "severity": "SEVERE",
      "certainty": "LIKELY",
      "urgency": "IMMEDIATE",
      "instruction": [
        "Turn around, don't drown when encountering flooded roads. Most flood\ndeaths occur in vehicles."
      ],
      "safetyRecommendations": [
        {
          "directive": "Build an emergency kit and make a family communications plan.",
          "subtext": "Follow the instructions at http://www.ready.gov/build-a-kit for building 
            an emergency kit and http://www.ready.gov/make-a-plan for a family communications plan."
        },
        {
          "directive": "Be aware that flash flooding can occur. ",
          "subtext": "If there is any possibility of a flash flood, move immediately to higher ground. Do not wait for instructions to move."
        },
        ...
      ],
      "timezoneOffset": "-14400s",
      "startTime": "2025-08-06T18:24:00Z",
      "expirationTime": "2025-08-06T21:30:00Z",
      "dataSource": {
        "publisher": "NOAA",
        "name": "National Weather Service",
        "authorityUri": "https://www.weather.gov/"
      }
    }
  ],
  "regionCode": "US"
}

امتحانش کن!

The APIs Explorer lets you make sample requests so that you can get familiar with the API and the API options.

  1. Select the API icon api on the right side of the page.

  2. در صورت تمایل، پارامترهای درخواست را ویرایش کنید.

  3. Select the Execute button. In the dialog, choose the account that you want to use to make the request.

  4. In the APIs Explorer panel, select the fullscreen icon fullscreen to expand the APIs Explorer window.