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

Remote Routes (Build‑time Fetch)

Fetch external data during build in data().

Example: /posts

js
// src-api/posts/index.js
export default async function data() {
  const res = await fetch('https://jsonplaceholder.typicode.com/posts?_limit=5', {
    headers: { Accept: 'application/json' },
    cache: 'no-store',
  });
  if (!res.ok) return { error: 'Upstream HTTP ' + res.status };
  const posts = await res.json();
  return { count: posts.length, posts, generatedAt: new Date().toISOString() };
}

Example: /posts/:id (dynamic + remote)

js
// src-api/posts/[id].js
export async function paths() {
  return ['1', '2', '3'];
}
export async function data({ params }) {
  const res = await fetch('https://jsonplaceholder.typicode.com/posts/' + params.id, {
    headers: { Accept: 'application/json' },
    cache: 'no-store',
  });
  if (!res.ok) return { error: 'Upstream HTTP ' + res.status, id: params.id };
  const post = await res.json();
  return { id: params.id, post, generatedAt: new Date().toISOString() };
}

Remote fetches run at build time, and their responses are baked into static JSON.

That means:

  • regular CLI builds fetch remote data when you run statikapi build
  • regular CLI dev mode refetches when a rebuild happens
  • Cloudflare public routes refetch on build + deploy
  • Cloudflare private routes can refetch on authenticated private rebuild webhooks

This is the key mental model:

  • the route is generated ahead of reads
  • the fetch does not happen on every client request

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