// api reference
Run JavaScript natively inside any HTTP request. Pass your code inline for quick, one-off runs, or save a stored function and call it by ID. With helpers like HTML2PDF and a library of NPM modules built in.
Base URL
https://e.customjs.ioGet your API key from app.customjs.space. See the API Key guide.
For common tasks like HTML to PDF, screenshots, and scraping we offer dedicated endpoints. No JavaScript required.
Send the code directly in the request body. Ideal for quick tests or dynamic, one-off executions.
Pros
Cons
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": "<h1>Hello World</h1>" },
"code": "const { HTML2PDF } = require(\"./utils\"); return HTML2PDF(input.html);",
"returnBinary": "true"
}' > output.pdfSave the code once on the platform and call it by its Script ID. Ideal for recurring workflows, versioning, and keeping requests small.
Pros
Cons
Open the Code Editor in the CustomJS app.
Create a new script and enter your code.
Save it and note the Script ID.
Call /{scriptId} with your input data.
curl -X POST 'https://e.customjs.io/5CbuoC' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"Users": "[{\"name\":\"John\",\"lastName\":\"Doe\"}]"
}'| Inline | Stored | |
|---|---|---|
| Implementation | Code sent in the request body | Saved on CustomJS, referenced by ID |
| Best for | Quick tests, one-off runs | Production, versioning, sharing logic |
| Setup effort | Minimal. Write and run | Save the function first |
| Reusability | Limited. Redefine each time | High. Reuse across workflows |
| Maintainability | Harder to manage changes | Update once in one place |
These modules are 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// try it first
Open the playground on the product page. Write JavaScript, hit run, and copy the generated curl or SDK snippet straight into your stack.
curl -X POST 'https://e.customjs.io/__js1-' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"input": "{\"name\":\"Jon Doe\"}",
"code": "return input.name"
}'600 free executions / month ยท no credit card