You can interact with the API through HTTP requests via our official Node.js library.
To install the official Node.js library, run the following command in your Node.js project directory:
pnpm install kanoon
The Kanoon API uses API keys for authentication.
Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.
All API requests should include your API key in the Authorization HTTP header as follows:
Authorization: Bearer KANOON_API_KEY
This object represents the courts in the judicial wing of the Government of India. Use it to retrieve information about courts and cases.
This is an object representing a court.
court
.{
"id": "APHC01",
"object": "court",
"name": "Allahabad High Court"
}
Returns a list of courts.
GEThttps://api.kanoon.dev/v1/courts
name
of the objects. asc
for ascending order and desc
for descending order.after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const courts = await kanoon.courts.list();
console.log(courts);
}
main();
[
"object": "list",
"data": [
{
"id": "APHC01",
"object": "court",
"name": "Allahabad High Court",
},
{
"id": "HCBM01",
"object": "court",
"name": "Bombay High Court",
},
{...},
{...},
]
]
Retrieve a court.
GEThttps://api.kanoon.dev/v1/courts/{court_id}
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const court = await kanoon.courts.retrieve("APHC01");
console.log(court);
}
main()
{
"id": "APHC01",
"object": "court",
"name": "Allahabad High Court"
}
This is an object representing a court.
court.case
.{
"id": "JKHC01-003375-2023",
"object": "case",
"court_id": "JKHC01",
"filed_at": "2023-07-15",
"registered_at": "2023-07-15",
"status": "in_progress",
"type": "HCP",
"state": "Jammu and Kashmir",
"district": "Srinagar",
"petitioners": [
"Kaisar Ahmad Sheikh",
"Mr. S.A. Hussain"
],
"decided_at": null,
"respondents": [
"Union Territory of Jammu and Kashmir and Ors. (Home Department)"
]
}
Returns a list of cases for a given court.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases
filed_at
timestamp of the objects. asc
for ascending order and desc
for descending order.after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.in_progress
or disposed
.import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const cases = await kanoon.courts.cases.list("JKHC01", {
limit: 5,
order: "desc",
});
console.log(cases);
}
main()
{
"object": "list",
"data": [
{
"id": "JKHC01-003443-2023",
"object": "case",
"filed_at": "2023-07-19",
"registered_at": "2023-07-19",
"court_id": "JKHC01",
"decided_at": null,
"status": "in_progress",
"type": "HCP",
"state": "Jammu and Kashmir",
"district": "Srinagar",
"petitioners": [
"Zubair Ahmad Bhat",
"Mr. Wajid Mohammad Haseeb"
],
"respondents": [
"Union Territory of Jammu and Kashmir and Anr. (Home Department)"
]
},
{...},
{...}
],
"first_id": "JKHC01-003443-2023",
"last_id": "JKHC01-003543-2023",
"has_more": true,
}
Retrieve a case.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const courts = await kanoon.courts.cases.retrieve("JKHC01", "JKHC01-003375-2023");
console.log(courts);
}
main()
{
"id": "JKHC01-003375-2023",
"object": "case",
"court_id": "JKHC01",
"filed_at": "2023-07-15",
"registered_at": "2023-07-15",
"status": "in_progress",
"type": "HCP",
"state": "Jammu and Kashmir",
"district": "Srinagar",
"petitioners": [
"Kaisar Ahmad Sheikh",
"Mr. S.A. Hussain"
],
"decided_at": null,
"respondents": [
"Union Territory of Jammu and Kashmir and Ors. (Home Department)"
]
}
This is an object representing a case event.
court.case.event
.admission
, final_hearing
, orders
, judgment
, dismissal
, evidence
, procedural
, filing
, transferred
, infructuous
, or other
. {
"id": "event_abc123",
"object": "court.case.event",
"case_id": "JKHC01-003375-2023",
"judge": "Justice Alok Aradhe",
"scheduled_at": "2023-07-15",
"heard_at": "2023-07-20",
"purpose": "final_hearing"
}
Returns a list of events for a given case.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/events
scheduled_at
timestamp of the objects. asc
for ascending order and desc
for descending order.after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.admission
, final_hearing
, orders
, judgment
, dismissal
, evidence
, procedural
, filing
, transferred
, infructuous
, or other
. import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const events = await kanoon.courts.cases.events.list("JKHC01", "JKHC01-003375-2023", {
limit: 5,
order: "desc",
});
console.log(events);
}
main()
{
"object": "list",
"data": [
{
"id": "event_abc123",
"object": "court.case.event",
"case_id": "JKHC01-003375-2023",
"judge": "Justice Alok Aradhe",
"scheduled_at": "2023-07-15",
"heard_at": "2023-07-20",
"purpose": "final_hearing"
},
{...},
{...}
],
"first_id": "event_abc123",
"last_id": "event_xyz789",
"has_more": true,
}
Retrieve a case event.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/events/{event_id}
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const event = await kanoon.courts.cases.events.retrieve("JKHC01", "JKHC01-003375-2023", "event_abc123");
console.log(event);
}
main()
{
"id": "event_abc123",
"object": "court.case.event",
"case_id": "JKHC01-003375-2023",
"judge": "Justice Alok Aradhe",
"scheduled_at": "2023-07-15",
"heard_at": "2023-07-20",
"purpose": "final_hearing"
}
Case events can have various purposes that describe the reason for the event. Use these purposes to understand the context of the event and the stage of the case.
This is an object representing an act.
GEThttps://api.kanoon.dev/v1/acts/{act_id}
act
.import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const act = await kanoon.acts.retrieve("COI");
console.log(act);
}
main()
{
"id": "COI-1949",
"object": "act",
"name": "Constitution of India",
"enacted_at": "1949-11-26"
}