> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmlayer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Content API

> Extract text from a publicly accessible PDF URL.

## Overview

Use PDF Content for direct PDF URLs. Do not send PDF URLs to Scraper, Crawl, or Extract.

## Endpoint

`POST /api/v2/get_pdf_content`

## Quickstart

<CodeGroup>
  ```python Python theme={null}
  from llmlayer import LLMLayerClient

  client = LLMLayerClient(api_key="YOUR_LLMLAYER_API_KEY")

  response = client.get_pdf_content("https://www.ycombinator.com/blog/content/files/2024/06/RemedyFest-Final-Report.pdf")

  print(response.text)
  print(response.pages)
  print(response.statusCode)
  ```

  ```typescript TypeScript theme={null}
  import { LLMLayerClient } from 'llmlayer';

  const client = new LLMLayerClient({
    apiKey: process.env.LLMLAYER_API_KEY,
  });

  const response = await client.getPdfContent('https://www.ycombinator.com/blog/content/files/2024/06/RemedyFest-Final-Report.pdf');

  console.log(response.text);
  console.log(response.pages);
  console.log(response.statusCode);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.llmlayer.dev/api/v2/get_pdf_content \
    -H "Authorization: Bearer YOUR_LLMLAYER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url": "https://www.ycombinator.com/blog/content/files/2024/06/RemedyFest-Final-Report.pdf"}'
  ```
</CodeGroup>

## Request Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `url` | `string` | Yes | Public direct PDF URL |

## Response

```json theme={null}
{
  "text": "Extracted PDF text...",
  "pages": 12,
  "url": "https://www.ycombinator.com/blog/content/files/2024/06/RemedyFest-Final-Report.pdf",
  "statusCode": 200,
  "cost": 0.002
}
```

| Field | Type | Description |
| - | - | - |
| `text` | `string` | Extracted text |
| `pages` | `integer \| null` | Number of pages |
| `url` | `string` | PDF URL |
| `statusCode` | `integer \| null` | `200` on success |
| `cost` | `number \| null` | Cost in USD |

## Pricing

PDF Content costs `$0.002` per request.

## Limitations

* The PDF must be publicly accessible.
* Password-protected or private PDFs are not supported.
* The endpoint has a short extraction timeout.
* Use direct PDF URLs, not HTML pages that embed a PDF viewer.

## Errors

| Status | Meaning |
| - | - |
| `400` | Invalid or unsupported URL |
| `401` | Missing or invalid LLMLayer API key |
| `504` | PDF extraction timed out |
| `500` | PDF extraction failed |

See [Errors & Refunds](/errors) for the shared error format.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.