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 a insight.
insight
.{
"id": "insight_abc123",
"object": "insight",
"type":"outcome",
"data":{
"outcome":{
"type":"infructuous",
"reason":"The petition was disposed of because the detenu has been released, resulting in the petition becoming no longer valid."
}
}
}
Returns a list of insights for a given case.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/insights
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const insights = await kanoon.courts.cases.insights.list("JKHC01", "JKHC01-003375-2023");
console.log(insights);
}
main()
{
"object": "list",
"data": [
{
"id": "insight_abc123",
"object": "insight",
"type":"outcome",
"data":{
"outcome":{
"type":"infructuous",
"reason":"The petition was disposed of because the detenu has been released, resulting in the petition becoming no longer valid."
}
}
},
{...},
{...}
],
"first_id": "insight_abc123",
"last_id": "insight_xyz789",
"has_more": true,
}
Retrieve a insight object.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/insights/{insight_id}
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const insight = await kanoon.courts.cases.insights.retrieve("JKHC01", "JKHC01-003375-2023", "insight_abc123");
console.log(insight);
}
main()
{
"id": "insight_abc123",
"object": "insight",
"type":"outcome",
"data":{
"outcome":{
"type":"infructuous",
"reason":"The petition was disposed of because the detenu has been released, resulting in the petition becoming no longer valid."
}
}
}
This is an object representing a order.
court.case.order
.{
"id": "JKHC01-0000001-2020-1",
"object": "court.case.order",
"created_at": "2024-01-01",
"judges": ["Justice Alok Aradhe"],
"url": "https://file.kanoon.dev/orders/HCBM01-000000123-2015?Expires=1716502780&Signature=lZljjzI3V7iqv0lgvuX8rGJ8%2FyQlF1LCMf9scnWuJhY6t8DyoJxW93GfSYoDZXZJXNiv0Zq3zX2C7blhHQBNBw%3D%3D&Key-Pair-Id=APKAX1YF3XAMPLE99J3GQ",
"notes": [
"In the case before the High Court of Judicature at Bombay, the court heard the counsels for the petitioner and the state, along with Shweta Singh, her parents, and the investigating officer.",
"The NGO's report indicated that Shweta showed confusion and uncertainty about her future during counseling sessions. They recommended that both Shweta and her parents undergo additional counseling to enhance their relationships and create a healthier environment.",
"Considering the situation, the court decided to adjourn the matter to November 18, 2015, at 3:00 p.m., and instructed that the counseling sessions with the NGO continue. Shweta is to remain in her parents' custody, and police officers are to ensure she comes to court on the next date."
]
}
Returns a list of court case orders for a given case.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/orders
list
.import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const orders = await kanoon.courts.cases.orders.list("JKHC01", "JKHC01-003375-2023");
console.log(orders);
}
main();
{
"object": "list",
"data": [
{
"id": "JKHC01-0000001-2020-1",
"object": "court.case.order",
"created_at": "2024-01-01",
"judges": ["Justice Alok Aradhe"],
"url": "https://file.kanoon.dev/orders/HCBM01-000000123-2015?Expires=1716502780&Signature=lZljjzI3V7iqv0lgvuX8rGJ8%2FyQlF1LCMf9scnWuJhY6t8DyoJxW93GfSYoDZXZJXNiv0Zq3zX2C7blhHQBNBw%3D%3D&Key-Pair-Id=APKAX1YF3XAMPLE99J3GQ",
"notes": [
"In the case before the High Court of Judicature at Bombay, the court heard the counsels for the petitioner and the state, along with Shweta Singh, her parents, and the investigating officer.",
"The NGO's report indicated that Shweta showed confusion and uncertainty about her future during counseling sessions. They recommended that both Shweta and her parents undergo additional counseling to enhance their relationships and create a healthier environment.",
"Considering the situation, the court decided to adjourn the matter to November 18, 2015, at 3:00 p.m., and instructed that the counseling sessions with the NGO continue. Shweta is to remain in her parents' custody, and police officers are to ensure she comes to court on the next date."
]
},
{...},
{...}
],
"first_id": "JKHC01-0000001-2020-1",
"last_id": "JKHC01-0000001-2020-3",
"has_more": true,
}
Retrieve an order.
GEThttps://api.kanoon.dev/v1/courts/{court_id}/cases/{case_id}/orders/{order_id}
import { Kanoon } from "kanoon";
const kanoon = new Kanoon({
apiKey: "sk-xxxx",
});
async function main() {
const order = await kanoon.courts.cases.orders.retrieve("JKHC01", "JKHC01-003375-2023", "JKHC01-0000001-2020-1");
console.log(order);
}
main();
{
"id": "JKHC01-0000001-2020-1",
"object": "court.case.order",
"created_at": "2024-01-01",
"judges": ["Justice Alok Aradhe"],
"url": "https://file.kanoon.dev/orders/HCBM01-000000123-2015?Expires=1716502780&Signature=lZljjzI3V7iqv0lgvuX8rGJ8%2FyQlF1LCMf9scnWuJhY6t8DyoJxW93GfSYoDZXZJXNiv0Zq3zX2C7blhHQBNBw%3D%3D&Key-Pair-Id=APKAX1YF3XAMPLE99J3GQ",
"notes": [
"In the case before the High Court of Judicature at Bombay, the court heard the counsels for the petitioner and the state, along with Shweta Singh, her parents, and the investigating officer.",
"The NGO's report indicated that Shweta showed confusion and uncertainty about her future during counseling sessions. They recommended that both Shweta and her parents undergo additional counseling to enhance their relationships and create a healthier environment.",
"Considering the situation, the court decided to adjourn the matter to November 18, 2015, at 3:00 p.m., and instructed that the counseling sessions with the NGO continue. Shweta is to remain in her parents' custody, and police officers are to ensure she comes to court on the next date."
]
}