Folger Digital Texts API

The API is a work in progress. For now, here's what we have:

To help explore the API, we've created a simple form that will generate URLs to access objects in the API. It is not exhaustive, nor will it return valid results if the variables you select do not correlate to an existing object or function.

Play:
Function:

The URLs generated by the above form are based on the play code, function name, and additional parameters where appropriate. For example, the URL to see line 12 of Macbeth is http://www.folgerdigitaltexts.org/Mac/ftln/0012, where "Mac" is the play code, "ftln" is the function name to retrieve a single line of the play, and 0012 is the Folger Throughline Number. With the play codes and function names listed, you can write your own URLs by hand, as an alternative to using the form on this page.

Functions:
ftln (+ Folger through line number): returns the spoken text at that FTLN
word (+ word id) : returns information about that word
segment (+ object id) : returns the text of that xml:id
text: returns only the spoken text in that play
charText: returns a list of characters arranged according to amount of lines spoken, with a link to each character's entire spoken text
charTextMinus: returns a list of characters arranged according to amount of lines spoken, with a link to the play's spoken text, minus this character
concordance: lists the words used (in spoken text) and their frequency
monologue (+ optional line count): provides a list of speeches longer than the given line count (defaults to 30 lines)
onStage (+ ftln): returns a list of characters on stage at that line
charChart: provides a graphical representation of who is on stage across a timeline of the play
parts: provides parts or cue scripts for each character
witScript: provides "witScripts" for each character. "Witness" or "Witmore" scripts attempt to show what a character sees. They offer the play text only when that character is on stage.
sounds: returns a list of all stage directions that contain sounds (i.e., "music," "flourish," "thunder")

Examples:
http://www.folgerdigitaltexts.org/WT/ftln/1201
http://www.folgerdigitaltexts.org/WT/word/w0176040
http://www.folgerdigitaltexts.org/Ham/word/w0259380
http://www.folgerdigitaltexts.org/WT/text/
http://www.folgerdigitaltexts.org/WT/concordance/
http://www.folgerdigitaltexts.org/WT/onStage/1196
http://www.folgerdigitaltexts.org/WT/charChart/
http://www.folgerdigitaltexts.org/WT/parts/
http://www.folgerdigitaltexts.org/WT/parts/Dion.html
http://www.folgerdigitaltexts.org/WT/parts/Bear.html
http://www.folgerdigitaltexts.org/Mac/parts/Porter.html
http://www.folgerdigitaltexts.org/Ham/witScript/
http://www.folgerdigitaltexts.org/Ham/witScript/Polonius.html

Play Codes:
AWW: All's Well That Ends Well
Ant: Antony and Cleopatra
AYL: As You Like It
Err: The Comedy of Errors
Cor: Coriolanus
Cym: Cymbeline
Ham: Hamlet
1H4: Henry IV, Part 1
2H4: Henry IV, Part 2
H5: Henry V
1H6: Henry VI, Part 1
2H6: Henry VI, Part 2
3H6: Henry VI, Part 3
H8: Henry VIII
JC: Julius Caesar
Jn: King John
Lr: King Lear
LLL: Love's Labor's Lost
Mac: Macbeth
MM: Measure for Measure
MV: The Merchant of Venice
Wiv: The Merry Wives of Windsor
MND: A Midsummer Night's Dream
Ado: Much Ado About Nothing
Oth: Othello
Per: Pericles
R2: Richard II
R3: Richard III
Rom: Romeo and Juliet
Shr: The Taming of the Shrew
Tmp: The Tempest
Tim: Timon of Athens
Tit: Titus Andronicus
Tro: Troilus and Cressida
TN: Twelfth Night
TGV: Two Gentlemen of Verona
TNK: Two Noble Kinsmen
WT: The Winter's Tale