Skip to content
Access the CanLII API in NodeJS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
lib
test
.gitignore
Gruntfile.js
LICENSE
README.md
package.json

README.md

canlii-api-node

Installation

npm install canlii-api

Usage

var api = require('canlii-api');
api.config({
	api_key: 'YOUR API KEY'
});

api.caseBrowse({databaseId: 'csc-scc', caseId: '2008scc9'}, function(error, result) {
	console.log(result);
});

The condensed case and legislation entries returned by the API methods can be fed back into the API to return the full case entries, like so:

api.caseBrowse({databaseId: 'csc-scc', offset: 0, resultCount: 1}, function(error, result) {
	var condensedCase = result.cases[0];
	console.log(condensedCase);
	
	api.caseBrowse(condensedCase, function(error, result) {
		console.log(result);
	});
});

This should return something like:

{
	"databaseId": "csc-scc",
	"caseId": "2014scc40",
	"title": "Canadian National Railway Co. v. Canada (Attorney General)",
	"citation": "2014 SCC 40 (CanLII)"
}

{
  "databaseId": "csc-scc",
  "caseId": "2014scc40",
  "url": "http://canlii.ca/t/g6z0w",
  "title": "Canadian National Railway Co. v. Canada (Attorney General)",
  "citation": "2014 SCC 40 (CanLII)",
  "language": "en",
  "docketNumber": "35145",
  "decisionDate": "2014-05-23"
}

Methods

caseBrowse

caseBrowse normalizes caseId in returns from the API (contrary to the documentation, the API returns an object instead of a string when listing cases).

legislationBrowse

caseCitatorTease

search

You can’t perform that action at this time.