October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

OpenWeatherMap API: Set Up a Reliable Weather Request

Create an OpenWeatherMap account, make a coordinate-based weather request, choose units, and account for API limits and changing plan terms.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To use the OpenWeatherMap API, create an account, generate an API key, choose an endpoint, and send a request with the required parameters. For a first request that needs current conditions, use latitude and longitude with the current-weather endpoint; add a units parameter so temperature values are easy to interpret. Store the key securely, select a product that fits the data you need, and check the current usage terms before polling or deploying.

Choose the right OpenWeatherMap API

Start with the data your application needs. The current-weather endpoint is enough when you only need present conditions. Choose a forecast, timeline, or specialized API when you need information beyond current weather. OpenWeather’s API catalog lists its products; availability and terms can vary by product and subscription.

As an Amazon Associate I earn from qualifying purchases.

Need Product direction What to check
Conditions now Current Weather API Use coordinates for location selection and choose units explicitly.
Short-range forecast A forecast API Check the endpoint’s forecast coverage and subscription availability in its current documentation.
Combined weather timeline or alerts One Call API 4.0 OpenWeather’s catalog marks One Call 3.0 deprecated and features 4.0. Confirm current endpoint syntax and terms before implementation.
Air quality, historical data, maps, or another specialized need The corresponding specialized API Check the product documentation for coverage, parameters, availability, and cost.

For new integrations, do not copy One Call 3.0 examples without checking migration information. Use the current One Call 4.0 documentation; endpoint details and commercial terms can change.

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 account through OpenWeather’s getting-started page.

    #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)
  2. Find your API key in your account and use it as the appid parameter in requests. The key is required for API calls.

  3. Keep the key in an environment variable or server-side configuration. Do not place a real key in public browser code, screenshots, or a public repository. If a browser-based app must call the API directly, consider routing requests through a backend so the key is not exposed to visitors.

Make a first current-weather request

The documented current-weather request uses latitude, longitude, and an API key. Replace the placeholders with your coordinates and key:

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={lat}&lon={lon}&appid={API_key}&units=metric

The URL above uses units=metric, which returns metric values. You can also request standard or imperial; if you omit units, the endpoint uses standard units. JSON is the default response format. See the current-weather documentation for parameters and response details.

For example, a JavaScript request can read the temperature and weather description from the returned JSON:

const url = new URL("https://api.openweathermap.org/data/2.5/weather");
url.searchParams.set("lat", latitude);
url.searchParams.set("lon", longitude);
url.searchParams.set("appid", apiKey);
url.searchParams.set("units", "metric");

const response = await fetch(url);
if (!response.ok) {
  throw new Error(`Weather request failed: ${response.status}`);
}

const weather = await response.json();
console.log(weather.main.temp, weather.weather[0].description);

This example assumes latitude, longitude, and apiKey are already available to the code. In a server-side application, load the key from configuration rather than hard-coding it. Check the endpoint documentation for the full response schema before relying on additional fields.

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 latitude and longitude, then pass those coordinates to the weather endpoint. The current-weather documentation recommends geocoding rather than its built-in city-name, ZIP-code, or city-ID request methods, which are deprecated and no longer receive bug fixes or updates.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Keep the geocoding result associated with the place the user selected, especially when names are ambiguous. Send the returned coordinates to the current-weather request rather than treating a place name as a guaranteed unique location.

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

Handle errors and refresh at a sensible rate

Check the HTTP response before parsing JSON, as in the example above. When a request fails, inspect the status and response details, then distinguish an invalid request or key from a usage-limit issue. Avoid automatically retrying every error with the same request.

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.
  • Check the account’s applicable limits. OpenWeather says daily and per-minute limits apply, and usage is pooled across API keys and subscribed products for the account.
  • Avoid excessive polling. OpenWeather’s guidance recommends no more than one API call every 10 minutes per location, reflecting its stated model update frequency. This is guidance for per-location refresh cadence, not a substitute for checking your plan’s limits.
  • For a limit-related missing response, follow the documented recovery guidance. OpenWeather’s getting-started page recommends trying again after 10 minutes when a limit is exceeded and no response is received. This is not a universal retry rule for other failures.

Use a cache where it suits the application, and avoid having multiple clients independently request the same location at unnecessarily short intervals. That helps keep account-wide usage under control.

Check One Call availability and cost before deployment

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 current commercial terms published by OpenWeather, not a guarantee that pricing will remain unchanged. Review the live pricing page and the terms for your selected product before estimating costs or releasing an integration.

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

Because account usage is aggregated across keys and subscribed products, evaluate expected traffic across the account rather than assuming each key has a separate allowance. Check the specific subscription for applicable limits and availability.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.