Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To use the OpenWeatherMap API, create an account, get an API key, choose the endpoint for your needs, and send a request with the required parameters. For a straightforward first request, use the Current Weather API with latitude and longitude. Add an explicit units option so the returned temperatures are easy to interpret.

Choose the OpenWeatherMap API product for your task

Start with the data your app needs. OpenWeather offers products for current conditions, forecasts, combined timelines, air quality, historical weather, maps, and other specialized uses. The API catalog is the place to check the current product lineup and documentation.

  • Current conditions: Use the Current Weather endpoint when you need weather now for a location.
  • Forecasts: Choose a forecast product when the app needs future conditions rather than only the current reading.
  • Combined timeline or alerts: Review the current One Call documentation if you need data organized into a broader timeline or alerts. The catalog marks One Call 3.0 as deprecated and points to One Call 4.0; use the 4.0 documentation for new work and confirm its current endpoint details before implementing it.
  • Specialized data: Select an air-quality, historical-weather, map, or other specialized product when that is the actual requirement.

Forecast coverage, history, availability, and plan requirements vary by product, so verify them in the documentation for the endpoint you intend to use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create an account and get an API key

  1. Create an OpenWeather account and choose an API product.
  2. Open your account page and retrieve or generate an API key.
  3. Include the key in API requests using the appid parameter.

Keep the key in an environment variable or server-side configuration rather than placing it in browser code, screenshots, or a public repository. The key is a credential: if client-side code exposes it, others may be able to use it.

#1 Best Overall
Ambient Weather WS-2902 Wi-Fi Smart Weather Station
  • COMPLETE WEATHER STATION: (1) Osprey Sensor Array with Rain Cup, and (1) Brilliant, Easy-to-Read LCD Color Display
  • AUTHENTIC HYPER-LOCAL DATA: Monitor your actual home and backyard weather conditions with our wireless and Wi-Fi-enabled sensor array measuring wind speed/direction, temperature, humidity, rainfall, UV intensity, and solar radiation
  • SMART HOME READY: Set up alerts, access your data remotely, and program your home based on weather conditions using IFTT, Google Home, Alexa, and more
  • ENHANCED WIFI: Enables your station to transmit its data wirelessly to the world's largest personal weather station network (optional setting)
  • JOIN THE COMMUNITY: Connect to Ambient Weather Network to customize your dashboard tiles, share hyperlocal weather conditions via social feeds and create your own forecasts (coming soon)

OpenWeather says API usage is combined at the account level across keys and subscribed products. Creating several keys therefore does not, by itself, create separate account usage allowances. Check your account’s plan for its daily and per-minute limits.

Make a first current-weather request

The Current Weather documentation shows a request using latitude, longitude, and an API key:

https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}

Replace {lat} and {lon} with the location’s coordinates, and {API key} with your key. For example, the URL shape with metric units is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Newentor Weather Station Wireless Indoor Outdoor Thermometer, Black,1Sensor
  • [Color LCD Screen Weather Station] Newentor temperature & humidity monitor with a large color LCD display shows essential home weather information at a glance: indoor/outdoor temperature & humidity, daily high/low records, customizable alerts, time/date, alarm clock & snooze, weather forecast, moon phase, and barometric pressure.
  • [Two Power Modes & Adjustable Backlight] To enjoy a 24/7 continuous always-on vibrant display, simply connect this home weather station to a wall outlet using the included DC power adapter. When operating on battery power only (batteries not included), the digital thermometer automatically enters an eco-energy-saving mode, where the screen lights up for a quick 15-second glance before dimming. It is the perfect bedside or living room clock designed to fit your power preference.
  • [3-channel Home Weather Stations Wireless Indoor Outdoor] Wireless temperature forecast station supports up to 3 remote sensors to monitor inside outside temperature & humidity of multiple locations. Package contains one remote sensor.
  • [Wireless Forecast Station] The weather forecast station calculates the weather forecast for the next 12-24 hours, 7 to 10 days calibration ensures an accurate personal forecast for your location.
  • [Wireless Weather Station with Atomic Time&Date] Atomic alarm clock weather station can be used not only as a wireless indoor outdoor thermometer but also as an atomic clock with dual alarms.
https://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&units=metric&appid={API key}

The coordinates in this example are illustrative. The endpoint requires latitude, longitude, and appid; units is optional. The default response format is JSON. See the Current Weather API documentation for the live parameter and response details.

Set units explicitly

Supported unit values are standard, metric, and imperial. If you omit units, the endpoint uses standard units, so do not assume the temperature is in Celsius or Fahrenheit. Add &units=metric for metric values or &units=imperial for imperial values. Choose one deliberately and label the units in your interface.

Read only the response fields your app needs

The response is JSON by default. Parse the fields documented for the endpoint rather than relying on assumptions about their names or structure. Handle the HTTP status and any API error response before trying to display weather data; a failed request is not a valid weather reading.

Rank #3
Ambient Weather WS-2000 Smart Weather Station
  • Allows you to monitor your home and backyard weather conditions with TFT color display
  • Wireless all-in-one integrated sensor array measures wind speed/direction, temperature, humidity, rainfall, UV and solar radiation
  • Supports both imperial and metric units of measure with calibration available
  • Enhanced Wi-Fi connectability option that enables your station to transmit its data wirelessly to the world's largest personal weather station network
  • Console power provided by 5V DC adapter (included), and sensor array requires 3 x AAA batteries (not included)

Convert a place name to coordinates

For a user-entered city or postal address, use OpenWeather’s Geocoding API to convert the place into coordinates, then pass those coordinates to the current-weather endpoint. This separates location lookup from weather retrieval and follows OpenWeather’s current recommendation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Although city-name, ZIP-code, and city-ID request styles remain available for the current-weather API, OpenWeather marks them deprecated and says they will not receive further bug fixes or updates. Prefer coordinates obtained through the Geocoding API for new integrations.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Handle errors and refresh requests responsibly

Build request handling around the status and response you actually receive. For example, do not treat a missing response as current weather, and avoid retrying rapidly when an account limit has been reached.

Rank #4
Sale
DreamSky Weather Station Indoor Outdoor Thermometer Wireless, Atomic Clock
  • Illuminated Indoor Outdoor Weather Station for Home with Large Colorful Display: The home weather station delivers large big numbers for weather forecast info, indoor outdoor temperature, atomic time, date, year and calendar day, which is super easy to read from afar.
  • Indoor outdoor Thermometer Wireless with High/Low Temperature Alert: The digital weather station supports 3 outdoor sensors which helps to monitor temperature and humidity of multiple locations (one sensor included). With the high/low temperature alert function, the weather station clock keeps you informed about the changes of weather thermometer outdoor.
  • WWVB Atomic Weather Station with Auto DST: Weather atomic clock with indoor/outdoor temp always keeps precise time and date by receiving the WWVB atomic signal. The self setting digital weather clock will automatically adjust to daylight saving time with auto DST feature, no more resetting twice a year.
  • Personal Weather Forecast Station: This weather stations wireless indoor outdoor predicts the next 12-24 hours weather condition with a 7-day calibration through the pressure of your location which provides you a better outing experience.
  • 5 Level Adjustable Backlight Brightness: The weather clock indoor outdoor temperature atomic with backlight dimmer function helps you avoid high-intensity light that disturb your sleep and easily check the weather situation during the day.
  • OpenWeather recommends making no more than one API call every 10 minutes for each location, reflecting a model update frequency no higher than once in 10 minutes.
  • Daily and per-minute limits depend on the account plan, and usage is pooled across keys and products at the account level.
  • If a request exceeds a limit and receives no response, OpenWeather’s getting-started guidance recommends trying again after 10 minutes. This is specific to that situation, not a universal retry rule for every error.

For other failures, use the endpoint’s current documentation and the error response to decide whether to correct the request, wait, or stop retrying. Apply the relevant product and subscription terms when choosing refresh intervals and retry behavior. See OpenWeather’s FAQ and usage guidance for account and request guidance.

Check One Call status and pricing before adopting it

The live catalog marks One Call API 3.0 as deprecated and features One Call API 4.0. If you need a combined timeline or alerts, start with the One Call API 4.0 documentation rather than copying older 3.0 examples. Confirm the exact 4.0 URL, parameters, response fields, availability, and migration notes in that documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenWeather’s pricing page currently lists One Call as pay-per-call: the first 1,000 calls per day are free, with additional calls priced at USD 0.0015 each. These are changeable commercial terms, not a permanent allowance or price. Check the current pricing page and your account’s applicable limits before estimating costs or deploying an integration.

Quick Recap

Bestseller No. 3
Ambient Weather WS-2000 Smart Weather Station
Ambient Weather WS-2000 Smart Weather Station
Allows you to monitor your home and backyard weather conditions with TFT color display; Supports both imperial and metric units of measure with calibration available
$299.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.