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

# Content API

The Content API is a read-only API for listing and fetching published versions of legislative works.

Use it when your product needs full legislation collections inside your own systems, including:

* Akoma Ntoso XML;
* HTML;
* PDF where available;
* table of contents JSON;
* publication, commencement, amendment and repeal metadata;
* point-in-time legislation versions;
* webhooks for content updates.

For AI grounding, search, RAG and legal agents, start with [Knowledge Bases](/knowledge-bases/knowledge-bases.md). Use the Content API when retrieval is not enough and your product needs deeper control over storage, processing or presentation.

## Endpoint

The latest version of the Content API is version 3:

```
https://api.laws.africa/v3/
```

## What you can build

The Content API is best for:

* legal publishing systems;
* compliance infrastructure;
* internal legal databases;
* offline processing;
* analytics and classification pipelines;
* advanced legislation rendering.

## Content formats

Some API calls can return content in multiple formats. Specify the format by placing `.format` at the end of the URL or by using the `Accept` header.

* `.json` or `Accept: application/json`: JSON
* `.xml` or `Accept: application/xml`: Akoma Ntoso XML
* `.html` or `Accept: text/html`: HTML
* `.epub` or `Accept: application/epub+zip`: ePUB
* `.pdf` or `Accept: application/pdf`: PDF
* `.zip` or `Accept: application/zip`: ZIP file with XML and media attachments

{% hint style="info" %}
Not all responses support all formats. Endpoint reference pages describe the formats available for each response.
{% endhint %}

## OpenAPI schema

* Download the OpenAPI schema from <https://api.laws.africa/v3/schema>
* Swagger UI: <https://api.laws.africa/v3/schema/swagger-ui>
* Redoc: <https://api.laws.africa/v3/schema/redoc>


---

# 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://developers.laws.africa/content-api/content-api.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.
