Skip to main content

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

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)

Request Parameters

ParameterTypeRequiredDescription
urlstringYesPublic direct PDF URL

Response

{
  "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
}
FieldTypeDescription
textstringExtracted text
pagesinteger | nullNumber of pages
urlstringPDF URL
statusCodeinteger | null200 on success
costnumber | nullCost 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

StatusMeaning
400Invalid or unsupported URL
401Missing or invalid LLMLayer API key
504PDF extraction timed out
500PDF extraction failed
See Errors & Refunds for the shared error format.