wttr.in API
wttr.in is a free console-oriented weather API with no key. Get weather as plain text, ASCII art, PNG or full JSON with one curl command. Live example included.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the wttr.in API?
wttr.in is a free weather service designed to be called from the terminal with curl. It requires no API key and can return weather as formatted plain text, ASCII art, a PNG image or structured JSON, based purely on the URL you request.
wttr.in is the weather API that became famous because `curl wttr.in` just works. Requesting the bare hostname returns a colour-formatted three-day forecast rendered as text art, which makes it a favourite for shell prompts, tmux status bars and server MOTD banners.
For programmatic use, appending `?format=j1` switches it to a full JSON document containing current conditions and a three-day forecast in one response. That single-request completeness is its main advantage over APIs that make you assemble several calls.
Quick facts
- Base URL
https://wttr.in- Authentication
- No key. Please set a descriptive User-Agent and avoid hammering the service — it is run by a single maintainer.
- Rate limit
- Not formally published. Informal fair use; heavy scripted polling may be throttled by IP.
- Pricing
- Completely free and open source. Self-hosting is supported for high-volume use.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the wttr.in API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Full JSON weather for London
GET https://wttr.in/London?format=j1
curl 'https://wttr.in/London?format=j1'const res = await fetch("https://wttr.in/London?format=j1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://wttr.in/London?format=j1", timeout=20)
res.raise_for_status()
print(res.json()){
"current_condition": [
{
"FeelsLikeC": "19",
"FeelsLikeF": "66",
"cloudcover": "99",
"humidity": "46",
"observation_time": "11:52 AM",
"precipInches": "0.0",
"precipMM": "0.1",
"pressure": "1007",
"pressureInches": "30",
"temp_C": "21",
"temp_F": "70",
"uvIndex": "5",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "176",
"weatherDesc": [
{
"value": "Patchy rain nearby"
}
],
"weatherIconUrl": [
{
"value": "https://cdn.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0009_light_rain_showers.png"
}
],
"winddir16Point": "WSW",
"winddirDegree": "255",
"windspeedKmph": "13",
"windspeedMiles": "8"
}
],
"nearest_area": [
{
"areaName": [
{
"value": "London"
}
],
"country": [
{
"value": "United Kingdom"
}
],
"latitude": "51.517",
"longitude": "-0.106",
"population": "7421228",
"region": [
{
"value": "City of London Greater London"
}
],
"weatherUrl": [
{
"value": "https://www.worldweatheronline.com/v2/weather.aspx?q=51.508,-0.121"
}
]
}
],
"request": [
{
"query": "Lat 51.51 and Lon -0.13",
"type": "LatLon"
}
],
"weather": [
{
"astronomy": [
{
"moon_illumination": "39",
"moon_phase": "Waxing Crescent",
"moonrise": "Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<location> | path | Optional | City, airport code, IP, GPS coords or `~PlaceName`. Empty means geolocate by IP. London |
format | string | Optional | `j1` for full JSON, `j2` for a compact variant, or a custom one-line template. j1 |
lang | string | Optional | Two-letter language code for text output. de |
u / m | flag | Optional | Force USCS (`u`) or metric (`m`) units. m |
Response fields
current_conditionarray- Single-element array with the current observation — temp_C, temp_F, humidity, weatherDesc and more.
weatherarray- Three days of forecast, each with `hourly` entries at three-hour intervals.
nearest_areaarray- The resolved location, useful for confirming the service understood your query.
requestarray- Echo of how your query was interpreted (query type and value).
What you can build with the wttr.in API
- Show the weather in a terminal prompt, tmux bar or server login banner
- Fetch a complete three-day forecast in a single request with format=j1
- Generate a weather PNG for embedding in a README or status page
- Quick weather lookups in shell scripts and CI jobs without key management
Common errors and how to fix them
404
The location string could not be resolved.
Fix: Try a larger nearby city, an airport code, or explicit `lat,lon` coordinates.
503
Upstream weather source temporarily unavailable, or you are being throttled.
Fix: Back off and retry after a minute; cache results rather than polling in a loop.
wttr.in API — frequently asked questions
How do I get JSON from wttr.in instead of ASCII art?
Append `?format=j1` to the URL. For example `curl 'https://wttr.in/London?format=j1'` returns a full JSON document with current conditions and a three-day forecast.
Does wttr.in need an API key?
No. It is completely key-free and open source. For heavy or commercial use the maintainer recommends self-hosting your own instance rather than polling the public one.
Can wttr.in detect my location automatically?
Yes. Requesting the bare hostname geolocates by your IP address. That is approximate and will be wrong behind a VPN, so pass an explicit location for anything user-facing.
What is the difference between format=j1 and format=j2?
Both return JSON; `j1` is the full document including hourly forecast arrays, while `j2` is a trimmed variant. Use `j1` unless response size is a concern.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Unit Converter
Convert between units of length, weight, temperature, area, volume, speed, time and data storage instantly, with a swap button and common conversion tables.
wttr.in is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.