TL;DR
What it does: Provides 7‑day global weather forecasts (temperature, wind, precipitation) from a Chinese service.
Quick start: curl "http://www.7timer.info/bin/api.pl?lon=113&lat=23&product=civillight&output=json"
No API key needed – just request the URL
Overview
7Timer is a free numerical weather‑forecast service originally built in China. It offers worldwide coverage: give any longitude/latitude and receive a JSON payload with the forecast for the next several days. The API is public, has no rate limits documented, and is ideal for quick weather widgets, educational projects, or prototype apps.
Live Example
Below is a real request to the API and the exact JSON response you’ll receive.
The URL to call (forecast for Shenzhen, China):
http://www.7timer.info/bin/api.pl?lon=113&lat=23&product=civillight&output=json
Try This URL Now →
The actual response you get (truncated):
{
"product": "civillight",
"init": "2026061500",
"dataseries": [
{
"date": 20260615,
"weather": "lightrain",
"temp2m": {"max": 30, "min": 26},
"wind10m_max": 2
},
{
"date": 20260616,
"weather": "cloud",
"temp2m": {"max": 31, "min": 25},
"wind10m_max": 2
}
]
}
What does this data mean?
Key parts of the JSON response:
- product
- Type of forecast model used – e.g., `civillight` for a lightweight civil forecast.
- init
- Initialization timestamp (YYYYMMDDHH) of the model run.
- dataseries
- An array of daily forecast objects. Each object includes:
- date – YYYYMMDD integer.
- weather – description (`cloud`, `lightrain`, `snow`, etc.).
- temp2m.max / min – maximum and minimum temperature at 2 m (°C).
- wind10m_max – maximum wind speed at 10 m (m/s).
How to use this API
JavaScript Example
const lon = 113; // Shenzhen longitude
const lat = 23; // Shenzhen latitude
const url = `http://www.7timer.info/bin/api.pl?lon=${lon}&lat=${lat}&product=civillight&output=json`;
fetch(url)
.then(r => r.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Python Example
import requests
lon, lat = 113, 23
url = f"http://www.7timer.info/bin/api.pl?lon={lon}&lat={lat}&product=civillight&output=json"
resp = requests.get(url)
print(resp.json())
cURL Example
# Shenzhen (China) forecast – civil lightweight model
curl "http://www.7timer.info/bin/api.pl?lon=113&lat=23&product=civillight&output=json"
# Change product to `light` for a more detailed forecast
curl "http://www.7timer.info/bin/api.pl?lon=113&lat=23&product=light&output=json"
# Get forecast for New York, USA (lon=-74, lat=40.7)
curl "http://www.7timer.info/bin/api.pl?lon=-74&lat=40.7&product=civillight&output=json"
Frequently Asked Questions
- Is the 7Timer API free for commercial use?
- Yes. The service is public, free, and can be used in commercial projects without attribution (though credit is appreciated).
- Are there any rate limits?
- The documentation does not specify strict limits; typical usage for prototypes or small applications works without throttling.
- Can I request forecasts for any coordinate?
- Absolutely – supply any longitude and latitude values (global coverage). The API will return a forecast for the nearest grid point.
- What forecast products are available?
- Common `product` values include `civillight` (lightweight civil forecast), `light` (more detailed), and `full` (full‑resolution model). Each returns a different level of detail.
- What units are used for temperature and wind?
- Temperatures are in °C. Wind speeds are in meters per second (m/s).
- How often is the data refreshed?
- The model runs roughly every 6 hours; the `init` field shows the latest model run timestamp.
API Details
- Base URL
http://www.7timer.info/bin/api.pl- Documentation
- http://www.7timer.info/doc.php?lang=en
- Category
- Weather
- Authentication
- None required – completely free
- Coverage
- Global (service originates from China)
- CORS
- Yes – can be called directly from browsers