ANYFREEBOOK

For developers

One free API for every open book source

Search Project Gutenberg, Open Library, the Internet Archive, Google Books, PubMed Central, DOAJ and LibriVox through a single endpoint. No key required to start.

The part most “free book” APIs skip: every result carries a legal tier, so you know whether the thing behind that link is genuinely free to download, is a borrow-only loan, or is just a catalogue record — before you ship a link to it.

Quick start

curl "https://anyfreebook.com/api/v1/search?q=pride+and+prejudice&limit=3"

# every result carries a tier
# "tier": "download"  -> files[] has the real EPUB / TXT / HTML URLs
# "tier": "borrow"    -> a loan, not a download
# "tier": "unverified"-> a catalogue record; links[] points at the source

Endpoints

GET/api/v1/search?q=python&limit=20

Search every open source at once. Returns a tier and the real file URLs for each result.

GET/api/v1/resolve?title=Pride%20and%20Prejudice&author=Jane%20Austen

The authoritative answer for one title, with the author checked against the real record.

GET/api/v1/health

Liveness and version. Touches no upstream, so it stays up when a source is down.

The tier system

The tier comes from the source’s own metadata — for the Internet Archive we read access-restricted-item and lending_identifier from the item’s own record. It is never a guess.

download

A free, legally readable copy of this exact title.

files[] holds the direct URLs when the source exposes one.

borrow

A real copy, but borrow-only: a free Internet Archive account and a loan are required.

Not a download. files[] is empty.

unverified

A catalogue record or a search page. No confirmed free copy of this exact title.

files[] is empty. links[] points at the real source.

Sources

12 open-access sources, asked in parallel. When one does not answer, the response says so in failedSources — a short result set is never presented as a complete one.

Project GutenbergInternet ArchiveOpen LibraryGoogle BooksLibriVoxPubMed CentralDOAJOpenAlexZenodoWikisourceEuropeanaOpen Textbook Library

Clients

anyfreebook-cli

Batch-download public-domain books from your terminal.

npm install -g anyfreebook-cli
anyfreebook download "python" --format epub

anyfreebook-api

The same API from Python, with no dependencies.

pip install anyfreebook-api
from anyfreebook_api import Client

Full reference: the API documentation.