DocumentationWeather API
Weather API
Real-time weather conditions and 7-day forecast
Overview
GET /v1/life/weather provides real-time weather data and 7-day forecasts. Supports lookup by city name or coordinates.
Usage Modes
| Mode | Example | Description |
|---|---|---|
| City weather | ?city=北京 | Current weather for a city |
| Coordinates | ?location=39.90,116.40 | Current weather by lat/lng |
| With forecast | ?city=北京&forecast=true | Current weather + 7-day forecast |
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
city | string | Either city or location | - | City name |
location | string | Either city or location | - | Coordinates (lat,lng) |
forecast | bool | No | false | Include 7-day forecast |
Request Examples
City Weather
curl -H "X-API-Key: sk_gapi_xxxxx" \
"https://api.groundapi.net/v1/life/weather?city=北京"With Forecast
curl -H "X-API-Key: sk_gapi_xxxxx" \
"https://api.groundapi.net/v1/life/weather?city=上海&forecast=true"Response Fields
Current Weather
| Field | Description |
|---|---|
location | Query location |
current.temp | Current temperature (°C) |
current.text | Weather condition |
current.humidity | Relative humidity (%) |
current.wind_dir | Wind direction |
current.wind_speed | Wind speed (km/h) |
current.pressure | Pressure (hPa) |
current.vis | Visibility (km) |
7-Day Forecast (forecast=true)
| Field | Description |
|---|---|
forecast[].date | Date |
forecast[].temp_max | High temperature (°C) |
forecast[].temp_min | Low temperature (°C) |
forecast[].text_day | Daytime weather |
forecast[].text_night | Nighttime weather |
Pricing
$0.01/call (news). First 500 calls/month are free.
Updated 6 days ago