Skip to content

API Reference

Spec v1.0 · Service rolling out

The HTTP API below is the interface specification. Field names, units and accumulation conventions are identical to the CSV data specification. CSV delivery is the primary channel today; the HTTP service opens progressively per customer onboarding — please confirm the delivery method with sales.

General Conventions

  • Responses use a unified { code, message, data } structure; code = 0 means success;
  • Time parameters are Beijing-time ISO 8601 (with offset); the issue time (issue) is UTC;
  • Field units match the CSV specification (K, Pa, J/m² accumulated); conversions are the caller's responsibility (see Usage Notes).

Endpoints

MethodPathDescription
GET/api/v1/farmsSite list (farm_id, coordinates)
GET/api/v1/forecast/issuesAvailable model-run (issue) list
GET/api/v1/forecastQuery forecast data (main endpoint)

Query Forecast Data

GET /api/v1/forecast

Request Parameters

ParamTypeRequiredDescription
farm_idstringone of farm_id / coordsSite ID, e.g. HuaR_093
londecimalone of farm_id / coordsLongitude; must be provided together with lat
latdecimalone of farm_id / coordsLatitude
issuestringnoIssue time (UTC, yyyyMMddHH); defaults to the latest run
startstringnoStart valid time (Beijing time, ISO 8601); defaults to +0h
endstringnoEnd valid time; defaults to +360h
elementsstring[]noField subset; defaults to all 15 data fields
page / sizeintnoPagination; default size = 96 (one day)

Request Example

bash
curl "http://api.example.com/api/v1/forecast
     ?farm_id=HuaR_093
     &start=2026-08-27T20:00:00
     &end=2026-08-28T20:00:00
     &elements=t2m,spd100,tr"

Response Example (HTTP 200)

json
{
  "code": 0,
  "message": "ok",
  "data": {
    "farm_id": "HuaR_093",
    "lat": 36.35208,
    "lon": 102.95839,
    "issue_time_utc": "2026-08-27T12:00:00Z",
    "timezone": "UTC+8",
    "resolution_minutes": 15,
    "total": 96,
    "items": [
      {
        "date_time": "2026-08-27T20:00:00+08:00",
        "t2m": 289.08,
        "spd100": 2.83,
        "tr": 0.0
      }
    ]
  }
}

Error Codes

HTTPcodeDescription
40040001Missing or malformed parameter
40440401farm_id or issue time not found
42242201Coordinates out of service range
50050000Internal server error

WeatherFine Data · Site-level NWP data service