# Elibrary — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/elibrary/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/elibrary/general-search \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/elibrary/get-cp-dockets \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/elibrary/get-docket-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/elibrary/get-document-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"accession_number":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.