Corpus DB REST API Documentation

Welcome to the Corpus-DB Project, a textual corpus database for the digital humanities.

GitHub

Get all the metadata for a certain book, by ID.

Handles Project Gutenberg IDs, for now. NB: Each id must be floating point, for the moment, so id 9 should be 9.0.

http://corpus-db.org/api/id/<pg-id>

Example: get metadata for book with ID 9

http://corpus-db.org/api/id/9.0

Get the full text for a certain book, by ID.

Handles Project Gutenberg IDs, for now. NB: Each id must be floating point, for the moment, so id 9 should be 9.0.

http://corpus-db.org/api/id/<pg-id>/fulltext

Example: get metadata for book with ID 9

http://corpus-db.org/api/id/9.0/fulltext

Get all the metadata for all books by a certain author.

Handles Project Gutenberg authors, for now. Write name in the form Last, First.

http://corpus-db.org/api/author/<Last, First>

Example: get metadata for all books by Jane Austen.

http://corpus-db.org/api/author/Austen, Jane

Get the full text for all books by a certain author.

Handles Project Gutenberg authors, for now. Write name in the form Last, First.

http://corpus-db.org/api/author/<Last, First>/fulltext

Example: get full text for all books by Jane Austen.

http://corpus-db.org/api/author/Austen, Jane/fulltext

Get all the metadata for all books with a certain Library of Congress subject heading (LCSH).

http://corpus-db.org/api/subject/<subject>

Example: get metadata for books with the LCSH "Detective and mystery stories".

http://corpus-db.org/api/subject/Detective and mystery stories

Get a list of all the Library of Congress subject headings in the corpus, with their associated text counts.

At the moment, this represents all the LCSHs for Project Gutenberg.

http://corpus-db.org/api/subjects