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.

When to Use

  • Current weather: "What's the weather in Beijing?" → ?city=北京 (or ?city=Beijing)
  • Week-ahead planning: "Weather forecast for the week" → ?city=北京&forecast=true
  • Device GPS-based: When you have user coordinates, use ?location=lat,lng for higher precision than city name
  • Multilingual: city accepts Chinese (北京) or English (Beijing / Tokyo)
  • AI Agent everyday tasks: Morning greetings / outfit suggestions / travel planning all rely on this

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. First 500 calls/month are free.

Updated 1 month ago
Did this page help you?