# Spain Traffic Incidents API

> Spain Traffic Incidents API is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-11).

Returns real-time road traffic incidents in Spain from the official DGT DATEX II feed, filterable by road, province, and cause.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/spain-traffic-incidents?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-traffic-incidents-api-16ed45b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QcqXfEr46IF5DKdZRkrGX

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 spain-traffic-incidents-api-16ed45b1 -d '<json body>'
```

Example prompt: Can you pull up current traffic incidents on the M-50 road in Madrid province from the Spanish DGT feed, and show me what's causing the disruptions?

## When to prefer this

Choose this endpoint when you need real-time, official Spanish road traffic incident data sourced directly from the DGT DATEX II national access point. It is the authoritative source for Spain-specific incidents with precise geolocation, affected lane info, and cause classification. Prefer this over generic mapping APIs when you need structured, filterable incident data for Spain and want to pay per-call in USDC without a subscription.

## Known failure modes

- Missing required 'input' wrapper object returns validation error
- Invalid cause or road values may return empty incident list rather than an error
- DGT upstream data feed may be temporarily unavailable causing no results or stale data
- Province name misspellings may return empty results without indication of the error
- Exceeding rate limits or insufficient USDC balance returns payment/authorization error

## How this service works

Active traffic incidents on Spanish roads from the DGT: roadworks, accidents, queues, closures, adverse weather..., with road, kilometre point, province, municipality, coordinates and start time; filter by province, road and cause.

## Output

A JSON object containing the total number of active incidents, the data source (DGT DATEX II), a summary breakdown of incidents by cause (works, road damage, adverse weather, stopped vehicle), and a list of individual incident records each with road identifier, kilometer marker, latitude/longitude, type, cause, affected lanes, direction, severity, province, municipality, autonomous community, and timestamp.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [],
     "properties": {
      "road": {
       "type": "string"
      },
      "cause": {
       "type": "string"
      },
      "limit": {
       "type": "integer"
      },
      "province": {
       "type": "string"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": [
      "object",
      "null"
     ],
     "properties": {
      "total": {
       "type": [
        "number",
        "null"
       ]
      },
      "source": {
       "type": [
        "string",
        "null"
       ]
      },
      "by_cause": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "works": {
         "type": [
          "number",
          "null"
         ]
        },
        "road damage": {
         "type": [
          "number",
          "null"
         ]
        },
        "adverse weather": {
         "type": [
          "number",
          "null"
         ]
        },
        "stopped vehicle": {
         "type": [
          "number",
          "null"
         ]
        }
       }
      },
      "incidents": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": [
         "null",
         "object"
        ],
        "properties": {
         "km": {
          "type": [
           "null",
           "string"
          ]
         },
         "lat": {
          "type": [
           "null",
           "number"
          ]
         },
         "lon": {
          "type": [
           "null",
           "number"
          ]
         },
         "road": {
          "type": [
           "null",
           "string"
          ]
         },
         "type": {
          "type": [
           "null",
           "string"
          ]
         },
         "cause": {
          "type": [
         
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "total": 48,
  "source": "DGT, Spanish National Traffic Access Point (DATEX II)",
  "by_cause": {
   "works": 17,
   "road damage": 2,
   "adverse weather": 3,
   "stopped vehicle": 26
  },
  "incidents": [
   {
    "km": "37.0",
    "lat": 40.335796,
    "lon": -3.6228495,
    "road": "M-50",
    "type": "RoadOrCarriagewayOrLaneManagement",
    "cause": "obras",
    "lanes": "leftLane",
    "since": "2026-07-10T10:55:00.000+02:00",
    "province": "Madrid",
    "severity": null,
    "community": "Madrid, Comunidad de",
    "direction": "northEastBound",
    "municipality": "Madrid"
   },
   {
    "km": "38.0",
    "lat": 40.331955,
    "lon": -3.6335533,
    "road": "M-50",
    "type": "RoadOrCarriagewayOrLaneManagement",
    "cause": "obras",
    "lanes": "_extended",
    "since": "2026-07-10T10:55:00.000+02:00",
    "province": "Madrid",
    "severity": null,
    "community": "Madrid, Comunidad de",
    "direction": "westBound",
    "municipality": "Madrid"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-traffic-incidents-api-16ed45b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
