codapi

Embeddable code playgrounds

for education, documentation, and fun

Embed interactive code snippets directly into your product documentation, online course, or blog post.

msg = "Hello, World!"
print(msg)
let msg: string = "Hello, World!"
console.log(msg)
create table data(message text);
insert into data values ('Hello, World!');
select * from data;
msg="Hello, World!"
echo $msg
#include <stdio.h>

void main() {
    const char* msg = "Hello, World!";
    printf("%s\n", msg);
}
and many more!

Education, documentation, fun

Make education more effective — add interactive exercises to your courses.
Increase product adoption — allow developers to interact with your software in tutorials and how-tos.
Engage readers — embed executable code examples in your articles and blog posts.

Playground

Try everything

Supports 25 playgrounds out of the box, plus custom sandboxes if you need them.

programming languages
JavaScript TypeScript Python Rust C# Go Java C++ Kotlin C PHP Dart Swift Ruby Lua Elixir Zig Haskell Julia F# Clojure OCaml Nim Odin

databases
PostgreSQL MySQL SQLite Redis ClickHouse

network
curl Fetch API HTTP

others
Bash

And more to come!

Bring your own environment

Codapi is not limited to the boring run command. You can lint, test and benchmark code, or run custom commands.

Codapi goes beyond a fixed set of programming languages and tools. Build your own playgrounds with custom packages and software, and use them for fun and profit.

Use templates and multi-file playgrounds for larger projects. This gives your students or readers a more immersive, "desktop-like" programming experience.

Integrate in minutes

Codapi is specifically designed for embedding in articles, product documentation, online courses, mobile apps, etc. — so it's very lightweight.

Integration via JavaScript widget:

<!-- code snippet -->
<pre>print("hello world!")</pre>

<!-- playground widget attaches to the previous snippet -->
<codapi-snippet sandbox="python" editor="basic">
</codapi-snippet>

<!-- playground script -->
<script src="https://unpkg.com/@antonz/codapi/dist/snippet.js">
</script>

Or an API:

POST https://api.codapi.org/v1/exec
authorization: bearer ***
content-type: application/json

{
    "sandbox": "python",
    "command": "run",
    "files": {
        "": "print(\"hello world\")"
    }
}

Available as a cloud service and as a self-hosted version. Self-hosting is especially useful in enterprise environments to provide playgrounds for working with internal products and libraries.

Codeapi is in private beta. Request access if you are interested in trying it out.

Join the beta

Showcase

Curious about real-world use cases? Here are a few:

Mastering curl curl, bash

API tutorials beyond OpenAPI fetch, javascript, python

SQL join flavors postgres, sqlite

Built-in functions in Go 1.21 go

Trying Odin odin

Privacy-first

Cloud version processes submitted code in the data center located in Germany. The code is discarded immediately after processing. No data is stored or shared with third parties.

Self-hosted version processes everything locally. No internet access required.

Codapi does not track you or use any kind of telemetry.