Technical

Comparing the Query Endpoints

The Lex Machina API has three query endpoints. Here is a comparision of them.

Now that there are three different ways to query the Lex Machina API, knowing what aspects can be queried in each of the three is becoming a more complex task. This post is an attempt to put a lot of data on screen quickly with no real discussion. To see in depth discussions of each, look at the documentation in the developer portal for querying district cases, state and appeals.

Using the Sandbox API with Client Libraries

Use Lex Machina client libraries with our Sandbox API

Lex Machina now not only has an API to allow automated access to our data but we also have a Sandbox API that allows prospective customers to test out the system with a subset of real data. For those potential users who are testing out the system to see if it meets needs, you can absolutely use the client libraries we have - python and node/JavaScript - to access the Sandbox.

The Strategy of Scripting with the Lex Machina API

Writing scripts with the Lex Machina API have a recognizable design pattern

I have written a number of scripts that access the Lex Machina API. Some of these were for testing, some for demo and some for proof of concepts for current and potential customers. As I look at the structure of them, almost of all of them fit into a distinct pattern. The logic I have authored has these phases: Optional search (input text, search for judge, party, etc) or possibly looping over a list (all state or federal district courts) Using either that input and/or hardcoded values, do a query for cases Take the resulting list of cases and look them up one by one Extract values from individual cases for use.

Lex Machina Client Libraries

You can install client libraries for Python and JavaScript to simplify accessing the Lex Machina API

As of now, the Lex Machina API has client libraries published for both Node and Python. In this article, I will walk through the installation, configuration and use of both. Installation Both libraries are published to their respective package directories. Node The Node package is published to npm. To install it in your project directory use this command: npm install @lexmachina/lexmachina-client Python The Python package is published to PyPi. To install it in your Python environment use this command:

How Queries Differ between State and Federal

Federal district and state queries are similar in structure but not identical. Here is a discussion of the differences.

As of general availability, data from both federal district and state cases can be queried via the Lex Machina API. There are full articles on the developer portal about each type of query. Here is the one for federal district queries and one for state queries. For this blog post, I will provide a very quick high level summary of the differences. For details in using either query, see the above articles.