Laws.Africa Developer Guide
  • Laws.Africa Developer Guide
  • Get Started
    • Introduction
    • Quick start
    • Works and expressions
    • Webhooks
    • Changelog
  • Tutorial
    • About the tutorial
    • Module 1: Build a legislation reader
      • Introductory concepts
      • Create a basic Django app
      • Create database models
      • Fetching the data
      • Work listing page
      • Expression detail page
      • Styling with Law Widgets
      • Adding interactivity
      • Staying up to date
    • Module 2: Enrichments and interactivity
      • Basic enrichments
      • Advanced enrichments
      • Advanced interactivity
    • Module 3: Text extraction for search and analysis
      • Why extracting text is important
      • Basics of text extraction
      • Advanced text extraction
      • Extracting text for analysis and machine learning
  • Content API Reference
    • About the Content API
    • Authentication
    • Pagination
    • Places
    • All work expressions
    • Single work expression
      • Commencements
      • Embedded images
      • Publication document
      • Table of Contents
      • Timeline
    • Taxonomy topics
    • Enrichment datasets
  • AI API Reference
    • About the AI API
    • Authentication
    • Knowledge Bases
  • How-to Guides
    • How to use the Table of Contents API
    • How to download images
Powered by GitBook
On this page
  • Key concepts
  • Places
  • FRBR URIs
  • Works and expressions
  • Formatting Legislation HTML with Law Widgets
  1. Get Started

Introduction

PreviousLaws.Africa Developer GuideNextQuick start

Last updated 1 year ago

This guide is for developers who want to use the Laws.Africa Content API to fetch legislative content and metadata from Laws.Africa. We assume that you have a basic understanding of REST APIs and the standard for legislation (acts in particular).

The API is a read-only API for listing and fetching published versions of legislative works. Using it, you can:

  • get a list of places (countries and localities)

  • get a list of all works by country and year

  • get a JSON description of a work

  • get Akoma Ntoso XML for a work

  • get a human-friendly HTML version of a work

Key concepts

Places

All legislation content is contained in a place, which is either a country or a locality inside a country.

A country is identified by a unique such as za for South Africa.

A locality is a place inside a country such as a province, county, state or municipality. A locality is identified by a unique code, which is made up of the country code, a hypen, and a unique code assigned to the locality by a suitable authority. For example, the code for Cape Town, South Africa is za-cpt.

FRBR URIs

FRBR URIs are used heavily in the Laws.Africa API to identify works and expressions.

The FRBR URI is part of the standard and builds on the principles in the .

An example FRBR URI is /akn/za/act/1998/55 which identifies South African Act 55 of 1998. It is made up of these parts:

  1. akn - this prefix indicates the URI uses the Akoma Ntoso (AKN) format

  2. za - the place code identifying South Africa

  3. act - the work type

  4. 1998 - the year of the act

  5. 55 - the number of the act

Works and expressions

Two important concepts that are an essential part of the API are works and expressions.

  • A Work is a piece of legislation, such as an act, regulation or by-law. A work may be amended over time and may even have its title changed. A work is uniquely identified by a work FRBR URI which never changes.

  • An Expression is a version of a Work in specific language at a particular point in time. A work can have many expressions, usually one for each official language and amendment. An expression is uniquely identified by its own expression FRBR URI, which is derived from the work's FRBR URI.

An example of a work is the South African Employment Equity Amendment Act, 2013 (Act 55 of 1998) with unique work FRBR URI /akn/za/act/1998/55. This act has been amended a number of times since it was first passed. Each amended version (also called a point in time) is a unique expression of the work.

The English expression of the work, as it was amended on 17 January 2014, is uniquely identified by the expression FRBR URI /act/1998/55/eng@2014-01-17. You can see that this is built from the work's URI, with a language code eng and the expression date 2014-01-17 included.

Formatting Legislation HTML with Law Widgets

Laws.Africa transforms Akoma Ntoso XML into HTML content that looks best when styled with .

Akoma Ntoso
ISO3166 two-letter country code
Akoma Ntoso Naming Convention
Functional Requirements for Bibliographic Records (FRBR)
Laws.Africa's Law Widgets