Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That is cool the web front end exposes itself as JSON as well, good tip.

FWIW, they also have a pretty decent API. Its based around zones though, which you'd need to look up. So from that lat and lon, you'd get the zone from:

https://api.weather.gov/points/37.7827,-120.38

Using the zone information, you can get to a forecast:

https://api.weather.gov/gridpoints/STO/72,24/forecast

If you're wanting the current observations, you'd pick a station for that grid such as MOUC1 and go to its observations/latest endpoint:

https://api.weather.gov/stations/MOUC1/observations/latest

The API is in a JSON-LD format so its got a lot of links to related topics in the actual JSON payload. Looking at the JSON can make it somewhat easy to feel out what you need. The documentation is here:

https://www.weather.gov/documentation/services-web-api



Thanks, on that day I already was playing with the api.

Initially I had few bookmarks saved on my android home screen, for each city I was interested in weather forecast of. But soon there were total 4 cities; & their text size is too small, need to zoom. I slurped their json api & wrote this:

https://spa.bydav.in/weather/

You need to add URL for each city you want to see weather, in Settings. All that data is saved in your device local storage. No funny trackers or home phone.

You can also paste the following json in Settings > Text Area > Click Import JSON:

  [
    {
      "abb": "STK",
      "full": "Stockton",
      "url": "https://forecast.weather.gov/MapClick.php?lat=37.95&lon=-121.29&unit=0&lg=english&FcstType=json&TextType=1"
    },
    {
      "abb": "SFO",
      "full": "San Francisco",
      "url": "https://forecast.weather.gov/MapClick.php?lat=37.7771&lon=-122.4197&unit=0&lg=english&FcstType=json&TextType=1"
    }
  ]




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: