> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cleanview.co/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete reference for all Cleanview API endpoints

## Base URL

All API requests should be made to:

```
https://api.cleanview.co/api/v1
```

## Authentication

All endpoints require authentication using an API key in the x-api-key header:

```bash theme={null}
x-api-key: cv_pub_your_api_key_here
```

See the [Authentication guide](/authentication) for detailed information on obtaining and using API keys.

## Try It Out

You can test API endpoints directly in this documentation using the **"Try It"** feature:

1. Navigate to any endpoint page (e.g., [EIA 860M](/api-reference/endpoint/eia-860m))
2. Click the **Try it** button
3. Enter your API key in the format: `cv_pub_your_api_key_here`
4. Set your desired parameters
5. Click **Send** to test the endpoint live

<Tip>
  **Need an API key?** [Schedule a demo](https://cleanview.co/demo) to request access.
</Tip>

## Response Format

All API responses follow a consistent structure:

```json theme={null}
{
  "success": true,
  "summary": {
    "limit": 50,
    "offset": 0,
    "total_results": 1000,
    "has_more": true,
    "current_page": 1,
    "total_pages": 20
  },
  "filters": {
    "state": "CA",
    "technology": "Solar"
  },
  "customer": {
    "id": "test_user_001",
    "name": "Test Developer"
  },
  "data": [...]
}
```

### Response Fields

| Field      | Type         | Description                               |
| ---------- | ------------ | ----------------------------------------- |
| `success`  | boolean      | Indicates if the request was successful   |
| `summary`  | object       | Pagination and result summary information |
| `filters`  | object       | Applied filters for the request           |
| `customer` | object       | Customer information for the API key      |
| `data`     | array/object | The requested data                        |

## Error Handling

When a request fails, the API returns an appropriate HTTP status code and error information:

```json theme={null}
{
  "error": "INVALID_API_KEY",
  "message": "The provided API key is invalid or has been revoked"
}
```

### Common Error Codes

| Error Code        | HTTP Status | Description                               |
| ----------------- | ----------- | ----------------------------------------- |
| `API_KEY_MISSING` | 401         | No API key provided                       |
| `INVALID_API_KEY` | 401         | Invalid or revoked API key                |
| `INVALID_LIMIT`   | 400         | Invalid limit parameter (must be 50-5000) |
| `INVALID_OFFSET`  | 400         | Invalid offset parameter                  |
| `INTERNAL_ERROR`  | 500         | Server error                              |

## Pagination

All list endpoints support pagination using `limit` and `offset` parameters:

| Parameter | Type    | Default | Range   | Description                 |
| --------- | ------- | ------- | ------- | --------------------------- |
| `limit`   | integer | 1000    | 50-5000 | Number of records to return |
| `offset`  | integer | 0       | ≥0      | Number of records to skip   |

**Example:**

```
GET /api/v1/eia-860m?limit=100&offset=200
```

## Available Endpoints

<CardGroup cols={2}>
  <Card title="EIA 860M Data" icon="database" href="/api-reference/endpoint/eia-860m">
    Access the latest EIA 860M project records for planned and operating renewable energy projects
  </Card>

  <Card title="ERCOT Queue" icon="network-wired" href="/api-reference/endpoint/ercot">
    Real-time interconnection queue data from ERCOT
  </Card>

  <Card title="CAISO Queue" icon="network-wired" href="/api-reference/endpoint/caiso">
    Real-time interconnection queue data from CAISO
  </Card>

  <Card title="PJM Queue" icon="network-wired" href="/api-reference/endpoint/pjm">
    Real-time interconnection queue data from PJM
  </Card>

  <Card title="MISO Queue" icon="network-wired" href="/api-reference/endpoint/miso">
    Real-time interconnection queue data from MISO
  </Card>

  <Card title="SPP Queue" icon="network-wired" href="/api-reference/endpoint/spp">
    Real-time interconnection queue data from SPP
  </Card>

  <Card title="NYISO Queue" icon="network-wired" href="/api-reference/endpoint/nyiso">
    Real-time interconnection queue data from NYISO
  </Card>

  <Card title="ISO-NE Queue" icon="network-wired" href="/api-reference/endpoint/iso-ne">
    Real-time interconnection queue data from ISO-NE
  </Card>

  <Card title="Unified Projects" icon="layer-group" href="/api-reference/endpoint/projects">
    Consolidated project database merging data from all sources
  </Card>
</CardGroup>

## Data Sources

The Cleanview API aggregates data from multiple authoritative sources:

* **EIA 860M**: U.S. Energy Information Administration monthly electric generator inventory
* **Grid Operator Queues**: Real-time interconnection queue data from major ISOs/RTOs
* **Cleanview Database**: Unified project records with cross-referencing and data quality improvements

<Note>
  **Data Freshness**: Most data is updated daily, with some sources updated more frequently. Check the `last_updated` field in API responses for specific timestamp information.
</Note>
