Introduction
The FeoPDF API allows you to generate high-fidelity PDFs and images from HTML, URLs, or raw content.
Base URL
https://feopdf.com/api
Our API is designed to be simple, predictable, and easy to use. It follows standard REST principles and uses JSON for request and response bodies.
Quick Example
Here's a simple example of generating a PDF from a URL. Choose your preferred language:
curl -X POST https://feopdf.com/api/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"format": "A4",
"printBackground": true
}
}' \
--output document.pdf
const axios = require('axios');
const fs = require('fs');
async function generatePDF() {
const response = await axios.post(
'https://feopdf.com/api/pdf',
{
url: 'https://example.com',
options: {
format: 'A4',
printBackground: true
}
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
responseType: 'arraybuffer'
}
);
fs.writeFileSync('document.pdf', response.data);
}
generatePDF();
import requests
response = requests.post(
'https://feopdf.com/api/pdf',
json={
'url': 'https://example.com',
'options': {
'format': 'A4',
'printBackground': True
}
},
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
)
with open('document.pdf', 'wb') as f:
f.write(response.content)
<?php
$ch = curl_init('https://feopdf.com/api/pdf');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com',
'options' => [
'format' => 'A4',
'printBackground' => true
]
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$pdf = curl_exec($ch);
file_put_contents('document.pdf', $pdf);
curl_close($ch);
Authentication
Authenticate your requests by including your API key in the Authorization header.