# WeatherXM Agent API – Historical Weather Data

> WeatherXM Agent API – Historical Weather Data is a paid API for AI agents from agent.weatherxm.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Returns hourly historical weather data (temperature, humidity, wind speed, precipitation) for a specific location and date, up to 4 days in the past

## Facts

- Endpoint: GET https://agent.weatherxm.com/api/history
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/weatherxm-agent-api-historical-weather-data-91fb53b3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Jp0FxxPZ2C30lmmSQfJkj

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability weatherxm-agent-api-historical-weather-data-91fb53b3
```

Example prompt: What was the hourly weather like at latitude 37.98, longitude 23.73 on January 1st, 2025 — I need temperature, humidity, wind speed, and precipitation in metric units, with the Europe/Athens timezone.

## When to prefer this

Use this endpoint when you need granular hourly weather history for a specific geographic coordinate and date within the past 4 days. Prefer this over forecast endpoints when the date is in the past, and over current-weather endpoints when you need a full day's hourly breakdown rather than a snapshot.

## Known failure modes

- Date older than 4 days returns an error or empty data
- Invalid latitude/longitude range causes a 400 bad request
- Malformed date format (not YYYY-MM-DD) causes a validation error
- No weather station coverage near the requested coordinates may return sparse or null data
- Missing required query params (lat, lon, date) causes a 400 error

## How this service works

Historical weather data (up to 4 days)

## Output

A JSON object containing hourly weather records for the requested date and location, including temperature, humidity, wind speed, and precipitation values, plus the resolved location coordinates and timezone.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "lat",
      "lon",
      "date"
     ],
     "properties": {
      "tz": {
       "type": "string",
       "description": "IANA timezone (e.g., Europe/Athens) or \"auto\""
      },
      "lat": {
       "type": "number",
       "description": "Latitude (-90 to 90)"
      },
      "lon": {
       "type": "number",
       "description": "Longitude (-180 to 180)"
      },
      "date": {
       "type": "string",
       "description": "Date in YYYY-MM-DD format (up to 4 days ago)"
      },
      "units": {
       "enum": [
        "metric",
        "imperial"
       ],
       "type": "string",
       "description": "Unit system: \"metric\" (default) or \"imperial\""
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "description": "Historical weather data for the specified location"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2025-01-01",
  "units": "metric",
  "hourly": [
   {
    "time": "2025-01-01T00:00:00+02:00",
    "humidity": 70,
    "windSpeed": 8.2,
    "temperature": 12.5,
    "precipitation": 0
   }
  ],
  "location": {
   "lat": 37.98,
   "lon": 23.73
  },
  "timezone": "Europe/Athens"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/weatherxm-agent-api-historical-weather-data-91fb53b3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.weatherxm.com](https://www.zero.xyz/host/agent.weatherxm.com/llms.txt)
