A human-centric approach to the Fastcase Public API, originally built by @vdavez with substantial contributions of @TalkingQuickly and @adelevie.
Fastcase recently disclosed that it has a public API for any member of the public to see a reported judicial opinion without going behind the paywall. This is a breakthrough.
The API requires a user to set headers and pass a data object. This is good, but I'm lazy and just want to work from the browser's address bar. So, I built a human-centric wrapper around the API.
The permafrast API responds to both html and json requests. E.g:
/:volume/:reporter/:starting_page
for html/:volume/:reporter/:starting_page.json
for json/:volume/:reporter/:starting_page/redirect
will automatically redirect the user to the reported opinion url
The html
response gives a clickable link with the full citation for the opinion. The json
response gives a json object associated with the opinion.
For both endpoints, you must pass three parameters associated with a reported judicial opinion:
- The volume of the reporter (an integer)
- The reporter abbreviation (e.g.,
U.S.
) - The starting page of the opinion (an integer)
So, http://permafrast.herokuapp.com/:volume/:reporter/:starting_page
. For example, see https://permafrast.herokuapp.com/600/F.3d/642 or https://permafrast.herokuapp.com/600/F.3d/642.json.
By default, HTML routes will display the full text of the citation. For JSON routes, you can add ?fulltext=true
to the URL. Example https://permafrast.herokuapp.com/600/F.3d/642.json?fulltext=true.
The source code for permafrast is available at https://github.com/vzvenyach/permafrast. Please feel free to submit PRs or open issues.
In development SQLite is used, use bundle exec rake db:create && db:migrate
to create it.
You can easily run your own instance of Permafrast.
- Clone the repo.
cp .env.example .env
.- Add your Fastcase API key to
.env
. If you don't have one, tweet to Josh Auriemma. - Run
bundle
. - Run the server locally with
bundle exec rackup -p 4567
. - Run tests with
bundle exec rspec
MIT