/historical-searchStart a historical search
Starts a search for a company and returns its first page in the same call: exactly 100 cases (fewer only when that is all there is), a `searchId`, and a `nextPageToken` (null when there is nothing more).
Overview
Starts a search for a company and returns its first page in the same call: exactly 100 cases (fewer only when that is all there is), a searchId, and a nextPageToken (null when there is nothing more). Requires historicalSearch.write.
Order: newest filing date first from the primary source; further cases that source did not return follow. A case found by both sources is returned once.
If the page cannot be assembled within 60 seconds the call returns 503 with Retry-After; the error details carry the searchId and a nextPageToken to carry on with. Nothing is delivered or charged in that case. The same clientReference with the same request within 24 hours returns the same search and first page again without a new charge.
Limited to the account's requests per minute (default 60): over it, 429 with Retry-After and X-RateLimit-* headers.
Asynchronous mode. Send "mode": "ASYNC" to have the whole result set collected in the background instead of paging it yourself - for when you want everything in one go. The call returns 202 straight away with the searchId and status: RUNNING; no results yet. When the search finishes its status becomes COMPLETE (everything the sources could give, up to the results-per-search cap of your plan) or FAILED (nothing is stored and nothing is charged - start it again). Find out by polling GET /historical-search/{searchId} or, better, by subscribing a webhook to historical_search.finished. Once COMPLETE, read the results page by page (GET /historical-search/{searchId}/results, first page = no token) or download them as one JSON file (GET /historical-search/{searchId}/download). Reading is free: an asynchronous search is billed once, when it completes, and a failed one is never billed. Results and file are kept for 7 days from completion. Available on per-search plans (or when your plan has it switched on); at most 3 asynchronous searches collect at once per account. DELETE on a running search cancels it.
X-CasePrimus-Api-Key header. See Authentication for how to create a key, and Rate limits & errors for how requests are counted.Request body
| Field | Description |
|---|---|
namestring Required | The company's name. 2 to 255 characters |
entityTypeenum Optional | BUSINESS only. A person is refused with PERSON_SEARCH_NOT_SUPPORTED. BUSINESS |
registrationNumberstring or null Optional | Optional, e.g. CIN. Sharpens matching. up to 64 characters |
locationstring or null Optional | Optional address. Sharpens matching. |
nameVariationsarray of string Optional | Other spellings of the name. Added to any generated ones. |
autoNameVariationsboolean Optional | Generate further spellings of the name (adds a few seconds to the first call). |
partyTypeenum Optional | The side the company must be on. PETITIONERRESPONDENTBOTH |
filtersobject Optional | Fixed for the life of the search. Applied by the data sources, so a narrower search costs less. |
fromYearinteger or null Optional | Cases filed in this year or later. minimum 1950 |
toYearinteger or null Optional | Cases filed in this year or earlier. minimum 1950 |
caseStatusenum Optional | ALLPENDINGDISPOSED |
clientReferencestring Optional | Your own reference. Also makes a repeated start call safe to retry. up to 50 characters |
modeenum Optional | SYNC (default) returns the first page now and you page through the rest. ASYNC collects every result in the background: the call returns 202 with the searchId and you are told when it is COMPLETE (see the endpoint description). ASYNC needs a plan that has it (per-search plans do); otherwise 403. SYNCASYNC |
{
"name": "Acme Logistics Private Limited",
"entityType": "BUSINESS",
"registrationNumber": "U63090MH2012PTC123456",
"partyType": "BOTH",
"filters": {
"caseStatus": "ALL"
},
"clientReference": "vendor-onboarding-4821"
}Example request
Replace CASEPRIMUS_API_KEY with your key.
BASE="https://api.caseprimus.ai/api/caseprimus/v1" curl -X POST "$BASE/historical-search" \ -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Logistics Private Limited", "entityType": "BUSINESS", "registrationNumber": "U63090MH2012PTC123456", "partyType": "BOTH", "filters": { "caseStatus": "ALL" }, "clientReference": "vendor-onboarding-4821" }'
const BASE = "https://api.caseprimus.ai/api/caseprimus/v1"; const res = await fetch(BASE + "/historical-search", { method: "POST", headers: { "Content-Type": "application/json", "X-CasePrimus-Api-Key": process.env.CASEPRIMUS_API_KEY, }, body: JSON.stringify({ "name": "Acme Logistics Private Limited", "entityType": "BUSINESS", "registrationNumber": "U63090MH2012PTC123456", "partyType": "BOTH", "filters": { "caseStatus": "ALL" }, "clientReference": "vendor-onboarding-4821" }), }); const data = await res.json();
import os import requests BASE = "https://api.caseprimus.ai/api/caseprimus/v1" res = requests.request( "POST", BASE + "/historical-search", headers={"X-CasePrimus-Api-Key": os.environ["CASEPRIMUS_API_KEY"]}, json={ "name": "Acme Logistics Private Limited", "entityType": "BUSINESS", "registrationNumber": "U63090MH2012PTC123456", "partyType": "BOTH", "filters": { "caseStatus": "ALL", }, "clientReference": "vendor-onboarding-4821", }, ) data = res.json()
Responses
| Field | Description |
|---|---|
searchIdstring | |
modeenum | ASYNC: collected in the background (see POST /historical-search). SYNCASYNC |
statusenum | SYNC searches are ACTIVE, COMPLETE or EXPIRED. ASYNC searches are RUNNING, COMPLETE, FAILED or EXPIRED. ACTIVECOMPLETEEXPIREDRUNNINGFAILED |
namestring | |
partyTypeenum | PETITIONERRESPONDENTBOTH |
filtersobject | |
clientReferencestring or null | |
deliveredinteger | Results delivered so far. For a COMPLETE asynchronous search: all of them (reading its pages is free and repeatable). |
collectedinteger | ASYNC only. Results stored so far; final once COMPLETE. |
completedAtinteger or null | ASYNC only. Epoch ms the search finished (COMPLETE or FAILED); null while RUNNING. |
failureReasonstring | ASYNC only, present when FAILED: why, in words for a person. Nothing was charged. |
warningsarray of object | |
codeenum | RESULT_CAP_REACHEDSOURCE_UNAVAILABLE |
messagestring | |
createdAtinteger | Epoch ms. |
expiresAtinteger | Epoch ms. Results are deleted at this time. |
pageSizeinteger | |
resultsarray of object | |
caseRefstring | Stable id of the case: the same case has the same caseRef in every search. |
caseIdentifierobject or null | What identifies the case for a live lookup. Null when it cannot be established without a live check. |
identifierStatusenum | CONFIRMEDNEEDS_CONFIRMATION |
courtTypestring | DC, HC, SC, CC, NCLT, NCLAT, CESTAT, DRT, DRAT, GSTAT, ITAT, APTEL, NGT, SAT or OTHER. |
courtstring or null | |
statestring or null | |
districtstring or null | |
benchstring or null | |
caseTypestring or null | |
caseTypeNamestring or null | |
caseNaturestring or null | |
caseNumberstring or null | |
cnrNumberstring or null | Null when the case has no customer-visible CNR. |
filingNumberstring or null | |
registrationNumberstring or null | |
filingDatestring or null | YYYY-MM-DD. |
filingYearinteger or null | |
registrationDatestring or null | |
caseStatusstring or null | |
nextHearingDatestring or null | |
decisionDatestring or null | |
natureOfDisposalstring or null | |
petitionerstring or null | |
respondentstring or null | |
partyRoleenum or null | The side the searched company is on. PETITIONERRESPONDENTBOTH |
matchedPartystring or null | The party that made this case match: the first party, on the side(s) searched, that carries the company's name or one of its variations, as the court wrote it (for example 'Acme Logistics Pvt. Ltd' when it is respondent 6 of 8). `petitioner` and `respondent` above are only the parties on the case's title line, so they may not include it. |
petitionersarray of string | Every petitioner, each once, in the court's order (placeholder entries such as 'Respondent' are left out). At most 25 - see `partyCountTruncated`. |
respondentsarray of string | Every respondent, each once, in the court's order. At most 25 - see `partyCountTruncated`. |
partyCountTruncatedboolean | True when either list was cut at 25. `matchedParty` is still named. |
nextPageTokenstring or null | Pass it to get the next page. Null when there is nothing more. |
{
"searchId": "CPHS0exampledemo0001",
"mode": "SYNC",
"status": "ACTIVE",
"name": "Acme Logistics Private Limited",
"partyType": "BOTH",
"filters": {
"caseStatus": "ALL"
},
"clientReference": "vendor-onboarding-4821",
"delivered": 100,
"warnings": [],
"createdAt": 1791600000000,
"expiresAt": 1792204800000,
"pageSize": 100,
"results": [
{
"caseRef": "CR0hc7f3a91e",
"caseIdentifier": {
"courtType": "HC",
"cnr": "KAHC010123452024"
},
"identifierStatus": "CONFIRMED",
"courtType": "HC",
"court": "High Court of Karnataka",
"state": "Karnataka",
"district": null,
"bench": "Bengaluru",
"caseType": "WP",
"caseTypeName": "Writ Petition",
"caseNature": "Civil",
"caseNumber": "WP/12345/2024",
"cnrNumber": "KAHC010123452024",
"filingNumber": "WP/45120/2024",
"registrationNumber": "WP/12345/2024",
"filingDate": "2024-03-18",
"filingYear": 2024,
"registrationDate": "2024-03-21",
"caseStatus": "PENDING",
"nextHearingDate": "2026-11-04",
"decisionDate": null,
"natureOfDisposal": null,
"petitioner": "K. Ramesh Babu",
"respondent": "The State of Karnataka",
"partyRole": "RESPONDENT",
"matchedParty": "Acme Logistics Pvt. Ltd",
"petitioners": [
"K. Ramesh Babu"
],
"respondents": [
"The State of Karnataka",
"The Principal Secretary, Revenue Department",
"The Deputy Commissioner",
"Acme Logistics Pvt. Ltd",
"Indian Oil Corporation Ltd"
],
"partyCountTruncated": false
},
{
"caseRef": "CR0dc21b5c07",
"caseIdentifier": {
"courtType": "DC",
"cnr": "DLST010012342023"
},
"identifierStatus": "CONFIRMED",
"courtType": "DC",
"court": "Saket District Court, Delhi",
"state": "Delhi",
"district": "South Delhi",
"bench": null,
"caseType": "CS",
"caseTypeName": "Civil Suit (Commercial)",
"caseNature": "Civil",
"caseNumber": "CS/1234/2023",
"cnrNumber": "DLST010012342023",
"filingNumber": "1234/2023",
"registrationNumber": "CS/1234/2023",
"filingDate": "2023-06-02",
"filingYear": 2023,
"registrationDate": "2023-06-05",
"caseStatus": "DISPOSED",
"nextHearingDate": null,
"decisionDate": "2025-01-29",
"natureOfDisposal": "Decreed",
"petitioner": "BLUELINE FREIGHT SERVICES",
"respondent": "ACME LOGISTICS PRIVATE LIMITED",
"partyRole": "RESPONDENT",
"matchedParty": "ACME LOGISTICS PRIVATE LIMITED",
"petitioners": [
"BLUELINE FREIGHT SERVICES"
],
"respondents": [
"ACME LOGISTICS PRIVATE LIMITED"
],
"partyCountTruncated": false
},
{
"caseRef": "CR0it88e0d412",
"caseIdentifier": null,
"identifierStatus": "NEEDS_CONFIRMATION",
"courtType": "ITAT",
"court": "Income Tax Appellate Tribunal, Mumbai",
"state": "Maharashtra",
"district": null,
"bench": "Mumbai",
"caseType": "ITA",
"caseTypeName": "Income Tax Appeal",
"caseNature": "Tax",
"caseNumber": "ITA/2210/MUM/2022",
"cnrNumber": null,
"filingNumber": null,
"registrationNumber": null,
"filingDate": "2022-09-14",
"filingYear": 2022,
"registrationDate": null,
"caseStatus": "PENDING",
"nextHearingDate": null,
"decisionDate": null,
"natureOfDisposal": null,
"petitioner": "ACME LOGISTICS PRIVATE LIMITED",
"respondent": "DCIT CIRCLE 4(1)",
"partyRole": "PETITIONER",
"matchedParty": "ACME LOGISTICS PRIVATE LIMITED",
"petitioners": [
"ACME LOGISTICS PRIVATE LIMITED"
],
"respondents": [
"DCIT CIRCLE 4(1)"
],
"partyCountTruncated": false
}
],
"nextPageToken": "eyJzIjoiQ1BIUzBzYW5kYm94ZGVtbzAwMDEiLCJwIjoxMDB9.Qk3x9Wf2mT8aYb1c"
}{
"searchId": "CPHS0exampledemo0001",
"mode": "SYNC",
"status": "COMPLETE",
"name": "Acme Logistics Private Limited",
"partyType": "RESPONDENT",
"filters": {
"fromYear": 2020,
"caseStatus": "PENDING"
},
"clientReference": null,
"delivered": 2,
"warnings": [],
"createdAt": 1791600000000,
"expiresAt": 1792204800000,
"pageSize": 100,
"results": [
{
"caseRef": "CR0dc21b5c07",
"caseIdentifier": {
"courtType": "DC",
"cnr": "DLST010012342023"
},
"identifierStatus": "CONFIRMED",
"courtType": "DC",
"court": "Saket District Court, Delhi",
"state": "Delhi",
"district": "South Delhi",
"bench": null,
"caseType": "CS",
"caseTypeName": "Civil Suit (Commercial)",
"caseNature": "Civil",
"caseNumber": "CS/1234/2023",
"cnrNumber": "DLST010012342023",
"filingNumber": "1234/2023",
"registrationNumber": "CS/1234/2023",
"filingDate": "2023-06-02",
"filingYear": 2023,
"registrationDate": "2023-06-05",
"caseStatus": "PENDING",
"nextHearingDate": null,
"decisionDate": null,
"natureOfDisposal": null,
"petitioner": "BLUELINE FREIGHT SERVICES",
"respondent": "ACME LOGISTICS PRIVATE LIMITED",
"partyRole": "RESPONDENT",
"matchedParty": "ACME LOGISTICS PRIVATE LIMITED",
"petitioners": [
"BLUELINE FREIGHT SERVICES"
],
"respondents": [
"ACME LOGISTICS PRIVATE LIMITED"
],
"partyCountTruncated": false
},
{
"caseRef": "CR0hc7f3a91e",
"caseIdentifier": {
"courtType": "HC",
"cnr": "KAHC010123452024"
},
"identifierStatus": "CONFIRMED",
"courtType": "HC",
"court": "High Court of Karnataka",
"state": "Karnataka",
"district": null,
"bench": "Bengaluru",
"caseType": "WP",
"caseTypeName": "Writ Petition",
"caseNature": "Civil",
"caseNumber": "WP/12345/2024",
"cnrNumber": "KAHC010123452024",
"filingNumber": "WP/45120/2024",
"registrationNumber": "WP/12345/2024",
"filingDate": "2024-03-18",
"filingYear": 2024,
"registrationDate": "2024-03-21",
"caseStatus": "PENDING",
"nextHearingDate": "2026-11-04",
"decisionDate": null,
"natureOfDisposal": null,
"petitioner": "K. Ramesh Babu",
"respondent": "The State of Karnataka",
"partyRole": "RESPONDENT",
"matchedParty": "Acme Logistics Pvt. Ltd",
"petitioners": [
"K. Ramesh Babu"
],
"respondents": [
"The State of Karnataka",
"The Principal Secretary, Revenue Department",
"The Deputy Commissioner",
"Acme Logistics Pvt. Ltd",
"Indian Oil Corporation Ltd"
],
"partyCountTruncated": false
}
],
"nextPageToken": null
}| Field | Description |
|---|---|
searchIdstring | |
modeenum | ASYNC: collected in the background (see POST /historical-search). SYNCASYNC |
statusenum | SYNC searches are ACTIVE, COMPLETE or EXPIRED. ASYNC searches are RUNNING, COMPLETE, FAILED or EXPIRED. ACTIVECOMPLETEEXPIREDRUNNINGFAILED |
namestring | |
partyTypeenum | PETITIONERRESPONDENTBOTH |
filtersobject | |
clientReferencestring or null | |
deliveredinteger | Results delivered so far. For a COMPLETE asynchronous search: all of them (reading its pages is free and repeatable). |
collectedinteger | ASYNC only. Results stored so far; final once COMPLETE. |
completedAtinteger or null | ASYNC only. Epoch ms the search finished (COMPLETE or FAILED); null while RUNNING. |
failureReasonstring | ASYNC only, present when FAILED: why, in words for a person. Nothing was charged. |
warningsarray of object | |
codeenum | RESULT_CAP_REACHEDSOURCE_UNAVAILABLE |
messagestring | |
createdAtinteger | Epoch ms. |
expiresAtinteger | Epoch ms. Results are deleted at this time. |
{
"searchId": "CPHS0exampleasync01",
"mode": "ASYNC",
"status": "RUNNING",
"name": "Acme Logistics Private Limited",
"partyType": "BOTH",
"filters": {
"caseStatus": "ALL"
},
"clientReference": "vendor-onboarding-4821",
"delivered": 0,
"warnings": [],
"createdAt": 1791936000000,
"expiresAt": 1792566000000,
"collected": 0,
"completedAt": null
}{
"httpStatusCode": 400,
"code": 60405,
"message": "Real-time court search is only available for company entities - add cases for a person entity manually",
"appError": true
}{
"httpStatusCode": 400,
"code": 61454,
"message": "The search filters are not valid",
"appError": true
}{
"httpStatusCode": 402,
"code": 61455,
"message": "Your plan's search allowance has been used up",
"appError": true
}{
"httpStatusCode": 403,
"code": 61465,
"message": "Asynchronous collection is not available on your plan. Page through the results with a normal search instead",
"appError": true
}{
"httpStatusCode": 403,
"code": 61456,
"message": "No data source is enabled for this account",
"appError": true
}{
"httpStatusCode": 429,
"code": 61466,
"message": "Too many of your searches are still being collected. Wait for one to finish, then start another",
"appError": true,
"details": {
"retryAfterSeconds": 60
}
}{
"httpStatusCode": 429,
"code": 61457,
"message": "Too many requests - slow down and retry after the indicated time",
"appError": true
}{
"httpStatusCode": 503,
"code": 61452,
"message": "This page could not be assembled in time. Nothing was delivered or charged - retry with the same page token",
"appError": true,
"details": {
"retryAfterSeconds": 3,
"searchId": "CPHS0exampledemo0001",
"nextPageToken": "eyJzIjoiQ1BIUzBzYW5kYm94ZGVtbzAwMDEiLCJwIjowfQ.Zm2p0Lr7Vx5nEa9d"
}
}Error responses share one shape, listed on Rate limits & errors.