Skip to content

REST API endpoints for programmatic access to your documentation

API Reference

See also: AI Native explains the design philosophy behind these endpoints and how AI agents use them.

Every Denote site exposes several API endpoints for programmatic access. These are available automatically — no configuration required.

Endpoints

GET /api/docs

Returns all documentation pages as structured JSON.

bash
curl https://your-docs.com/api/docs

Response:

json
{
  "name": "My Project",
  "pages": [
    {
      "slug": "introduction",
      "title": "Introduction",
      "description": "Welcome to the project",
      "aiSummary": "One-line summary from ai-summary frontmatter",
      "aiKeywords": ["keyword1", "keyword2"],
      "content": "# Introduction\n\nFull markdown content...",
      "headings": [
        { "level": 1, "title": "Introduction", "id": "introduction" },
        { "level": 2, "title": "Quick Start", "id": "quick-start" }
      ]
    }
  ],
  "llmsFullTxt": "https://your-docs.com/llms-full.txt",
  "mcp": {
    "endpoint": "https://your-docs.com/mcp",
    "transport": "Streamable HTTP",
    "tools": ["search_docs", "get_doc", "get_all_docs"]
  }
}

GET /api/search

Returns a serialized MiniSearch index for client-side full-text search. The index includes all pages with titles, descriptions, content, and AI metadata. It supports fuzzy matching, prefix search, and field boosting (titles are weighted 4x, descriptions 2x).

bash
curl https://your-docs.com/api/search

The response is a MiniSearch JSON object (not a flat array of documents). The Search island fetches this on first Cmd+K open and deserializes it with MiniSearch.loadJSON() for instant client-side search.

GET /llms.txt

Returns an AI-readable index of your documentation following the llms.txt standard.

bash
curl https://your-docs.com/llms.txt

Response:

text
# My Project

> Project documentation

## Docs

- [Introduction](https://your-docs.com/docs/introduction): Welcome to the project
- [Installation](https://your-docs.com/docs/installation): How to install

## API

- [Full docs as markdown](https://your-docs.com/llms-full.txt): Complete documentation
- [Structured JSON](https://your-docs.com/api/docs): All pages as JSON

GET /llms-full.txt

Returns your entire documentation concatenated into a single markdown file. Designed for loading into AI context windows.

bash
curl https://your-docs.com/llms-full.txt

This is useful for:

  • Feeding full project context to an LLM
  • Building RAG pipelines
  • Generating embeddings across all your docs

MCP Server

For richer AI integration, Denote includes a built-in Model Context Protocol server. See the AI Native page for setup instructions.

MCP Tools

ToolDescription
search_docsFuzzy search with prefix matching and field boosting
get_docGet full content of a page by slug
get_all_docsGet entire documentation as one text block

MCP Resources

ResourceDescription
docs://indexList of all available documentation pages
docs://{slug}Content of a specific documentation page

Custom Endpoints

Register custom API routes on the Fresh app instance in your main.ts. The app returned by denote() is a standard Fresh app, so you can add routes with app.get(), app.post(), etc.:

typescript
// main.ts
import { denote } from "@denote/core";
import { config } from "./denote.config.ts";

export const app = denote({ config });

app.get("/api/custom", (ctx) => {
  return new Response(JSON.stringify({ hello: "world" }), {
    headers: { "Content-Type": "application/json" },
  });
});

Fresh

Denote is built on Fresh. For details on routing, middleware, and app configuration, see the Fresh documentation.

Next Steps