Convert HTML to PDF Instantly
Fast, reliable HTML-to-PDF and also more developer APIs coming soon
Get Your API KeyWhy Choose Our HTML to PDF API?
Built for developers who need reliable PDF generation
Lightning Fast
Convert HTML to PDF in milliseconds with our optimized rendering engine
Pixel Perfect
Maintain exact formatting, fonts, and layouts in your PDF output
Easy Integration
Simple REST API that works with any programming language
Responsive PDFs
Generate PDFs from responsive HTML that look great on any device
Secure & Private
Your HTML content is processed securely and never stored
Usage Analytics
Track your API usage with detailed analytics and reporting
Simple, Transparent Pricing
Start free, scale as you grow
Free Tier
- โ 1,000 free conversions
- โ Full API access
- โ Standard support
- โ No credit card required
Pro Plan
- โ Up to 4,000 conversions (1,000 free + 3,000 conversions)
๐ง To get Pro or Rocket Plan: Send us an email at nas89n9@gmail.com with your preferred plan and we'll send you payment details within 30 minutes!
Quick Start
Copy, paste, and run - it's that simple
import requests import sys # ๐ง Configuration API_KEY = "YOUR_API_KEY_HERE" # replace with your actual API key BASE_URL = "https://api.apihaha.com" # API endpoint def generate_pdf(): print("๐งพ Generating PDF...") url = f"{BASE_URL}/generatepdf" payload = { "url": "https://www.example.com", "format": "A4", "printBackground": False, "margin": {"top": "50px", "bottom": "50px", "left": "20px", "right": "20px"}, "landscape": False, "displayHeaderFooter": True, "headerTemplate": "<div style='font-size:10px; text-align:center; width:100%;'>PDF Generated</div>", "footerTemplate": "<div style='font-size:10px; text-align:center; width:100%;'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>", "apiKey": API_KEY } try: response = requests.post(url, json=payload) response.raise_for_status() except requests.exceptions.RequestException as e: print(f"โ Error generating PDF: {e}") sys.exit(1) with open("output.pdf", "wb") as f: f.write(response.content) print("โ PDF saved as output.pdf") def check_usage(): print("\n๐ Checking API usage...") url = f"{BASE_URL}/usage/{API_KEY}" try: response = requests.get(url) response.raise_for_status() data = response.json() print(f"Total PDFs allowed: {data['total']}") print(f"Used: {data['used']}") print(f"Remaining: {data['remaining']}") except requests.exceptions.RequestException as e: print("โ Failed to get usage:", e) sys.exit(1) def main(): generate_pdf() check_usage() if __name__ == "__main__": main()
// generate_and_check.js import fetch from 'node-fetch'; import fs from 'fs'; const API_KEY = 'YOUR_API_KEY_HERE'; // ๐ Replace with your actual key const BASE_URL = 'https://api.apihaha.com'; // ๐ API endpoint async function generatePDF() { console.log('๐งพ Generating PDF...'); const response = await fetch(`${BASE_URL}/generatepdf`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://www.example.com', format: 'A4', printBackground: false, margin: { top: '50px', bottom: '50px', left: '20px', right: '20px' }, landscape: false, displayHeaderFooter: true, headerTemplate: '<div style="font-size:10px; text-align:center; width:100%;">PDF Generated</div>', footerTemplate: '<div style="font-size:10px; text-align:center; width:100%;">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>', apiKey: API_KEY }) }); if (!response.ok) { const error = await response.json().catch(() => ({})); throw new Error(`PDF generation failed (${response.status}): ${error.error || 'Unknown error'}`); } const buffer = await response.arrayBuffer(); fs.writeFileSync('output.pdf', Buffer.from(buffer)); console.log('โ PDF saved as output.pdf'); } async function checkUsage() { console.log('\n๐ Checking API usage...'); const response = await fetch(`${BASE_URL}/usage/${API_KEY}`); if (!response.ok) { throw new Error(`Usage check failed (${response.status}): ${response.statusText}`); } const data = await response.json(); console.log(`Total PDFs allowed: ${data.total}`); console.log(`Used: ${data.used}`); console.log(`Remaining: ${data.remaining}`); } async function main() { try { await generatePDF(); await checkUsage(); } catch (err) { console.error('โ Error:', err.message); } } main();
Ready to Get Started?
Get your API key and start converting HTML to PDF today
๐ How to Get Started:
- Send us an email to request your API key - we'll respond within 30 minutes
- Start with 1,000 free conversions - no credit card needed
- Integrate our API using the code examples above
- Upgrade to Pro for unlimited conversions at just $2/month
Send your API key request to:
๐ง nas89n9@gmail.comInclude your use case and expected volume for faster processing