Skip to content

Free APIs for a weather app

7 of 7 APIs in this set passed their last check, all without a key. A weather app is three requests: turn what the user typed into coordinates, ask for the forecast at those coordinates, and decorate the answer. All three can be done without a key and straight from the browser.
  1. Open-Meteo Geocoding

    Turns "Lisbon" into latitude, longitude and timezone. Start here.

    geocoding-api.open-meteo.com

    Runs in the browserWorking

  2. Open-Meteo Forecast

    The forecast itself: current conditions, hourly and daily values.

    api.open-meteo.com

    Runs in the browserWorking

  3. Open-Meteo Air Quality

    PM2.5, PM10 and pollen for the same coordinates.

    air-quality-api.open-meteo.com

    Runs in the browserWorking

  4. Sunrise Sunset

    Sunrise and sunset to switch between day and night icons.

    api.sunrise-sunset.org

    Runs in the browserWorking

  5. GeoJS

    A rough location from the visitor’s IP, to show something before they search.

    get.geojs.io

    Runs in the browserWorking

  6. BigDataCloud Reverse Geocoding

    City name for coordinates that came from the device’s geolocation.

    api.bigdatacloud.net

    Runs in the browserWorking

  7. MET Norway Locationforecast

    A second forecast source if you want to compare or fall back.

    api.met.no

    Runs in the browserWorking

Build snapshot, not live. One verifier run on , from the machine that built this site. How we check

How the pieces fit

The APIs below were picked because they accept coordinates in the same format and send CORS headers, so the whole app can run as a static page.

  1. Ask the geocoder for the place name and keep the first result’s latitude, longitude and timezone.
  2. Request the forecast with those coordinates and the timezone, so times come back in local time.
  3. Cache the answer for at least ten minutes. Forecast models do not update faster than that.
  4. Show the name of the data source and the time of the forecast next to the numbers.

Questions

Can I build a weather app without any API key?

Yes. Open-Meteo provides geocoding, forecast and air quality without a key, and all three answered our verifier with CORS headers, so a static page can call them directly.

Is Open-Meteo free for commercial use?

No. Its free tier is for non-commercial use; a commercial product needs one of its paid plans. MET Norway and the US National Weather Service allow commercial use with attribution and an identifying User-Agent.

How do I get the user’s location for the first screen?

Use an IP location API such as GeoJS for a rough default, and offer the browser’s geolocation prompt as an explicit button. IP location is often wrong by a city.

Other collections

Keep exploring