OpenWeatherMap API
Jul 10,2026

GISBox is a one-stop 3D GIS data editing, conversion and publishing platform that supports editing in multiple GIS formats such as OSGB/GEOTIFF/RVT, converting to 3DTiles/Terrain and publishing.

Introduction

OpenWeatherMap API is an open weather data service that provides global real-time weather, minute-level precipitation forecasts, 48-hour hourly forecasts, 8-day daily forecasts, national-scale weather alerts, and more than 40 years of historical weather data. Developers can access it with an API key and retrieve responses in JSON or XML format, then integrate it into websites, mobile applications, or IoT devices. This makes it suitable for location-based dynamic weather display and intelligent decision support. It is especially widely used in map platforms for visualizing weather layers and delivering real-time alerts to end users.

File Structure

The structure of the OpenWeatherMap API can be understood in three parts: request path, parameter specification, and response format.

  • Base path: All requests are based on https://api.openweathermap.org/data/2.5, with different subpaths used for different functions.
  • Core endpoints: /weather (current weather), /forecast (5-day forecast in 3-hour intervals), /onecall (integrated data including precipitation and alerts), /geocoding (coordinate and place-name conversion).
  • Required parameters: appid (API key), plus location parameters such as q, lat/lon, or zip.
  • Optional parameters: units (temperature unit), lang (language), and mode (json or xml).
  • Response structure: Usually returned in JSON format, containing standard fields such as coord, weather, main (temperature, pressure, humidity), wind, clouds, and dt (timestamp).
  • Specification basis: The API follows OpenAPI 3.0, helping ensure interface consistency and cross-platform compatibility.

Pros

  1. Broad global coverage: Supports real-time weather and forecast data for more than 200,000 cities worldwide, making it suitable for international applications.
  2. Accessible free tier: The basic free plan provides a usable request quota for personal projects and lightweight commercial applications.
  3. Rich data dimensions: In addition to temperature, humidity, wind speed, and air pressure, it also provides extra indicators such as AQI, UVI, and probability of precipitation.
  4. Easy and efficient integration: Supports JSON and XML responses, has clear documentation, and is widely used in web, mobile, and map platforms such as Leaflet and Google Maps.
  5. Language and unit flexibility: Developers can switch language settings, such as zh_cn, and choose temperature units in Celsius, Fahrenheit, or Kelvin to improve user experience.

Cons

  1. Free-tier request limits: High-frequency applications or commercial scenarios may require a paid upgrade, and quota limits can become a constraint.
  2. Unstable response under high concurrency: During peak request periods, delays or timeouts may occur, which can affect scenarios with strict real-time requirements.
  3. Limited disaster warning capability: Compared with specialized meteorological providers, its lead time and precision for extreme-weather alerts may be less strong in some regions.
  4. Lack of advanced meteorological parameters: It does not provide some professional-grade data such as radar reflectivity, cloud vertical profiles, or detailed wind-field vectors, which limits its use in research or aviation.
  5. No official SLA for free service: The free plan does not provide service-level guarantees for availability or response time, which introduces risk for production deployment.
  6. Incomplete data in some regions: Remote areas or cities in some developing regions may have delayed updates or missing values.

Application Scenario

The OpenWeatherMap API is widely used in location-based intelligent systems to provide real-time weather information and dynamic forecasts for mobile applications, websites, and IoT devices. It is commonly used on map platforms such as Leaflet and Google Maps to overlay weather layers and visualize precipitation radar, temperature heatmaps, and wind fields. In smart agriculture, it can support irrigation decisions. In transportation and logistics, it helps optimize route planning to avoid severe weather. In smart home systems, it can be linked with temperature control and ventilation devices. It is also useful for outdoor activity platforms, tourism services, and emergency alert systems, where localized weather support is important. In cities such as Hangzhou, China, developers can make use of its high-precision geolocation support to provide minute-level rainfall alerts and urban heat-island analysis.

Example

1. OpenWeatherMap API provides comprehensive global weather data.

Snipaste_2026-06-18_09-36-07_1781746788152.jpg

File Opening Mode

1. Use an OpenWeatherMap API wrapper to retrieve weather data, as shown in the following code example.

Snipaste_2026-06-18_09-43-08_1781747047660.jpg

Related GIS Services

LocationIQ API

Geoapify Maps & Location API

Stadia Maps API

Thunderforest Maps API

References

  1. https://openweathermap.org/api
  2. https://publicapi.dev/open-weather-map-api
  3. https://github.com/bifot/openweathermap-api