Execute JavaScript code instantly with Node.js 22 in a secure, isolated sandbox. No setup, no installs — just write and run.
JavaScript is the language of the web, powering both front-end and back-end development. With Node.js, it brings async/await, the npm ecosystem, and full-stack capabilities to server-side programming.
Our sandbox runs Node.js 22 with full standard library and module support.
Open a session once, then call execute repeatedly — variables, files, and installed packages persist between runs. Perfect for code interpreters and REPL-style agents.
# 1. Create a session curl -X POST https://api.sandboxapi.dev/v1/sessions \ -H "X-RapidAPI-Key: $KEY" \ -d '{"language":"javascript","idle_ttl":300}' # → {"id":"sess_abc","language":"javascript",...} # 2. Execute — first call curl -X POST https://api.sandboxapi.dev/v1/sessions/sess_abc/execute \ -H "X-RapidAPI-Key: $KEY" \ -d '{"code":"let x = 42"}' # 3. Execute again — state carries over curl -X POST https://api.sandboxapi.dev/v1/sessions/sess_abc/execute \ -H "X-RapidAPI-Key: $KEY" \ -d '{"code":"console.log(x * 2)"}'
Integrate secure code execution into your own apps with our REST API. Free tier includes 500 executions per month.
Get API Key on RapidAPI