# Elibrary — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search Federal Energy Regulatory Commission documents and dockets to find detailed information about energy projects, permits, and regulatory filings. Look up specific docket types like Certificate of Public Convenience and Necessity applications, access complete docket sheets, and retrieve metadata about individual documents.

**Category:** Government & Public Data | **Website:** [elibrary.ferc.gov/](https://elibrary.ferc.gov/) | **Docs:** [parse.bot/marketplace/a2082ae0-3390-40ba-9651-52dd343175d2/elibrary-ferc-gov-api](https://parse.bot/marketplace/a2082ae0-3390-40ba-9651-52dd343175d2/elibrary-ferc-gov-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-elibrary-ferc-gov-api-a2082ae0/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### general_search

Full-text and filtered search across the entire FERC eLibrary. Supports query text (matched against document descriptions), docket-number prefix filtering (short prefixes like 'CP' are auto-wildcarded), and filed-date range. Returns paginated results ordered by relevance score. Each hit includes description, category, accession number, filed date, docket numbers, transmittals (attached files metadata), and author/recipient affiliations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `docket_number` | string | No | Docket number or prefix to filter by. Short prefixes (4 chars or fewer) are automatically wildcarded (e.g. 'CP' becomes 'CP*'). Full docket numbers like 'CP21-470' search exactly. |
| `end_date` | string | No | End of filed-date range in YYYY-MM-DD format. |
| `limit` | integer | No | Maximum results per page. |
| `page` | integer | No | Page number (0-based). |
| `query` | string | No | Search query text matched against document descriptions. Omitting or leaving blank searches all documents. |
| `start_date` | string | No | Start of filed-date range in YYYY-MM-DD format. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-elibrary-ferc-gov-api-a2082ae0/general_search \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"docket_number":"<string>","end_date":"<string>","limit":"<integer>","page":"<integer>","query":"<string>","start_date":"<string>"}'
```

### get_cp_dockets

Convenience wrapper around general_search pre-filtered to CP (Certificate of Public Convenience and Necessity) docket-number prefix. Returns the same paginated result shape as general_search but scoped to CP-prefixed dockets only.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum results per page. |
| `page` | integer | No | Page number (0-based). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-elibrary-ferc-gov-api-a2082ae0/get_cp_dockets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>"}'
```

### get_docket_details

Retrieve full metadata for a specific docket number including applicant details, docket description, sub-docket numbers, and a complete list of filings. Each filing contains document metadata (category, description, filed date, accession number, affiliated organizations) and pagination info for the filings list.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `docket_number` | string | Yes | Exact docket number (e.g. 'CP21-470'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-elibrary-ferc-gov-api-a2082ae0/get_docket_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"docket_number":"<string>"}'
```

### get_document_details

Look up a single document by its accession number (YYYYMMDD-NNNN format). Returns the full document metadata including description, category, transmittals (attached file names, types, sizes), author/recipient affiliations, and associated docket numbers. Typically returns exactly one hit.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `accession_number` | string | Yes | Accession number in YYYYMMDD-NNNN format (e.g. '20210629-5262'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-elibrary-ferc-gov-api-a2082ae0/get_document_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"accession_number":"<string>"}'
```
