API

Ravel's API provides comprehensive access to state and federal American caselaw. Containing 40 million pages of caselaw  -- from 11 million cases in 40 thousand volumes -- Ravel's database is the first publicly available, complete set of United States case law.

Some of the cases predate the Union; the first case was decided in October of 1671 in Suffolk County in the Province of New York, over a century before statehood and the American Revolution. The most recent cases currently in the API date from December 2016, and the database will be updated from time to time.

The API is available for noncommercial use by the general public worldwide. Users may access up to 500 cases per 24 hour period using the API.

To apply for an API Key, please email us at contact@ravellaw.com with your full name, location, and a description of your project. After you've agreed to Ravel's terms of use, you will receive access a user token.

Ravel Open API Documentation


All paths follow the endpoint at: https://api.ravellaw.com/api/open/

Login

	Puts account into a logged-in state, and returns the current API key for the account.
	
URL
	
	/login
	
Method

	`POST`
	
Data Params

"email":"<EMAIL>",
"password":"<PASSWORD>"

Success Response:

Code: 200 OK 
Content: "<UNIQUE RAVEL API KEY>"
	  
Error Response

 * Code: 401 UNAUTHORIZED 
 * Content: `{ error : "The supplied authentication is invalid" }`
 
Sample Call
 
 curl -i \
 -H 'content-type: application/json' \
 -XPOST 'https://api.ravellaw.com/login' \
 -d '{ "email":"username@domain.com", "password":"User's Ravel API password" }'
 
Notes:
 
 While username and passwords remain static, the API Key may rotate. Executing the `Login` path will return the current API Key for the account.
 
Logout
 ----
 Puts account into a logged-out state, preventing further use of the API key until logged back in.
 
URL
 
 	/logout
 	
Method
 
 	`GET`
 	
 Data Params
 

 
 Success Response:
 	
 	Code: 200 OK	
 	
 Error Responses:
 
 Sample Call:
 
 curl https://api.ravellaw.com/api/open/logout \ ravel_user_token="abcdef123456abcdef123456"
 
 Notes:
 Attempts to log out while already logged out will not return an error message.




Search
----
  Returns the title, case name, date and 32-character ID of an adjustable number of cases that match a search query and/or are contained within the selected reporter, volume and page combinations provided by user.
  
URL

  /search?

Method:

  `GET`
  
URL Params

   The following parameters are supported:
   `Query`:  /search?q=<QUERY>  Returns and restricts results to cases that match the search string chosen.
   `Reporter` /search?reporter=<REPORTER_ABBREVIATION>  Returns and restricts results to cases that are contained within the chosen reporter.
   `Volume` /search?volume=<#VOLUME> Restricts only cases that are contained within the chosen volume of the selected reporter.
   `Page` /search?page=<#PAGE> Returns only cases that are contained within the chosen page of the selected reporter and volume.
   `Year` /search?year=<#YEAR> Returns only cases that come from the year chosen.
   `Limit` /search?limit=50 Returns only the number of cases chosen (up to 500).
   `Start` /search?start=20 Offsets the search results by the number of cases chosen.
   
   Required:
 
   If `Volume` parameter is used, the `Reporter` parameter must also be specified.
   If `Page` parameter is used, the `Volume` parameter (and `Reporter`) must also both be specified.

   Optional:
 
   `Limit` Can be any number between 0 and 500. The default is 20.
   `Start` Can be any number.

Data Params

  The results of a search begin with the number of results `numFound` meeting the search requirements, followed by a list of results containing case IDs, names, dates, and courts.
  By default, the 20 cases are returned.

  Success Response:

  * **Code:** 200 <br />
    **Content:** `{ id : 12 }` 
 
   Error Response:

   Code: 401 UNAUTHORIZED
   Content: `{ error : "The supplied authentication is invalid" }`
    
    User is logged out or has not supplied the proper API key

  OR
  
   Code: 403 Forbidden  <br />
   Content:
    
  OR

   Code: 404 Not Found  <br />
   Content: `{ error : "" }`

  Sample Call:

  curl https://api.ravellaw.com/api/open/search?q="evidence"&reporter="Cal." / ravel_user_token="abcdef123456abcdef123456"

  Notes:

  Case
----

URL

	/case/

Method:

  `GET`
  
URL Params

	Required
	
	32-character ID for a case
	
Success Response:

Code: 200 OK <br />
Content:
	  
Error Response:

Code: 401 UNAUTHORIZED <br />
Content: `{ error : "The supplied authentication is invalid" }`

  OR
  
 Code: 403 Forbidden  <br />
 Content:
    
  OR

Code: 404 Not Found  <br />
Content: `{ error : "" }`


Sample Call:

  curl https://api.ravellaw.com/api/open/case/3ee32ba2f92b89eafa16e8b2f7327cb1 / ravel_user_token="abcdef123456abcdef123456"
  
Notes:
  
  Cases include extensive metadata
	



TOP