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.