PVWatts API

Beginner's Pick Environment / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

PVWatts is a NREL (National Renewable Energy Laboratory) API that estimates the energy production of grid-connected photovoltaic (solar panel) systems anywhere in the world. It requires a free API key from developer.nrel.gov and accepts system parameters like capacity, tilt, and azimuth to return annual and monthly energy output estimates. It is widely used by solar installers, researchers, and green energy app developers.

Beginner Tip

Get a free API key instantly at developer.nrel.gov — no approval needed. The minimum required parameters are system_capacity (kW), azimuth, tilt, array_type, module_type, losses, and a lat/lon location; start with default tilt and azimuth values for your latitude and the API will return estimated kWh per year.

Available Data

PVWatts data via REST API

Example Response

JSON Response
{
  "id": "Dwu85P9SOIk",
  "urls": {
    "full": "https://images.unsplash.com/photo-...",
    "regular": "https://images.unsplash.com/photo-...?w=1080",
    "thumb": "https://images.unsplash.com/photo-...?w=200"
  },
  "width": 4000,
  "height": 3000,
  "user": {
    "name": "John Doe",
    "username": "johndoe"
  }
}

Field Reference

outputs.ac_annual Estimated annual AC energy production in kilowatt-hours (kWh) for the specified solar system
outputs.ac_monthly Array of 12 monthly AC energy production values in kWh, from January to December
outputs.solrad_annual Annual average solar irradiance in kWh/m²/day for the specified location
outputs.capacity_factor Ratio of actual energy output to theoretical maximum output, expressed as a percentage
station_info.lat Latitude of the weather station used for solar resource data in the calculation
errors List of validation error messages if any input parameters are invalid; empty array means no errors

Implementation Example

Request
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://developer.nrel.gov/docs/solar/pvwatts/v6/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden / OVER_RATE_LIMIT You have exceeded the free tier rate limit of 1,000 requests per hour
Cache results for the same location and system parameters rather than re-requesting; results do not change in real time
Errors array with "invalid value" messages One or more system parameters are outside the valid range (e.g. tilt must be 0-90)
Check the PVWatts v6 docs for valid parameter ranges; azimuth is 0-360, tilt is 0-90, losses must be less than 100
400 Missing required parameter A required parameter like system_capacity or lat/lon is missing from the request
Include all required parameters: system_capacity, azimuth, tilt, array_type, module_type, losses, and either lat/lon or an address

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Environment
Difficulty Intermediate
Verified: 2026-04-07

Related Tags

Similar APIs

View All →