Testing out the weather.gov forecast API - Does it work?

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 9

  • @aekorr
    @aekorr 3 года назад +7

    Bit late, but W coords need to be negative

  • @jameshall7539
    @jameshall7539 Год назад +2

    for the longitude you need the minus sign

  • @michealkinney6205
    @michealkinney6205 2 года назад +4

    I hope this might help someone, but I find NOAA to have poor API documentation, and I just found something interesting. I wanted some data from their forecast weather page and noticed below the map itself, there's a link to "XML". Click on it and change the "FcstType" from "dwml" to "json" and there you go.. you got the logic for a simple API call, and simply add it to a script to replace the latitude and longitudes.

    • @michealkinney6205
      @michealkinney6205 2 года назад

      # Some Simple Python Code
      from requests import get
      from datetime import datetime
      def get_forecast(lat, lon):
      base_url, type = 'forecast.weather.gov', 'json'
      return get(f'{base_url}/MapClick.php?lat={lat}&lon={lon}&FcstType={type}').json()
      print(get_forecast('41.6741', '-83.5067'))

  • @stevengoodboy1
    @stevengoodboy1 4 года назад

    Did you ever identify an API for your use? I wanted to use their radar api... but it looks like it is still not supported.

    • @codemagic6757
      @codemagic6757  4 года назад

      I haven't moved forward with any, but I was looking at www.climacell.co/pricing/ and openweathermap.org/price. Both seem to have decent free tiers.

  • @aingle4239
    @aingle4239 3 года назад +1

    close lol WFO is weather forecast office

  • @christopherreif3624
    @christopherreif3624 2 года назад +3

    Wasted my time, don't watch