The MuckRock API, or application programming interface, provides a way to access MuckRock data programmatically. This guide will give you what you need to get up and running.

Rate Limiting

The API (and generally, the entire site) is rate limited to one request per second, however you can burst these requests up to 20 per second for as long as the average runs less than 1 per second over a 20 second period.

Examples

We provide a public GitHub repository of example code that uses the API. This is a collection of simple python scripts that should give an idea of what kind of things are possible. Since it’s public, feel free to fork the repository and make a pull request with your own examples!

For more examples, check out the projects that resulted from the BuzzFeed FOIA hackathon.

Endpoints

The current API endpoint is https://www.muckrock.com/api_v1/. It is accessible without any authentication. Making a query against this top-level address will provide a list of available objects and their endpoints. The current list of available objects includes:

Authentication

Most endpoints are accessible without providing any authentication. To access protected data, like your embargoed requests, you’ll need a request token. Your token can be obtained on the bottom left-hand side of your profile page.

When making a request, the token should be included as an authentication header.

headers = {'Authorization': 'Token %s' % token}