What it does

  • Extracts clean content from any URL
  • Supports multiple output formats (markdown, HTML, PDF, screenshot)
  • Handles redirects automatically

Pricing

**0.001perrequest(0.001 per request** (1 per 1,000 requests)

Authentication

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

Endpoint

POST /api/v1/scrape

SDK Usage

from llmlayer import LLMLayerClient
import base64

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

# Scrape as markdown
response = client.scrape(
url="https://example.com",
format="markdown",
include_images=True,
include_links=True
)
print(response.markdown)

# Scrape as HTML
response = client.scrape(
url="https://example.com",
format="html"
)
print(response.html)

# Scrape as screenshot
response = client.scrape(
url="https://example.com",
format="screenshot"
)
# Save screenshot
with open('screenshot.png', 'wb') as f:
f.write(base64.b64decode(response.screenshot_data))

# Scrape as PDF
response = client.scrape(
url="https://example.com",
format="pdf"
)
# Save PDF
with open('page.pdf', 'wb') as f:
f.write(base64.b64decode(response.pdf_data))

Request Parameters

url
string
required
The URL to scrapeExample: "https://example.com/article"
format
string
default:"markdown"
Output format: markdown, html, screenshot, or pdf
include_images
boolean
default:"true"
Include images in markdown output (markdown format only)
Include hyperlinks in markdown output (markdown format only)

Response

markdown
string
Content in markdown format (when format is “markdown”)
html
string
Content in HTML format (when format is “html”)
pdf_data
string
Base64-encoded PDF data (when format is “pdf”)
screenshot_data
string
Base64-encoded image data (when format is “screenshot”)
url
string
Final URL after redirects
status_code
integer
HTTP status code (200 for success)
cost
number
Cost in USD ($0.001)

Format Options

FormatReturnsUse Case
markdownClean text with optional images/linksContent extraction for AI processing
htmlRaw HTML contentFull page structure preservation
screenshotBase64-encoded PNG imageVisual capture of page
pdfBase64-encoded PDF documentDocument archival

Limitations

  • 15-second timeout for all operations
  • Cannot scrape pages requiring login
  • JavaScript-heavy sites may not render completely
  • Subject to rate limits based on your plan

Error Codes

Need Help? Join our Discord or email support@llmlayer.ai