Docs

Public API, embed script, and MCP connection details.

Public Read-only API

This endpoint is intended for external websites. It returns only published posts and sets CORS to allow any origin.

Method: GET
Path: /api/projects/:apiKey/posts
Auth: :apiKey is the project API key
Returns: only posts where isPublished === true and publishedAt <= now()
curl "https://YOUR_DOMAIN/api/projects/YOUR_API_KEY/posts"
Query params
  • page (default 1)
  • per_page (default 10, max 50)
  • order = asc | desc (default desc)
  • orderby = publishedAt | createdAt | updatedAt
curl "https://YOUR_DOMAIN/api/projects/YOUR_API_KEY/posts?page=1&per_page=10&orderby=publishedAt&order=desc"
{
  "page": 1,
  "per_page": 10,
  "order": "desc",
  "orderby": "publishedAt",
  "posts": [
    {
      "id": "ck...",
      "title": "Hello World",
      "slug": "hello-world",
      "excerpt": "Short summary...",
      "canonicalUrl": "https://example.com/hello-world",
      "featuredImageUrl": "https://cdn.example.com/projects/...",
      "publishedAt": "2026-03-17T12:34:56.000Z",
      "contentMarkdown": "# Markdown\n",
      "contentHtml": "<h1>Markdown</h1>\n",
      "createdAt": "2026-03-17T12:34:56.000Z",
      "updatedAt": "2026-03-17T12:34:56.000Z"
    }
  ]
}

Get a single post by slug

Returns a single published post (same visibility rules).

curl "https://YOUR_DOMAIN/api/projects/YOUR_API_KEY/posts/hello-world"

Embed Script

Drop the script tag on any external website to render published posts.

<div id="nanoblog"></div>
<script
  src="https://YOUR_DOMAIN/embed.js"
  data-api-key="YOUR_API_KEY"
  data-target="#nanoblog">
</script>

MCP (AI Agents)

Connect an MCP-compatible AI client to a specific project using the API key.

https://YOUR_DOMAIN/mcp?key=YOUR_API_KEY
Tools exposed
  • list_posts
  • read_post
  • create_post
  • update_post
  • delete_post
Scheduling semantics
  • Draft: isPublished=false
  • Scheduled: isPublished=true and publishedAt is in the future
  • Published: isPublished=true and publishedAt <= now()
Cookies

We use essential cookies to run the app. With your consent, we’ll also use analytics to improve Nanoblog.

Cookie policy