> Documentation index: https://docs.crawlapi.dev/llms.txt
> Fetch the index before exploring further; it lists every page with its description.

# PDFs and documents

> PDFs, Office files, feeds, CSV and JSON URLs, returned like any page.

## Example

```bash
curl -sS https://api.crawlapi.dev/v1/scrape \
  -H "Authorization: Bearer $CRAWLAPI_API_KEY" \
  -H 'content-type: application/json' \
  --data '{"url": "https://arxiv.org/pdf/1706.03762"}'
```

```python
import os, httpx

body = httpx.post(
    "https://api.crawlapi.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['CRAWLAPI_API_KEY']}"},
    json={"url": "https://arxiv.org/pdf/1706.03762"},
    timeout=60.0,
).json()
print(body["data"]["markdown"])
```

```javascript
const response = await fetch('https://api.crawlapi.dev/v1/scrape', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ' + process.env.CRAWLAPI_API_KEY,
    'content-type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://arxiv.org/pdf/1706.03762' }),
});
const body = await response.json();
console.log(body.data.markdown);
```

**200 OK** (1 credit)

```json
{
  "success": true,
  "request_id": "req_9197c05c5ac515a89b26",
  "data": {
    "metadata": {
      "title": "Attention Is All You Need",
      "description": "",
      "language": null,
      "status": 200,
      "final_url": "https://arxiv.org/pdf/1706.03762"
    },
    "links": [],
    "markdown": "#### Provided proper attribution is provided, Google hereby grants permission to\n\nreproduce the tables and figures in this paper solely for use in journalistic or scholarly works.\n\n## Attention Is All You Need"
  },
  "usage": {
    "credits": 1,
    "remaining": 9996
  }
}
```

An answer trimmed for this page, recorded live on 2026-11-13: `markdown` keeps the first 3 of its 195 blocks. `title` is the PDF’s own title when it has a real one, else its top heading (here; read again 2026-11-12, when arXiv’s margin stamp stopped being taken for the title).

## Formats

| Format | Notes |
| --- | --- |
| PDF | pages 1 to 300; `truncated: true` when the file has more |
| Word, Excel, PowerPoint | docx, xlsx, pptx, doc, xls, ppt: the file’s text and its tables |
| OpenDocument, EPUB, RTF | the file’s text and its tables |
| CSV | one `document` table; rows up to the last line break before 2 MiB |
| JSON | the body as sent, in a fenced block, and its record tables for `format=json` |
| RSS, Atom, RDF | the feed as markdown entries; one table of entries for `format=json` |

The format comes from the bytes, not the `content-type` header: a PDF served as `text/html` is still read as a PDF.

## Limits

| Limit | Value |
| --- | --- |
| Document size at fetch | 32 MiB; a larger body is `UNSUPPORTED_CONTENT` |
| PDF pages read | 300, then `truncated` |
| Markdown returned | 2 MiB, cut at a line, then `truncated` |
| JSON returned | 2 MiB |
| Shortest useful document | 15 words, URLs not counted; below that `NO_CONTENT` |

## What it does not do

- **No OCR**
  A PDF whose pages are mostly scanned images is `SCANNED_PDF` (422, not retryable).
- **No second try for a document that cannot be read**
  Every failure here costs 0 credits, ends the request and answers `retryable: false`: a higher level, or the same request later, would read the same bytes.
- **No password**
  A password-protected document is `LOGIN_REQUIRED`; an owner password that only restricts printing or copying is ignored.

## format=json for documents

- A JSON body becomes one embedded item plus the record tables inside it.
- A CSV becomes one table with the header row as its headings.
- A feed becomes one table of entries: `title`, `link`, `published`, `author`, `summary`.
- Any other document returns the GFM pipe tables of its converted text; with none, the answer is `NO_CONTENT`.

## Codes

| Code | Meaning |
| --- | --- |
| `SCANNED_PDF` | mostly images, no text layer |
| `UNSUPPORTED_CONTENT` | the bytes are not a format above, or a reader’s safety limit was hit |
| `LOGIN_REQUIRED` | password-protected |
| `NO_CONTENT` | readable, but under 15 words, a feed with no entries, or no structured data for `format=json` |

All four answer HTTP 422. Every code, with statuses and retry rules, is on [Errors and retries](/errors).
