BCLaws

Government API · British Columbia legislation · Canadian law

TL;DR

BCLaws is the official repository for British Columbia's legislative documents, providing a public API to search and retrieve provincial laws, regulations, and bylaws. The API delivers documents in HTML and XML formats covering all current and repealed BC legislation. No API key required. Covers the Revised Statutes of British Columbia, the Consolidated Regulations, and Municipal Bylaws — essential for legal research, compliance, and civic tech projects in Canada's westernmost province.

Quick start: http://www.bclaws.ca/civix/api/v1/documents

No API key needed — Canadian open government data!

How to Use This API

1. List Available Documents

Get a listing of legislative documents available in the system:

http://www.bclaws.ca/civix/api/v1/documents

2. Search by Keyword

Search for documents related to "environmental protection":

http://www.bclaws.ca/civix/search/complete/fullsearch?q=environmental+protection

3. JavaScript — Fetch Legislation

fetch('http://www.bclaws.ca/civix/api/v1/documents')
  .then(r => r.json())
  .then(docs => {
    docs.forEach(doc => {
      console.log(doc.title, '—', doc.id);
      console.log('  Type:', doc.type, '| Updated:', doc.lastUpdated);
    });
  });

4. Python — Search and Save Results

import requests, json

params = {
    'q': 'wildlife conservation',
    'format': 'json'
}
r = requests.get('http://www.bclaws.ca/civix/search/complete/fullsearch', params=params)
if r.status_code == 200:
    results = r.json()
    with open('bc_laws_results.json', 'w') as f:
        json.dump(results, f, indent=2)
    print(f"Saved {len(results)} documents")
List all documents: http://www.bclaws.ca/civix/api/v1/documents

Frequently Asked Questions

What types of documents are available?
The database includes Acts (statutes), Regulations, Orders in Council, Ministerial Orders, and Municipal Bylaws for British Columbia.
Are repealed or outdated laws searchable?
Yes — the system retains repealed and superseded legislation with effective date metadata, useful for historical legal research.
What output formats are supported?
The API returns XML and HTML. Use ?format=xml or ?format=html depending on your parsing needs.
How current is the data?
The BCLaws database is updated whenever new legislation is enacted or amended, typically within a few business days of royal assent.
Can I access the full text of a specific act?
Yes — each document endpoint returns the full legislative text, not just metadata. The document ID from the listing is used to retrieve full content.
Does it cover federal Canadian law too?
No — BCLaws only covers provincial legislation for British Columbia. Federal laws are available through the Justice Laws website at laws-lois.justice.gc.ca.

API Details

API URL
http://www.bclaws.ca/civix/api/v1/documents
Documentation
BCLaws API Docs
Category
Government
Authentication
Not Required
Geographic Coverage
British Columbia, Canada

What You Can Build