FanFiction APIfanfiction.net ↗
Search FanFiction.net stories, retrieve full chapter text, story metadata, and author profiles via 4 structured JSON endpoints.
What is the FanFiction API?
The FanFiction.net API exposes 4 endpoints covering story search, full metadata retrieval, chapter text, and author profiles. Use search_stories to query stories by keyword and get back paginated results with titles, descriptions, and engagement stats. Use get_chapter to pull the complete prose of any chapter by story ID and chapter number. All responses are structured JSON with consistent numeric identifiers across endpoints.
curl -X GET 'https://api.parse.bot/scraper/e8bd7b1f-8d64-4968-b560-cf9a99c6d2c9/search_stories?page=1&keywords=harry+potter' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace fanfiction-net-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: FanFiction.net SDK — bounded, re-runnable; every call capped."""
from parse_apis.fanfiction_net_api import FanFiction, NotFound
client = FanFiction()
# Search for stories by keyword, iterate with a cap.
for story in client.stories.search(keywords="harry potter", limit=3):
print(story.title, story.stats.words, story.stats.rating)
# Drill down: get the first result and fetch full details.
hit = client.stories.search(keywords="harry potter", limit=1).first()
full = hit.details()
print(full.title, full.description, full.stats.status)
# Read chapter content from the full story.
chapter = full.content(chapter=1)
print(chapter.chapter_title, chapter.total_chapters, chapter.content[:100])
# Look up the author profile.
try:
author = client.authors.get(author_id=full.author_id)
print(author.name, author.bio, author.story_count)
except NotFound:
print("author not found")
print("exercised: stories.search / stories.get / story.content / authors.get")
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.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for paginated results. |
| keywordsrequired | string | Search query to match against story titles and descriptions. |
{
"type": "object",
"fields": {
"page": "current page number",
"stories": "array of story search result objects with title, story_id, author info, description, and stats",
"total_found": "total number of matching stories across all pages"
},
"sample": {
"data": {
"page": 1,
"stories": [
{
"stats": {
"favs": 16,
"words": 137,
"fandom": "Harry Potter",
"genres": "Drama",
"rating": "T",
"status": "Complete",
"follows": 7,
"reviews": 69,
"chapters": 1,
"language": "English",
"published_timestamp": 1619878274
},
"title": "harry potter and the attack of the harry potter",
"story_id": "13873079",
"author_id": "14809182",
"author_name": "LosAngelesttorney",
"cover_image": "https://www.fanfiction.net/image/6628439/75/",
"description": "harry potter gets attacked by a harry potter!"
}
],
"total_found": 98508
},
"status": "success"
}
}About the FanFiction API
Story Search and Metadata
search_stories accepts a keywords string and an optional page integer, returning up to 50 results per page along with a total_found count. Each result in the stories array includes a story_id, title, author info, description, and a stats block covering rating, word count, review count, favorites, follows, and publication timestamps. get_story takes a single story_id and returns the same stats object expanded with language, genres, completion status, and a full chapters array listing each chapter's number and title — useful for pre-fetching a table of contents before loading individual chapters.
Chapter Text
get_chapter returns the content field: the complete prose of one chapter, with paragraphs separated by newlines. Alongside the text it returns chapter_title, chapter_number, story_id, and total_chapters. If the optional chapter integer is omitted, the endpoint defaults to chapter 1. total_chapters lets you iterate programmatically through an entire story without calling get_story first.
Author Profiles
get_author takes a numeric author_id (available from both search_stories and get_story responses) and returns the author's name, bio, joined_date, joined_timestamp, story_count, and a stories array of all published works with their story_id and title. The Unix joined_timestamp is convenient for sorting or filtering author cohorts programmatically.
The FanFiction API is a managed, monitored endpoint for fanfiction.net — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when fanfiction.net changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official fanfiction.net API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a fanfic recommendation engine using story stats (reviews, favs, follows, word count) from search_stories results
- Archive or mirror a complete multi-chapter story by iterating get_chapter over total_chapters
- Analyze genre and rating distributions across large keyword searches using the stats block
- Compile an author's full bibliography — story titles, IDs, and counts — via get_author
- Track engagement growth by periodically fetching a story's review, fav, and follow counts from get_story
- Power a reading-progress tracker by storing chapter_number and total_chapters from get_chapter responses
- Index story descriptions and titles for full-text search by consuming paginated search_stories results
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.