API Reference
Getting Your API Key
- Log in to your Dashboard
- Go to Settings → API Keys
- Click "Create Key" and copy your API key
- Store it securely (environment variable recommended)
Recommended REST API usage
Recommended: Use the NPM Package
For most use cases we recommend using the javascript-obfuscator npm package (v5.3.0+) directly via CLI or Node.js API. This is also the only officially supported way to obfuscate files larger than 4.4MB.
Installation
npm install -g javascript-obfuscatorExamples
# Basic usage (standard obfuscation)
javascript-obfuscator input.js --output output.js
# VM obfuscation (requires Pro API token)
javascript-obfuscator input.js --output output.js \
--pro-api-token=<YOUR_PRO_API_TOKEN> \
--vm-obfuscation=true \
--options-preset=vm-medium-obfuscation
# VM obfuscation with a specific version (requires Pro API token)
javascript-obfuscator input.js --output output.js \
--pro-api-token=<YOUR_PRO_API_TOKEN> \
--pro-api-version=5.0.3 \
--vm-obfuscation=true \
--vm-bytecode-format=binary
# Obfuscation with Parse HTML option (requires Pro API token)
javascript-obfuscator input.js --output output.js \
--pro-api-token=<YOUR_PRO_API_TOKEN> \
--parse-html=true \
--compact=true \
--control-flow-flattening=true \
--dead-code-injection=true \
--string-array=true
# Standard obfuscation (no token needed)
javascript-obfuscator input.js --output output.js \
--compact=true \
--control-flow-flattening=true \
--dead-code-injection=true \
--string-array=trueSee CLI documentation for all available options.
Manual REST API usage
Endpoint
https://obfuscator.io/api/v1/obfuscate
Method
POSTHeaders
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
Query Parameters
version optional - Obfuscator version to use
Defaults to latest (7.12.1).
Response Format
The API uses NDJSON streaming (application/x-ndjson). Large results are automatically chunked in 1MB pieces for reliable delivery.
code required - JavaScript code to obfuscate
options - Obfuscation options object
At least one Pro feature is required: vmObfuscation: true or parseHtml: true
Available options: compact, controlFlowFlattening, deadCodeInjection, stringArray, sourceMap, and
more.
See the Options Reference section for the complete list of available options.
