Smart conversions. Easy pricing. Haha included!

Convert HTML to PDF Instantly

Fast, reliable HTML-to-PDF and also more developer APIs coming soon

Get Your API Key

Why 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

FREE
  • โœ… 1,000 free conversions
  • โœ… Full API access
  • โœ… Standard support
  • โœ… No credit card required

Rocket Plan

$8/month or Rs.799/month
  • โœ… Up to 7,000 conversions
๐Ÿ“ง Get Rocket Plan

๐Ÿ“ง 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

Python
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()
Node.js
// 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:

  1. Send us an email to request your API key - we'll respond within 30 minutes
  2. Start with 1,000 free conversions - no credit card needed
  3. Integrate our API using the code examples above
  4. Upgrade to Pro for unlimited conversions at just $2/month

Send your API key request to:

Include your use case and expected volume for faster processing