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

ModeExampleDescription
City weather?city=北京Current weather for a city
Coordinates?location=39.90,116.40Current weather by lat/lng
With forecast?city=北京&forecast=trueCurrent weather + 7-day forecast

Request Parameters

ParameterTypeRequiredDefaultDescription
citystringEither city or location-City name
locationstringEither city or location-Coordinates (lat,lng)
forecastboolNofalseInclude 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

FieldDescription
locationQuery location
current.tempCurrent temperature (°C)
current.textWeather condition
current.humidityRelative humidity (%)
current.wind_dirWind direction
current.wind_speedWind speed (km/h)
current.pressurePressure (hPa)
current.visVisibility (km)

7-Day Forecast (forecast=true)

FieldDescription
forecast[].dateDate
forecast[].temp_maxHigh temperature (°C)
forecast[].temp_minLow temperature (°C)
forecast[].text_dayDaytime weather
forecast[].text_nightNighttime weather

Pricing

$0.01/call (news). First 500 calls/month are free.

Updated 6 days ago
Did this page help you?