canlii-api

0.1.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    1
  • 0.1.1
    1

Package Sidebar

Install

npm i canlii-api

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • webarnes