> For the complete documentation index, see [llms.txt](https://help.rankability.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.rankability.com/api/api-knowledge-base.md).

# Knowledge Base API endpoint

Export all published Knowledge Base articles and FAQ content via the API. Supports JSON and markdown formats, conditional caching, and is ideal for training AI agents with always-current documentation.

The Knowledge Base API endpoint lets you programmatically fetch all published help articles and FAQ content from Rankability. Use it to keep your AI agents, internal wikis, or documentation portals up to date without manual exports.

## Endpoint

```
GET /api/agent/v1/kb/articles
Authorization: Bearer rk_live_...
```

**Scope required:** `kb:read`

## Response formats

The endpoint supports two response formats controlled by the `Accept` header:

### JSON (default)

Returns a structured object with all published articles, the static FAQ markdown, and metadata:

```
curl https://rankability.com/api/agent/v1/kb/articles \
  -H "Authorization: Bearer rk_live_YOUR_KEY_HERE"
```

Response:

```
{
  "articles": [
    {
      "id": "uuid",
      "slug": "what-is-rankability",
      "title": "What is Rankability?",
      "summary": "Rankability is an AI-powered SEO platform...",
      "category": "Getting Started",
      "content_html": "<h2>What Rankability does</h2><p>...</p>",
      "sort_order": 1,
      "created_at": "2026-01-15T10:00:00.000Z",
      "updated_at": "2026-03-20T14:30:00.000Z"
    }
  ],
  "faq_markdown": "# Rankability — Super FAQ\n\n...",
  "meta": {
    "article_count": 25,
    "last_updated": "2026-03-20T14:30:00.000Z",
    "has_faq": true
  }
}
```

Each article includes full HTML content in the `content_html` field. The `faq_markdown` field contains the raw markdown from the comprehensive FAQ document. The `meta` object provides the total article count and the most recent update timestamp so you can detect when content has changed.

### Markdown

Set `Accept: text/markdown` to receive a single combined markdown document. This format is ideal for feeding directly into AI agents or LLMs as training context:

```
curl https://rankability.com/api/agent/v1/kb/articles \
  -H "Authorization: Bearer rk_live_YOUR_KEY_HERE" \
  -H "Accept: text/markdown"
```

The response is a `text/markdown` document with articles grouped by category, HTML converted to markdown, and the FAQ appended at the end.

## Conditional caching

Every response includes `ETag` and `Last-Modified` headers. Use these to avoid re-downloading content that hasn’t changed:

```
curl https://rankability.com/api/agent/v1/kb/articles \
  -H "Authorization: Bearer rk_live_YOUR_KEY_HERE" \
  -H 'If-None-Match: "a1b2c3d4e5f6..."'
```

If the content has not changed, the server returns `304 Not Modified` with no body. This saves bandwidth and processing time when polling for updates.

You can also use `If-Modified-Since` with the `Last-Modified` value from a previous response.

## What’s included

* **All published KB articles** — every help article visible in the Rankability Help Center, organized by category.
* **Static FAQ** — the comprehensive Rankability FAQ document covering every product, feature, pricing plan, and common scenario.

Unpublished or draft articles are excluded.

## Use cases

* **AI agent training** — Feed the markdown export to your AI agent so it can answer Rankability questions accurately using current documentation.
* **Internal knowledge sync** — Pull KB content into your internal wiki, Notion, or Confluence on a schedule.
* **Custom help portals** — Build a client-facing help portal using the JSON response to render articles with your own branding.
* **Change detection** — Use the `meta.last_updated` timestamp or conditional headers to detect when documentation changes and trigger downstream updates.

## Related articles

* [Getting started with the API](/api/api-getting-started.md) — End-to-end walkthrough from your first key to your first API call.
* [Authentication and API keys](/api/api-authentication.md) — Bearer token format, scopes, and key management.
* [Credits, rate limits, and errors](/api/api-credits-rate-limits-and-errors.md) — Rate limit headers and error codes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.rankability.com/api/api-knowledge-base.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
