Skip to content

Commit 10baadc

Browse files
devin-ai-integration[bot]kafkasdevalog
authored
Document RFC 9727 API catalog discovery endpoint (#5291)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Anar Kafkas <anarkafkas@gmail.com> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent 07155bc commit 10baadc

5 files changed

Lines changed: 60 additions & 3 deletions

File tree

fern/products/docs/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ navigation:
201201
- page: MCP server
202202
path: ./pages/ai/mcp-server.mdx
203203
slug: mcp-server
204+
- page: API catalog discovery
205+
path: ./pages/ai/api-catalog.mdx
206+
slug: api-catalog
204207
- section: Ask Fern
205208
slug: ask-fern
206209
contents:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: API catalog discovery
3+
description: Fern docs sites expose a standards-based API catalog endpoint so AI agents, MCP clients, and API catalog crawlers can discover your APIs automatically.
4+
---
5+
6+
Fern Docs sites implement [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727) to let AI agents, MCP clients, and API catalog crawlers discover your APIs without scraping HTML. The catalog is generated from your visible [API Reference](/learn/docs/api-references/overview) navigation and advertised on every page via a [`Link`](https://www.rfc-editor.org/rfc/rfc8288) response header — no configuration required. References hidden via `hidden: true` (or with all endpoints hidden) are excluded.
7+
8+
Your API catalog is available at `your-documentation-site.com/.well-known/api-catalog`. For example, this site's catalog is at [buildwithfern.com/learn/.well-known/api-catalog](https://buildwithfern.com/learn/.well-known/api-catalog):
9+
10+
```bash
11+
curl -s https://buildwithfern.com/learn/.well-known/api-catalog | jq .
12+
```
13+
14+
For sites with a basepath like `/docs`, the catalog lives under that basepath (e.g. `https://example.com/docs/.well-known/api-catalog`).
15+
16+
## Response format
17+
18+
The endpoint returns a [Linkset document](https://www.rfc-editor.org/rfc/rfc9264) listing each visible API. Each entry contains:
19+
20+
- **`anchor`** — the URL of the human-readable API Reference page
21+
- **`service-desc`** — the machine-readable [OpenAPI spec](/learn/docs/developer-tools/openapi-spec)
22+
- **`service-doc`** — the same reference page as the anchor
23+
24+
```json title="Example response"
25+
{
26+
"linkset": [
27+
{
28+
"anchor": "https://example.docs.com/api-reference",
29+
"service-desc": [
30+
{
31+
"href": "https://example.docs.com/openapi.yaml?api=abc123",
32+
"type": "application/yaml"
33+
}
34+
],
35+
"service-doc": [
36+
{
37+
"href": "https://example.docs.com/api-reference",
38+
"type": "text/html"
39+
}
40+
]
41+
}
42+
]
43+
}
44+
```

fern/products/docs/pages/ai/overview.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ AI helps keep your documentation current. Fern Writer is a Slack-based technical
4040

4141
## Optimize for AI
4242

43-
Your site is automatically optimized for AI tools and search engines. Fern hosts `llms.txt` and `llms-full.txt` files so LLMs can index your documentation efficiently, and serves Markdown instead of HTML to AI agents. These features reduce token consumption and help agents process your content faster.
43+
Your site is automatically optimized for AI tools and search engines. Fern hosts `llms.txt` and `llms-full.txt` files so LLMs can index your documentation efficiently, serves Markdown instead of HTML to AI agents, and exposes a standards-based API catalog for automated discovery. These features reduce token consumption and help agents process your content faster.
4444

45-
<CardGroup cols={3}>
45+
<CardGroup cols={2}>
4646
<Card title="Markdown access" icon="file-code" href="/learn/docs/ai-features/markdown" />
4747
<Card title="`llms.txt`" icon="file-text" href="/learn/docs/ai-features/llms-txt" />
4848
<Card title="Agent directives" icon="compass" href="/learn/docs/ai-features/agent-directives" />
49+
<Card title="API catalog discovery" icon="radar" href="/learn/docs/ai-features/api-catalog" />
4950
</CardGroup>

fern/products/docs/pages/api-references/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Overview of API References
33
description: Understand how to generate, customize, and enhance API Reference documentation with Fern.
44
---
55

6-
Fern generates interactive API Reference documentation from an [OpenAPI specification](/learn/api-definitions/openapi/overview), [Fern Definition](/learn/api-definitions/ferndef/overview), or other API formats. Endpoints, type schemas, code snippets, and [AI-generated examples](/learn/docs/ai-features/ai-examples) are all populated automatically. Users can try requests directly from the docs with the [API Explorer](/learn/docs/api-references/api-explorer).
6+
Fern generates interactive API Reference documentation from an [OpenAPI specification](/learn/api-definitions/openapi/overview), [Fern Definition](/learn/api-definitions/ferndef/overview), or other API formats. Endpoints, type schemas, code snippets, and [AI-generated examples](/learn/docs/ai-features/ai-examples) are all populated automatically. Users can try requests directly from the docs with the [API Explorer](/learn/docs/api-references/api-explorer), and AI agents and crawlers can discover your APIs via the [API catalog](/learn/docs/ai-features/api-catalog) endpoint.
77

88
## Pick your API type
99

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
tags: ["ai"]
3+
---
4+
5+
## API catalog discovery
6+
7+
AI agents, MCP clients, and API catalog crawlers can now discover your APIs automatically. Every Fern Docs site exposes a standards-based ([RFC 9727](https://www.rfc-editor.org/rfc/rfc9727)) `/.well-known/api-catalog` endpoint generated from your visible API Reference navigation.
8+
9+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/api-catalog">Read the docs</Button>

0 commit comments

Comments
 (0)