Long documents are everywhere: reports, papers, blog posts, meeting notes, whole books. Most of the time I just want to know what they say before deciding whether to read every word.
So I built Doc Summarizer: send it text, a link or a file, and it gives back a short summary, key points, keywords, the reading time, and a summary of every chapter. It's the third and last of the reading APIs I've been building, after the Public Domain Book Finder and Clean PDF Reader.
What it does
| Endpoint | What you send |
|---|---|
POST /summarize/text | Text as JSON |
GET /summarize/url | A link to a web page, PDF or text file |
POST /summarize/file | An uploaded PDF, .txt or .md file |
Every response has the same shape:
-
summary: the most important sentences, in their original order -
key_points: other important sentences from across the document, ready for bullets -
keywords: the words and short phrases it's most about -
word_countandreading_time_minutes -
sections: a short summary of each chapter or heading
Summarize a link
import os import requests HEADERS = { "X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"], "X-RapidAPI-Host": "doc-summarizer.p.rapidapi.com", } result = requests.get( "https://doc-summarizer.p.rapidapi.com/summarize/url", params={"url": "https://arxiv.org/pdf/1706.03762", "length": "short"}, headers=HEADERS, ).json() print(result["summary"]) for point in result["key_points"]: print("•", point) length can be short (3 sentences), medium (5) or long (8), or pass sentences for an exact number.
Chapter by chapter
Markdown headings and lines like Chapter 3 or Prologue become sections, so long text gets a summary per chapter:
result = requests.post( "https://doc-summarizer.p.rapidapi.com/summarize/text", json={"text": open("notes.md").read(), "length": "medium"}, headers=HEADERS, ).json() for s in result["sections"]: print(f'{s["number"]}. {s["title"]}: {s["summary"]}') PDFs use their bookmarks or headings for chapters, and web pages use their h2/h3 headings.
How it works (no AI model)
I wanted this to be fast, cheap to run, and never make anything up, so it doesn't use an AI model at all. It's extractive: it picks the best sentences that are already in your document.
- Split it up. Text is broken into sections, paragraphs and sentences. The sentence splitter knows that "Dr. Smith" and "J. R. Tolkien" aren't sentence endings.
- Find what matters. Common words like "the" and "would" are ignored, and the rest are counted (with a light stemmer, so "reading", "reads" and "read" count together). Words used a lot are the document's main topics.
- Score every sentence by how many of those topic words it holds, with a small boost for the first sentence of a paragraph, the opening of the document, and words that appear in headings. Very long sentences and questions get a small penalty.
- Pick without repeating. It takes the top sentences, but skips any that overlap too much with one already chosen, then puts them back in their original order so the summary reads naturally.
- Key points come from what's left, so they add to the summary instead of repeating it.
Two pieces come from the other APIs in the series: PDFs go through the Clean PDF Reader's parser first (so headers, footers and page numbers never end up in a summary), and links use the same safe fetching (no private addresses, every redirect checked). For web pages, menus, cookie banners, sidebars and footers are skipped so only the article is summarized.
Even a whole book takes only about a second. It's written in Python with FastAPI and runs on Render alongside the Book Finder and Clean PDF Reader.
Try it
Doc Summarizer on RapidAPI (free Basic plan). The Tutorials tab has 3 guides: summarizing a link, summarizing your own text chapter by chapter, and turning any file into a one-page digest.
It works best with English text, and since it picks real sentences, the summary is only as clear as the writing it comes from.
That wraps up the reading series: find a free book, read any PDF cleanly, and now summarize anything. If you build something with them, I'd love to see it!



