API Maker

The backend engine for the AI era

Chapters

What you will learn

  • The language picker of a custom API
  • The same API in eight languages
  • The same g in each
  • Eight calls, one answer
  • Compiled when saved
  • A compile error, in the console
In the docsLanguages
Transcript751 words · click a time to play from there

Intro

You can write one custom API in eight languages: TypeScript, Python, PHP, C sharp, Go, Rust, Java, and Kotlin. Each team writes the language it knows, and every API answers in the same way. In this video, we write the same API eight times.

Several languages, the usual way

When a team uses many languages, it usually needs one framework for each language, each with its own server and its own deploy. Each service shapes its answers and errors in its own way. And a compile error is found by the build, or by a user. With API Maker, you choose the language for each API, on one server. Every language answers in the same shape. And compiled code is compiled the moment you save it.

In this video: the language picker, one API in eight languages, eight calls with one answer, code compiled when you save, and a compile error.

The language picker

Open Custom API, click Add New, and open the Code tab. TypeScript comes first. It runs on Node.js, on Bun, or on the default runtime of the sandbox settings. Now open the language picker, and pick Python. The code becomes the Python template. It shows what g holds, as comments, and a main function that answers hello. Now pick Go, and we get the same template, in Go. Close it.

Nothing is saved.

One API, eight languages

Now we write one API, eight times. It reads a name from the body, counts the customers in PostgreSQL, and answers with both. In TypeScript, we await g.sys.db.count. Python makes the same call. PHP makes the same call, with arrows. C sharp makes the same call, with capital letters. Go returns a value and an error. Rust returns a Result. The question mark hands a failure back to API Maker.

Java and Kotlin return a map. So there are eight languages, and one g: the request, the answer, the calls of API Maker, and the logs. Here are the eight APIs in the grid. Each has a path and a language. You also see the speed of the day: a few milliseconds a call. For Java and Kotlin, the first call also starts their runtime. Pick Hello Rust, click Edit, and you see its code, as we wrote it.

Close it. Now click Test API on Hello Kotlin. Open the body, and type the name Calm Home. Send. The answer is hello Calm Home, and sixty customers. From a terminal, we call the eight paths, one after the other, with the token of an API user. We get eight answers, with the same shape and the same data. Go and Java list the keys in another order. Their maps keep no order, and a JSON object does not need one.

Compiled when saved

Five of the eight languages are compiled: C sharp, Go, Rust, Java, and Kotlin. When you save, API Maker compiles the code right away, in the background, in a sandbox of the account. So the first call does not wait for the compiler. If the code does not compile, the error is written to the console of the account. TypeScript, Python, and PHP have nothing to compile. Open Custom API, pick Hello Go, click Edit, and open its code.

We make a typo, the way it happens in real life: cuont instead of count. Click Update. It is saved. Click Test API, open the body, type a name, and Send. The answer is five hundred: the code does not compile. count is declared and not used, and cuont is undefined, each with its line. And Console Logs View shows that the compiler said so as soon as the code was saved.

Good to know

Good to know. An API and all its hooks use one language, on one runtime. Packages are added for each language, for every sandbox of that language. Video sixteen shows it. Utility classes are also written for each language. Video twenty shows them. And test cases come in the same eight languages. Video thirty seven shows them.

Built on standards

Every language gets the same g, with its types. Every language answers with the same shape and the same errors. So code written by a person or by an AI assistant, in any of the eight languages, gives the client the same answer.

Recap

To sum up. Eight languages, chosen for each API. The same g in each one. The same answer from all eight. Code compiled when you save, and every compile error in the console. Next: hooks, code that runs before and after every API. API Maker. Build faster, spend smarter, deliver better.