Overview

CustomJS lets you run JavaScript natively inside any HTTP request. You can either pass your JS inline with the request or store reusable functions on the CustomJS platform, which is perfect for keeping your logic clean and secure. To learn more about their differences and tradeoffs, see Inline vs. Stored JavaScript.

Core features

Aside from enabling native JS execution, the CustomJS API includes powerful helpers available in both inline and stored executions to make automation easier:

HTML to PDF conversion

The HTML to PDF conversion helps you convert HTML to PDF.

Website Screenshot

The Website Screenshot node helps you interact with and gather data from live websites.

Web Scraping

The Web Scraping node helps you interact with and gather data from live websites.

Additional API endpoints

Create, merge, compress, and convert files with our ready-to-use PDF API endpoints. Build your own PDF generation API that fits your needs.

  • PDF to PNG – Turn PDF pages into png images. View preset
  • PDF to text – Extract texts from PDF. View preset
  • Merge PDFs – Combine invoices, reports, attachments. View preset
  • Extract pages from PDF – Pull selected pages into new PDF. View preset
  • Compress a PDF – Shrink file size by 70% easily. View preset

Quick setup

  1. Get your API key. Learn how to get your API key →
  2. Choose your execution mode. Learn about Inline vs. Stored JS →
  3. Make your first request:
curl -X POST 'https://e.customjs.io/__js1-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'customjs-origin: inline/pdf-generator' \
--data-raw '{"input":{"html":"Hello World"},"code":"const { HTML2PDF } = require(\"./utils\"); return HTML2PDF(input.html);","returnBinary":"true"}' \
> customjs-output.pdf