# Spain Electricity Price API (PVPC)

> Spain Electricity Price API (PVPC) is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-14).

Returns hourly PVPC electricity prices for Spain for a given day, including cheapest/most expensive hours and the optimal 3-hour window.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/spain-electricity-price?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-electricity-price-api-pvpc-59be0de2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HixlUFI_efhPnCukWTSwN

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-electricity-price-api-pvpc-59be0de2 -d '<json body>'
```

Example prompt: What are Spain's hourly PVPC electricity prices for tomorrow, and which 3-hour window is cheapest to run high-consumption appliances?

## When to prefer this

Use this endpoint when you need official PVPC electricity pricing data for Spain on a per-hour granularity, especially for scheduling energy-intensive tasks, EV charging, or home automation. It is the authoritative source sourced directly from Red Eléctrica de España and provides pre-computed cheapest/most-expensive rankings and the optimal 3-hour window — saving additional computation. Prefer this over generic energy APIs when the user's context is specifically Spain mainland PVPC pricing.

## Known failure modes

- Date not yet available (tomorrow's prices may not be published until late afternoon the previous day)
- Invalid date format returns an error
- Prices for dates far in the past or future may be unavailable
- Network or upstream REE API outage returns a service error

## How this service works

558 pay-per-call data APIs for AI agents: Solana and EVM on-chain data, tokenized stocks, DeFi, Hyperliquid, economy and official statistics, FX, validation, web and developer tools. Pay in USDC via x402.

## Output

A JSON object with the date, zone (e.g. Mainland), a full list of hourly prices in EUR/kWh and EUR/MWh, the top cheapest hours, the top most expensive hours, the daily average price in EUR/kWh, and the best consecutive 3-hour window with its start time and average price. Also includes a source note attributing the data to Red Eléctrica de España.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "description": "YYYY-MM-DD, hoy or mañana (default today)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2026-10-02",
  "note": "PVPC energy term including tolls and charges, excluding taxes. Source: Red Electrica de Espana (REE).",
  "zone": "Mainland",
  "hours": [
   {
    "time": "00:00",
    "eur_kwh": 0.1609,
    "eur_mwh": 160.9
   },
   {
    "time": "01:00",
    "eur_kwh": 0.14965,
    "eur_mwh": 149.65
   }
  ],
  "cheapest": [
   {
    "time": "14:00",
    "eur_kwh": 0.1297,
    "eur_mwh": 129.7
   },
   {
    "time": "15:00",
    "eur_kwh": 0.13736,
    "eur_mwh": 137.36
   }
  ],
  "avg_eur_kwh": 0.22065,
  "best_3h_window": {
   "since": "14:00",
   "avg_eur_kwh": 0.13719
  },
  "most_expensive": [
   {
    "time": "20:00",
    "eur_kwh": 0.37978,
    "eur_mwh": 379.78
   },
   {
    "time": "19:00",
    "eur_kwh": 0.35435,
    "eur_mwh": 354.35
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-electricity-price-api-pvpc-59be0de2/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)
