Solar PV history (satellite)
GET /api/solar-historySatellite-measured solar resource for a past range of up to a year at any place: plane-of-array irradiation for your tilt and azimuth and the PV yield per kW peak by month...
Details
Satellite-measured solar resource for a past range of up to a year at any place: plane-of-array irradiation for your tilt and azimuth and the PV yield per kW peak by month, with the year's total and its best and worst months, for siting and finance. Coverage and start year depend on the satellite over the place. By coordinates or place name. Cached for up to 60 minutes. ?place=Madrid&start=2024-01-01&end=2024-12-31. Weather data by Open-Meteo.com (CC BY 4.0).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lat | number | no | Latitude, -90 to 90 (with lon; wins over place) The example sends 40.4168. |
lon | number | no | Longitude, -180 to 180 (with lat) The example sends -3.7038. |
place | string | no | A city, town or region name instead of lat/lon, for example "Paris" or "Austin, TX" (not a street address); the answer echoes the place it resolved to Up to 100 characters. |
start | string | no | First day, YYYY-MM-DD, 1983 or later (default one year before yesterday) The example sends 2024-01-01. |
end | string | no | Last day, YYYY-MM-DD (default yesterday); at most 366 days in all The example sends 2024-12-31. |
tilt | number | no | Panel tilt from horizontal, 0-90 degrees (default 30) The example sends 30. |
azimuth | number | no | Panel azimuth, -180 to 180 degrees: 0 faces south, -90 east, 90 west, 180 north (default 0) |
capacityKw | number | no | System size in kW peak, 0.001-1000000 (default 1) |
performanceRatio | number | no | Share of plane-of-array energy delivered as AC, 0.1-1 (default 0.8) |
Example request
curl -i "https://agent402.tools/api/solar-history?lat=40.4168&lon=-3.7038&start=2024-01-01&end=2024-12-31&tilt=30"
Watch a call get paid
GET /api/solar-history$0.005 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"lat": 40.4168,
"lon": -3.7038,
"start": "2024-01-01",
"end": "2024-12-31",
"system": {
"tilt": 30,
"azimuth": 0,
"capacityKw": 1,
"performanceRatio": 0.8
},
"totals": {
"irradiationKwhM2": 1952.8,
"energyKwh": 1562.2,
"yieldKwhPerKwp": 1562.2,
"hoursMissing": 0
},
"months": [
{
"month": "2024-01",
"irradiationKwhM2": 96.2,
"energyKwh": 77,
"yieldKwhPerKwp": 77
}
],
"best": {
"month": "2024-07",
"yieldKwhPerKwp": 186.4
},
"worst": {
"month": "2024-01",
"yieldKwhPerKwp": 77
},
"method": "Energy = plane-of-array irradiation (kWh/m²) x capacityKw x performanceRatio, the standard yield estimate at 1 kW/m² test conditions. It assumes no shading, snow or curtailment.",
"source": "satellite-api.open-meteo.com (CC BY 4.0)",
"attributionText": "Weather data by Open-Meteo.com (CC BY 4.0).",
"sourceUrl": "https://open-meteo.com/",
"licenseUrl": "https://creativecommons.org/licenses/by/4.0/"
}| Field | Type | Always present | In the example |
|---|---|---|---|
lat | number | yes | 40.4168 |
lon | number | yes | -3.7038 |
start | string | yes | 2024-01-01 |
end | string | yes | 2024-12-31 |
system | object | yes | 4 fields: tilt, azimuth, capacityKw and 1 more |
totals | object | yes | 4 fields: irradiationKwhM2, energyKwh, yieldKwhPerKwp and 1 more |
months | array of objects | yes | 1 item in the example |
best | object | yes | 2 fields: month and 1 more |
worst | object | yes | 2 fields: month and 1 more |
method | string | yes | Energy = plane-of-array irradiation (kWh/m²) x capacityKw x performanceRatio,... |
source | string | yes | satellite-api.open-meteo.com (CC BY 4.0) |
attributionText | string | yes | Weather data by Open-Meteo.com (CC BY 4.0). |
sourceUrl | string | yes | https://open-meteo.com/ |
licenseUrl | string | yes | https://creativecommons.org/licenses/by/4.0/ |
From an MCP client
catalog.call {
"slug": "solar-history",
"params": {
"lat": 40.4168,
"lon": -3.7038,
"start": "2024-01-01",
"end": "2024-12-31",
"tilt": 30
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.19.2): pays from a wallet or AGENT402_CREDITS_KEY.
Errors and behavior
- Pay $0.005 per call over x402 or MPP. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - Every field is optional; a rejected input answers 4xx with
error,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A
POSTwith a JSON body is served as this GET. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.005" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/solar-history?lat=40.4168&lon=-3.7038&start=2024-01-01&end=2024-12-31&tilt=30");Get a wallet or run npx -y agent402-mcp@0.19.2 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/solar-history?lat=40.4168&lon=-3.7038&start=2024-01-01&end=2024-12-31&tilt=30", method="GET", headers={})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units