# Fanfiction — 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 and browse fan fiction stories across FanFiction.net, accessing story metadata, full chapter content, and author profiles all in one place. Discover new stories and dive deeper into author information without navigating the website directly.

**Category:** Entertainment | **Website:** [fanfiction.net/](https://fanfiction.net/) | **Docs:** [parse.bot/marketplace/6c7d580d-a320-48c5-ab14-0db875cb1d9a/fanfiction-net-api](https://parse.bot/marketplace/6c7d580d-a320-48c5-ab14-0db875cb1d9a/fanfiction-net-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-fanfiction-net-api-6c7d580d/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_author

Retrieve an author's profile including display name, join date, bio, and a list of all their published stories. The author_id comes from search results or story metadata.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `author_id` | string | Yes | Numeric author ID (e.g. from search_stories or get_story results). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-fanfiction-net-api-6c7d580d/get_author \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"author_id":"<string>"}'
```

### get_chapter

Retrieve the full text content of a specific chapter of a story. Returns the chapter text along with chapter title and total chapter count for the story.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `chapter` | integer | No | Chapter number to retrieve. |
| `story_id` | string | Yes | Numeric story ID (e.g. from search_stories or get_story results). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-fanfiction-net-api-6c7d580d/get_chapter \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chapter":"<integer>","story_id":"<string>"}'
```

### get_story

Retrieve full metadata for a single story including title, author info, description, cover image, detailed stats, and chapter listing. The story_id comes from search results or author profiles.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `story_id` | string | Yes | Numeric story ID (e.g. from search_stories results). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-fanfiction-net-api-6c7d580d/get_story \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"story_id":"<string>"}'
```

### search_stories

Full-text search over fan fiction stories by keyword. Returns paginated results with metadata including title, author, description, and stats (rating, word count, reviews, etc.). Results are ordered by relevance by default. Each page contains up to 50 results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `keywords` | string | Yes | Search query to match against story titles and descriptions. |
| `page` | integer | No | Page number for paginated results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-fanfiction-net-api-6c7d580d/search_stories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keywords":"<string>","page":"<integer>"}'
```
