• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar

FromThePage Blog

about crowdsourcing, manuscript transcription, digital humanities and digital documentary editions

  • Home
  • Project Profiles
  • Interviews with Clients
  • Collections
  • Back to FromThePage

Key Based API Access for Private Collections & Bulk Exports

You can access the IIIF API of a private collection using our key based API. Querying public collections does not need an API key.

You can download bulk export zip files containing page and work level transcripts and translations via our key based API.  You'll need a key even if your collection is public.

To get a key:

  1. Log in to FromThePage and make sure your account has access to the private collections you'd like to export by clicking on the "Dashboard" link.
  2. Click on "Your Profile" under the "Signed In As..."
  3. Click "API Keys" button on the upper right.
  4. Click "Generate Key"
  5. Copy the key you just generated.  (You can always find it again under your profile.)

To query the IIIF API, use your key:

curl -H 'Authorization: Token token=KEY' 'COLLECTION_URL'

where KEY is your key and COLLECTION_URL is the IIIF collection URL found on the collection export tab in the user interface.
for example:

curl -H 'Authorization: Token token=AvTgcRvaU5lURgBt3Y9C1gtt' 'https://fromthepage.com/iiif/collection/4'

To initiate a bulk export API:

curl -H 'Authorization: Token token=KEY' -X POST "https://fromthepage.com/api/v1/bulk_export/collection-slug?option1=true&option2=true

Where the collection-slug is the part of the collection url (find it in the settings page for the collection, or just look at the URL for the collection).  Options are different types of files to be included in your export zip file.  You must have at least one.  You may have all options.  The following are valid options for the formats included in the export file:

plaintext_verbatim_page
plaintext_verbatim_work
plaintext_emended_page
plaintext_emended_work
plaintext_searchable_page
plaintext_searchable_work
tei_work
html_page
html_work
subject_csv_collection
table_csv_collection
table_csv_work

More about export formats

For example, the following API call will start an export a plaintext verbatim file for each work in the collection and one plaintext verbatim file for each page in the collection, organized into folders by work.

curl -H 'Authorization: Token token=4e258CaCK71WWrQS13PP4gtt' -X POST "http://localhost:3000/api/v1/bulk_export/east-civil-war-letters?plaintext_verbatim_page=true&plaintext_verbatim_work=true"

This will return:

{
   "id":26,
   "status":"queued",
   "status_uri":"https://fromthepage.com/api/v1/bulk_export/26/status",
   "download_uri":"https://fromthepage.com/api/v1/bulk_export/26/download"
}

To monitor the status of your export, take the ID that is returned from that request and use it in the status API call:

curl -H 'Authorization: Token token=4e258CaCK71WWrQS13PP4gtt' 'http://localhost:3000/api/v1/bulk_export/ID/status'

Once the status is complete, like so:

{
   "id":25,
   "status":"finished",
   "status_uri":"http://fromthepage.com/api/v1/bulk_export/25/status",
   "download_uri":"https://localhost:3000/api/v1/bulk_export/25/download"
}

You can download the export file using the URL in the response:

curl -H 'Authorization: Token token=4e258CaCK71WWrQS13PP4gtt' 'https://fromthepage.com/api/v1/bulk_export/14/download' --output out.zip

 

Primary Sidebar

What’s Trending on The FromThePage Blog

  • How to Learn to Read Shorthand
  • An Interview with Riley Bogran of the Sandy Spring Museum
  • 2018 Paleography Courses
  • Interview: Dr. Laura Morreale on Teaching and…
  • Rails: acts_as_list Incantations
  • Learn to Decipher Old Handwriting with Online and…

Recent Client Interviews

An Interview with Erin Wilson of Ohio University Libraries

An Interview with Susannah Ural of the Civil War & Reconstruction Governors of Mississippi Project

An Interview with Olivia Carlisle of the State Archives of North Carolina

An Interview with Paige Roberts of Phillips Academy Archives & Special Collections

An Interview with Riley Bogran of the Sandy Spring Museum

Privacy Policy | Terms & Conditions | About Us | Contact Us

Copyright © 2021 · FromThePage.com