Quick start

Fetch legislation from the Laws.Africa Content API.

This quick start shows you how to fetch legislation from the Content API. Use this path when your application needs full legislation content or metadata.

You will:

  1. create a Laws.Africa account and API token;

  2. list available legislation;

  3. fetch metadata for a work;

  4. fetch HTML for a legislation portion;

  5. display the HTML.

If you want search, RAG, legal agents or AI grounding, start with the Knowledge Base quick start instead.

Create an API token

In the examples below, replace <YOUR_AUTH_TOKEN> with your token.

Content API requests count toward your account's plan limits. Listing and crawling paginated collections can use many calls, so monitor usage in the platform and read the guidance in manage your plan and subscription.

Get a list of by-laws

Fetch a list of municipal by-laws for the City of Cape Town.

The za-cpt part of the URL identifies the City of Cape Town in South Africa.

Fetch the Animal By-law

Fetch metadata for Cape Town's Animal By-law in JSON format.

The response includes the title, publication details and links to additional API calls.

Fetch the table of contents:

Fetch the HTML content for section 3:

Display the by-law

Use Laws.Africa Law Widgets to style Akoma Ntoso HTML.

Next steps

Last updated