// api reference

API Documentation

Every CustomJS capability is a single authenticated HTTP request. This is the index. Auth, rate limits, and every endpoint, each linking to its full reference.

Authentication

Base URL

https://e.customjs.io

All requests require the x-api-key header and Content-Type: application/json. Get your key from the API Key guide.

curl -X POST 'https://e.customjs.io/html2pdf' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "input": { "html": "<h1>Hello</h1>" } }' > output.pdf

Rate Limiting

Every response includes your current usage in the rate-limit headers.

HeaderDescription
x-ratelimit-limitMaximum requests allowed in the current window
x-ratelimit-usedRequests used in the current window
x-ratelimit-remainingRequests remaining in the current window

Endpoints

EndpointDescriptionReference
POST /html2pdfConvert HTML or Nunjucks templates to PDFHTML to PDF →
POST /markdown2pdfConvert Markdown to PDFPDF docs →
POST /screenshotCapture website screenshots with automationScreenshot API →
POST /scraperScrape HTML content from websitesWeb Scraper API →
POST /__js1-Execute custom JavaScript codeJS Execution →
POST /pages/page/upload-htmlHost and deploy HTML pagesHTML Pages API →

JavaScript execution

Run arbitrary JavaScript with input data and the built-in helpers. Send the code inline, or save it as a stored function and call it by ID. Full details in the JS Execution reference.

curl -X POST 'https://e.customjs.io/__js1-' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "input": "{\"name\":\"Jon Doe\"}",
    "code": "return input.name"
  }'

Available NPM modules

Available in both inline and stored execution. Need another one? Just ask.

// Available in inline & stored execution
const cheerio = require('cheerio');
const { v4: uuidv4 } = require('uuid');
const axios = require('axios').default;
const AWS = require('@aws-sdk/client-s3');
const jsrsasign = require('jsrsasign');
const forge = require('node-forge');
const jsonwebtoken = require('jsonwebtoken');
const crypto = require('crypto');
const { Configuration, OpenAIApi } = require('openai');
const firebaseAdmin = require('firebase-admin');
const { PDFDocument, rgb } = require('pdf-lib');
const mysql2 = require('mysql2');
const nodemailer = require('nodemailer');
const converter = require('json-2-csv');
const moment = require('moment');
const { getJson } = require('serpapi');
const { Storage } = require('@google-cloud/storage');
const hubspot = require('@hubspot/api-client');
const pipedrive = require('pipedrive');
const { GoogleAuth } = require('google-auth-library');
const googleDrive = require('@googleapis/drive');
const googleDocs = require('@googleapis/docs');
// ...and more

Error Codes

CodeMeaning
200Success
400Bad request. Invalid parameters
401Unauthorized. Invalid API key
500Internal server error

// get started

Ready to make your first call?