StatikAPI Documentation

Build APIs from your data — without backend complexity.

StatikAPI helps you combine external APIs with your own content, shape outputs, and publish reliable structured endpoints. These docs cover the open source foundation, with guidance for local CLI workflows, Cloudflare deployment, and hosted platform usage.

StatikAPI App

Use the hosted visual workflow when you want managed publishing, private APIs, and automation.

Open StatikAPI App

The open source CLI stays free and self-hostable. StatikAPI App adds hosted workflows, visual editing, automations, analytics, and private API access.

Last updated: May 2026

Static Routes

Static routes are the simplest StatikAPI routes.

A file path maps directly to a route path:

text
src-api/
  index.js      -> /
  about.js      -> /about
  team/info.js  -> /team/info

In the regular CLI output model, those become:

text
api-out/index.json
api-out/about/index.json
api-out/team/info/index.json

Example: plain value

js
// src-api/index.js
export default {
  hello: 'world',
  generatedAt: '2026-05-09T12:00:00.000Z',
};

This is the most direct route form:

  • no paths()
  • no params
  • no route-level special handling required

Example: function form

You can also export a function:

js
// src-api/about.js
export default async function data() {
  return {
    name: 'StatikAPI',
    kind: 'static-route-example',
  };
}

That is useful when the value is still static-route-shaped but computed at build time.


When to use a static route

Use a static route when:

  • the path is known ahead of time
  • you do not need URL params
  • the route is a singleton endpoint such as:
    • /
    • /about
    • /site-metadata

If you need multiple concrete pages from one file, use:


Serialization reminder

Static routes still must return JSON-serializable data.

That means:

  • strings are fine
  • numbers are fine
  • plain objects/arrays are fine
  • Date objects are not fine

If you want a timestamp, serialize it yourself:

js
export default {
  generatedAt: new Date().toISOString(),
};

Get started

Ready to publish your first API?

Start locally with the CLI or use StatikAPI App when you want managed publishing and automation.

Start building for free View examples