# Documents & files

Not every URL is a web page. A link to a PDF report, a JSON endpoint, a Markdown file, an RSS feed is opened in the same real Chrome a page is, and the endpoints that can make sense of it work on it: its text comes back as Markdown, summarized, as keywords, as data in your own schema, or with its metadata, and it can be screenshotted as Chrome shows it.

There is nothing to switch on and nothing extra to pay: send the URL to the endpoint as you would a page's, at the same price. The response has the same shape a page's would.

## What works on what

Document

/markdown

/meta

/summarize

/keywords

/extract

/screenshot

/html

/console

/technologies

/pdf

PDF

application/pdf

✓

✓

✓

✓

✓

✓

—

—

—

—

Text

text/plain, text/markdown, application/json, XML, RSS and Atom feeds

✓

✓

✓

✓

✓

✓

—

—

—

—

## What each endpoint does with a document

- [/markdown](https://urlpipe.dev/docs/markdown) — a PDF's text, its paragraphs joined back up across the line breaks the page layout puts in them; a text or Markdown file as it is; JSON (pretty-printed) and XML in a fenced code block.
- [/meta](https://urlpipe.dev/docs/meta) — a PDF's own document information: its title, author, subject, keywords, the software that made it and its creation and modification dates, in the same object a page gets. The language is read from the text.
- [/summarize](https://urlpipe.dev/docs/summarize), [/keywords](https://urlpipe.dev/docs/keywords) and [/extract](https://urlpipe.dev/docs/extract) — read the document's text where they would read a page's: an invoice's total, a report's figures, a feed's entries, in the fields you name.
- [/screenshot](https://urlpipe.dev/docs/screenshot) — the document as Chrome shows it. A PDF is opened in Chrome's own viewer without its toolbar, and the image is the viewer as it opens: the first page, at the viewport's size (the pages scroll inside the viewer, so there is no taller page to capture). A PDF has no elements, so a `selector` matches nothing in one.
- [/html](https://urlpipe.dev/docs/html), [/console](https://urlpipe.dev/docs/console), [/technologies](https://urlpipe.dev/docs/technologies) and [/pdf](https://urlpipe.dev/docs/pdf) are for web pages: a document has no markup or scripts of its own, and no page to print, and they answer `422` with `The requested URL is not a web page.`

In a [/scrape](https://urlpipe.dev/docs/scrape), each operation is answered on its own: on a PDF, `markdown` and `screenshot` succeed while `html` fails, from the same single visit.

## What is not supported

- Images. A screenshot is all any endpoint could do with one, and that is the image itself, so an image URL answers `422` not a web page.
- Files Chrome downloads instead of showing — zip archives, CSV, Word and Excel documents — answer `422` not a web page on every endpoint.
- Scanned PDFs, which are pictures of text, and encrypted PDFs have no text to read: the text endpoints answer `422` with `The document could not be read: it is encrypted, damaged, or has no text in it (a scanned PDF, for example).` A screenshot still works.
- Only the first 200 pages of a PDF are read, and a document over 20 MB is refused as too big.

Source: https://urlpipe.dev/docs/documents
