Skip to main content

What it does

  • Extracts all text from PDF documents
  • Returns page count and document metadata
  • Works with any public PDF URL

Pricing

**0.002perrequest(0.002 per request** (2 per 1,000 requests)

Authentication

Include your API key in the Authorization header:
Authorization: Bearer YOUR_LLMLAYER_API_KEY

Endpoint

POST /api/v2/get_pdf_content

SDK Usage

from llmlayer import LLMLayerClient

client = LLMLayerClient(api_key="your-api-key")

response = client.get_pdf_content(
url="https://example.com/document.pdf"
)

print(response.text)  # Extracted text
print(response.pages)  # Number of pages

Request

url
string
required
The URL of the PDF document. Must be a direct link to a PDF file.Example: "https://example.com/document.pdf"

Response

text
string
The extracted text content from the PDF
pages
integer
Total number of pages in the PDF document
url
string
The PDF URL (same as input)
statusCode
integer
HTTP status code (200 for success)
cost
number
Cost in USD for this request (0.002)

Limitations

  • PDF must be publicly accessible (no authentication)
  • 15-second timeout for extraction
  • Direct PDF URLs only (must end in .pdf or be a direct PDF link)

Error Codes

Invalid or missing API key
PDF took too long to process (15-second limit)
Failed to extract PDF content
Need Help? Join our Discord or email support@llmlayer.ai