OpenWeatherMap APIopenweathermap.org ↗
Get current weather, 48-hour hourly forecasts, 8-day daily forecasts, and minutely precipitation data for any city or coordinate pair.
What is the OpenWeatherMap API?
This API exposes 3 endpoints that cover city search, coordinate-based weather retrieval, and a combined city-to-weather lookup against OpenWeatherMap. The get_weather endpoint returns up to 8 fields of forecast depth — current conditions, minutely precipitation for the next hour, hourly forecasts for 48 hours, and daily forecasts for 8 days — all indexed by latitude and longitude. The get_weather_by_city endpoint collapses city resolution and forecast retrieval into a single call.
curl -X GET 'https://api.parse.bot/scraper/98c25339-1e3f-49c0-8192-b1448748f87d/search_city?limit=5&query=London' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace openweathermap-org-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: OpenWeather SDK — search cities, fetch forecasts, drill into typed models."""
from parse_apis.openweather_scraper_api import OpenWeather, Units, CityNotFound
client = OpenWeather()
# Search for cities matching a query — limit caps total items fetched.
for city in client.cities.search(query="London", limit=3):
print(city.name, city.country, city.lat, city.lon)
# Construct a city by name and fetch its full weather report.
report = client.city("Tokyo").weather(units=Units.METRIC)
print(report.timezone, report.current.temp, report.current.humidity)
# Drill into the daily forecast for tomorrow's high/low.
today = report.daily[0]
print(today.summary, today.temp.max, today.temp.min)
# Fetch weather by coordinates directly.
try:
london_weather = client.weatherreports.get(lat="51.5073", lon="-0.1276", units=Units.IMPERIAL)
print(london_weather.timezone, london_weather.current.temp, london_weather.current.wind_speed)
except CityNotFound as exc:
print(f"City not found: {exc.query}")
print("exercised: cities.search / city.weather / weatherreports.get / daily forecast drill-down")
Search for cities by name and return their coordinates and country details. Returns an array of matching city objects with name, latitude, longitude, country code, state, and local name translations. Use this to resolve a city name to coordinates before calling get_weather.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of results to return |
| queryrequired | string | City name or search query (e.g., 'London', 'Paris, FR') |
{
"type": "object",
"fields": {
"cities": "array of city objects each containing name, lat, lon, country, state, and local_names"
},
"sample": {
"data": {
"cities": [
{
"lat": 51.5073219,
"lon": -0.1276474,
"name": "London",
"state": "England",
"country": "GB",
"local_names": {
"en": "London",
"fr": "Londres"
}
}
]
},
"status": "success"
}
}About the OpenWeatherMap API
Endpoints and What They Return
The search_city endpoint accepts a query string (e.g., 'Paris, FR') and an optional limit integer, returning an array of city objects. Each object includes name, lat, lon, country, state, and a local_names map with translations. This is the intended first step when you have a city name rather than coordinates.
The get_weather endpoint requires lat and lon strings and returns a weather object containing timezone, timezone_offset, and nested arrays: current conditions, minutely precipitation (next 60 minutes at 1-minute intervals), hourly forecasts (48 hours), and daily forecasts (8 days). Set units to 'metric' for Celsius and m/s, or 'imperial' for Fahrenheit and mph. Pass extended_hourly: true to receive an additional extended_hourly field covering up to 16 days of hourly data.
Combined Lookup
get_weather_by_city accepts a query string and optional units, resolves the first matching city, and returns the full weather payload alongside a location object — the same city object that search_city would return. This is useful when you want weather for a named place and do not need to inspect multiple city candidates first.
Coverage Notes
All three endpoints draw on OpenWeatherMap's global station and model data. The current block includes fields such as temperature, feels-like, humidity, wind speed, wind direction, cloud cover, UV index, visibility, and a weather array describing conditions with icon codes. The daily array adds moon_phase, summary, sunrise/sunset, and pop (probability of precipitation) per day.
The OpenWeatherMap API is a managed, monitored endpoint for openweathermap.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when openweathermap.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official openweathermap.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display a location's current temperature, humidity, and UV index in a dashboard using
get_weatherwith metric units. - Build a 7-day forecast widget by reading the
dailyarray fromget_weather_by_city. - Resolve ambiguous city names to coordinates with
search_citybefore passinglat/lonto weather endpoints. - Track hourly precipitation probability over the next 48 hours from the
hourlyarray for outdoor event planning. - Show minutely rain intensity for the next hour using the
minutelyfield to warn users of imminent precipitation. - Support imperial vs. metric user preferences by toggling the
unitsparameter onget_weatherorget_weather_by_city. - Generate extended 16-day hourly projections by enabling the
extended_hourlyflag onget_weather.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does OpenWeatherMap have an official developer API?+
What does the `daily` forecast array contain?+
daily array includes date, sunrise, sunset, temperature (day, night, min, max, morning, evening), feels-like temperatures, pressure, humidity, wind speed and direction, cloud cover, UV index, precipitation probability (pop), rain or snow volume, moon phase, and a weather array with a condition code and icon.Does `get_weather_by_city` return results for multiple matching cities?+
search_city first, then pass the chosen lat and lon to get_weather directly.Is historical weather data available through this API?+
Are weather alerts (e.g., storm warnings) included in the response?+
get_weather response includes current conditions and forecasts but does not contain an alerts array for severe weather warnings. You can fork this API on Parse and revise it to surface the alerts field if OpenWeatherMap returns it for your target location.