Search API

$ Billable

The RESTful Search API, returns results in JSON for matching query and filters. These results are paginated and each page returns upto 10 results and maximum of 100 pages.

API URL:

https://api.unicourt.com/rest/v1/search/?token=YOUR-API-TOKEN

Request:

Method CURL Command
POST curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '{"query":[{"search_terms":["Motion to Dismiss"]}]}'

Request Parameters:

Parameter Parameter Type Required Description
token String Yes Token which is generated in UniCourt Account, for authorizing the request

Search Query Options:

Field Name Data Type Description Available value(s)
page integer The page number of the search result. Default is 1 1 - to - 100
sort_by string Specifies the sort order of result set to be returned. Default is Filing Date which means that the latest filed case will be returned first Filing Date, Relevancy
scope string Scoped search allows you to limit the search to a section. Default is Contains Any Contains Any, Does Not Contain Any, Contains All, Does Not Contain All
attribute string Attribute to search for specific keyword. Default is Everything Everything, Party, Case Number, Case Name, Docket, Attorney, Judge
proximity string Proximity search looks for documents where two or more separately matching term occurrences are within a specified distance, Default is Anywhere Next To Each Other, Anywhere
condition string Use condition on usage for complex OR & AND

How to construct query?

Syntax:

{
   "type":"object",
   "properties":{
      "query":{
         "type":"array",
         "items":[
            {
               "type":"object",
               "properties":{
                  "search_terms":{
                     "type":"array",
                     "items":[
                        {
                           "type":"string"
                        }
                     ]
                  },
                  "scope":{
                     "type":"string"
                  },
                  "attribute":{
                     "type":"string"
                  },
                  "proximity":{
                     "type":"string"
                  }
               },
               "required":[
                  "search_terms"
               ]
            }
         ]
      },
      "page":{
         "type":"integer"
      },
      "sort_by":{
         "type":"string"
      },
      "filters":{
         "type":"array",
         "items":[
            {
               "type":"object",
               "properties":{
                  "filter_type":{
                     "type":"string"
                  },
                  "field":{
                     "type":"string"
                  },
                  "keys":{
                     "type":"array",
                     "items":[
                        {
                           "type":"integer"
                        }
                     ]
                  },
                  "date":{
                     "type":"string"
                  },
                  "days":{
                     "type":"integer"
                  }
               },
               "required":[
                  "filter_type",
                  "field"
               ]
            }
         ]
      }
   },
   "required":[
      "query"
   ]
}

Examples:

1) Search for cases with keyword "Motion to Dismiss" anywhere in the case

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ]
      }
   ]
}'

2) Search for cases with keywords "Motion to Dismiss" or "Class Action" anywhere in the case

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss", "Class Action"
         ]
      }
   ]
}'

3) Search for next set of results with keywords "Motion to Dismiss" or "Class Action"

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss", "Class Action"
         ]
      }
   ],
   "page": 1
}'

4) Search for cases with keywords "Motion to Dismiss" or "Class Action" with sort_by field

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss", "Class Action"
         ]
      }
   ],
   "page": 1,
   "sort_by": "Filing Date"
}'

5) Search for cases with keywords "Motion to Dismiss" and "Class Action" with proximity, attribute & scope

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss", "Class Action"
         ],
         "scope":"Contains All",
         "attribute":"Docket",
         "proximity":"Anywhere"
      }
   ],
   "page": 1,
   "sort_by": "Filing Date"
}'

6) Search for cases with keywords "Motion to Dismiss" with a case type filter

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ]
      }
   ],
   "filters":[
      {
         "filter_type":"case_type",
         "field":"group",
         "keys":[
            6
         ]
      }
   ]
}'

7) Search for cases with keywords "Motion to Dismiss" with a case type and jurisdiction filter

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ]
      }
   ],
   "filters":[
      {
         "filter_type":"case_type",
         "field":"group",
         "keys":[
            11
         ]
      },
      {
         "filter_type":"jurisdiction",
         "field":"court_system",
         "keys":[
            72
         ]
      }
   ]
}'

8) Search for cases with keywords "Motion to Dismiss" with filing date filter

  • Note: "to_date" should always be greater than "from_date".
curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ]
      }
   ],
   "filters":[
      {
         "filter_type":"filing_date",
         "field":"from_date",
         "date":"2018-01-01"
      },
      {
         "filter_type":"filing_date",
         "field":"to_date",
         "date":"2018-12-31"
      }
   ]
}'

9) Search for cases with keywords "Motion to Dismiss" with created date filter

  • Use the "created_date" filter to get the recent cases that were added to UniCourt's Archive. This filter is especially useful when trying to fetch new cases every day that fit the same search criteria by setting the last_n_days field and days to 1.
  • "created_date" is the date in UTC when the case was added to UniCourt Archive. This date always remains the same for a case.
curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ]
      }
   ],
   "filters":[
      {
         "filter_type":"created_date",
         "field":"last_n_days",
         "days":50
      }
   ]
}'

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ],
         "scope":"Contains Any",
         "attribute":"Docket"
      },
      {
         "search_terms":[
            "Class Action"
         ],
         "condition":"AND",
         "scope":"Contains Any",
         "attribute":"Docket",
         "proximity":"Anywhere"
      }
   ]
}'

11) Advanced search with filters

curl -X POST "https://api.unicourt.com/rest/v1/search/?token=a0f9770a842da247694673196ae2c9549f172526" -H "Content-Type: application/json" -d '
{
   "query":[
      {
         "search_terms":[
            "Motion to Dismiss"
         ],
         "scope":"Contains Any",
         "attribute":"Docket"
      },
      {
         "search_terms":[
            "Class Action"
         ],
         "condition":"AND",
         "scope":"Contains Any",
         "attribute":"Docket",
         "proximity":"Anywhere"
      }
   ],
   "page":1,
   "sort_by":"Filing Date",
   "filters":[
      {
         "filter_type":"case_type",
         "field":"group",
         "keys":[
            1
         ]
      },
      {
         "filter_type":"jurisdiction",
         "field":"court_system",
         "keys":[
            1
         ]
      },
      {
         "filter_type":"filing_date",
         "field":"from_date",
         "date":"2010-01-01"
      },
      {
         "filter_type":"filing_date",
         "field":"to_date",
         "date":"2018-12-31"
      }
   ]
}'

Sample Response

{
   "error":false,
   "message":"OK",
   "data":{
      "result":[
         {
            "case":{
               "case_type":"Other Personal Injury",
               "case_type_category":"Civil",
               "case_type_group":"Family",
               "case_status_category":"Pending",
               "case_status_name":"Other Pending",
               "courthouse":"Stanley Mosk Courthouse",
               "state":"CA",
               "jurisdiction":"Los Angeles County Superior Courts",
               "last_updated_date":"2018-05-25",
               "case_name":"PATTON, TARYN VS PATTON, JONATHAN",
               "filing_date":"2018-05-25",
               "case_id":"FNDBUHRQIEZEWFYXNEZWXBTJLZJQ40930",
               "case_number":"17STLC04485",
               "docket":" ... ; Filed by: Wal-Mart Stores, Inc (Defendant)! 2017-11-15 Complaint; Filed by: Henry Bray (Plaintiff); As to: Wal-Mart Stores, Inc (Defendant)! 2017 ... -11-15 Civil Case Cover Sheet; Filed by: Henry Bray (Plaintiff ... -15 Case assigned to Hon. Georgina T. Rizk in Department 77 Stanley Mosk  ... "
            },
            "attorneys":[
               {
                  "firm":" ",
                  "fullname":"Yeager Kenneth Charles"
               }
            ],
            "parties":[
               {
                  "representation_type":"Attorney Represented",
                  "party_type":"Defendant",
                  "fullname":"Wal-Mart Stores Inc",
                  "entity_type":"Company"
               },
               {
                  "representation_type":"Attorney Represented",
                  "party_type":"Plaintiff",
                  "fullname":"Bray Henry",
                  "entity_type":"Individual"
               }
            ],
            "judges":[
               {
                  "fullname":"Georgina T. Rizk"
               }
            ]
         }
      ],
      "total_matches":"104597",
      "post_data":{
         "query":[
            {
               "search_terms":[
                  "Motion to Dismiss"
               ],
               "scope":"Contains Any",
               "attribute":"Docket"
            },
            {
               "search_terms":[
                  "Class Action"
               ],
               "condition":"AND",
               "scope":"Contains Any",
               "attribute":"Docket",
               "proximity":"Anywhere"
            }
         ]
      },
      "criteria":"(0 AND 1)"
   }
}

Description:

Property name Value Description
error boolean -
message string Describes the response
data nested object Contains Search results information
result list Contains one or more sets of case metadata
total_matches string The total number of search results returned by the query
post_data object Requested POST data about the search performed
criteria string Formula generated on using advanced search

Get Started Today

Sign Up Now