Quickstart

Welcome to the PDFLoom Quickstart Guide! This section will help you get up and running with the PDFLoom API quickly and easily. Follow the steps below to start converting and screenshotting your content.

Step 1: Obtain Your API Token

To use the PDFLoom API, you'll need an API token. You can generate your token from the API page in your PDFLoom dashboard.

Step 2: Make Your First API Request

Let's walk through an example of converting HTML content to a PDF using the PDFLoom API.

Example: Convert HTML to PDF

  1. Endpoint: POST /v1/convert/html
  2. Authentication: Include your API token in the Authorization header.
GET
/v1/convert/html
curl -X POST https://api.pdfloom.com/v1/convert/html \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "html_content": "<html><body><h1>Hello World</h1></body></html>",
    "options": {
        "page_size": "A4",
        "orientation": "portrait"
    }
}'

Step 3: Integrate into Your Application

Here's how you can integrate the PDFLoom API into your application.

Convert HTML to PDF

GET
/v1/convert/html
curl -X POST https://api.pdfloom.com/v1/convert/html \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "html_content": "<html><body><h1>Hello World</h1></body></html>",
    "options": {
        "page_size": "A4",
        "orientation": "portrait"
    }
}'

Take Screenshot of URL

GET
/v1/screenshot/url
curl -X POST https://api.pdfloom.com/v1/screenshot/url \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "url": "https://example.com",
    "options": {
        "width": 1024,
        "height": 768,
        "format": "png"
    }
}'

What's next?

Great, Now that you've made your first API requests, you can explore the additional functionality of the PDFLoom API, such as converting office documents to PDFs and taking screenshots of HTML content.

Here are a few links that might be handy as you venture further into the PDFLoom API:

Happy converting!

Was this page helpful?