{"openapi":"3.1.0","info":{"title":"PHI Latin Texts API","description":"Classical Latin texts of The Packard Humanities Institute as JSON: the authors and works of the PHI Latin corpus, as the printed editions give them. The same data is served to AI assistants at `/mcp`.\n\n## References\n\nA reference is an author, a work and a citation: `Verg. Aen. 1.1-7`, `Cic. Att. 1.1.1`, `Hor. Carm. 1.1`, `Virgil Aeneid 1`. PHI numbers also work: `0690 003 1.1`. A reference that does not resolve gets an error that lists what to try. Each passage names the edition it follows; the spelling is that edition's (often `u` where a school text prints `v`).\n\n## Search\n\n`q` finds letters: a word, a stem (`#lug` for words that start with lug) or a phrase. `lemma` finds every form of a dictionary word (`lugeo`). `near` or `near_lemma` asks for a second word within `within` lines.\n\n## Word use and style\n\n`/api/v1/style/distinctive` gives the words of an author or a work that other texts seldom use (`sort=rare` or `keyness`; `compare_to=all`, `earlier` or `same_genre`). `/api/v1/style/word` gives one word by era, genre and author; `/profile` the rates of function words, word and sentence length; `/compare` Burrows' Delta to other authors; `/phrases` the phrases two texts share, the rarest first. Counts and references only, no text: not metered. How each tool counts: [/methods](/methods).\n\n## Citing\n\nGive the author, work and citation of each passage you use, and the edition the answer names.\n\n## Use and limits\n\nNo key is needed. One address (an IPv6 address by its /48) can take 500 lines of text a day: the lines of a passage, and the lines of each search hit with its context. Counts (`limit=0`), the word tools and the lists of authors and works do not count. The count starts again at 00:00 UTC. When it is used, the server answers 429 with a `Retry-After` header: the seconds to 00:00 UTC. Each answer with text has the headers `x-reading-limit` and `x-reading-remaining`. More than 10 requests a second from one address also get 429, with `Retry-After: 1`. Wait for that time before you send again.\n\n## Keys\n\nKeys are free; a free key has a daily limit of 100,000 lines of text (20,000 for its first 30 days). The limit of 10 requests a second applies to every key. To get one, sign up at https://latin-mcp.packhum.org/keys with your name, your academic or institutional email address, and what you will use it for. Send it as `Authorization: Bearer <key>` or `X-Api-Key: <key>`. The same key works on the PHI Greek Inscriptions server.\n\n## More\n\nDo you need many texts, or a whole author, for a project? Write to latin@packhum.org and tell us about your work. We usually say yes. We want to know how scholars use these texts, and we like to work with them.","contact":{"name":"The Packard Humanities Institute","url":"https://packhum.org"},"license":{"name":""},"version":"2.0.0"},"paths":{"/api/v1/authors":{"get":{"tags":[],"description":"The authors of the corpus, with their PHI numbers.","operationId":"get_authors","parameters":[{"name":"q","in":"query","description":"Part of a name or abbreviation.","required":false,"schema":{"type":"string"}},{"name":"major","in":"query","description":"Major authors only.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"The most authors to return.","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The authors"}}}},"/api/v1/authors/{id}":{"get":{"tags":[],"description":"One author and the works of the author.","operationId":"get_author","parameters":[{"name":"id","in":"path","description":"PHI number or name of the author","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The author"},"404":{"description":"No such author"}}}},"/api/v1/dictionary":{"get":{"tags":[],"summary":"Not metered: dictionary text, not the corpus.","description":"The Lewis & Short entry for a Latin word. Not metered.","operationId":"get_dictionary","parameters":[{"name":"w","in":"query","description":"A Latin word: a headword, a form, or a homograph by its digit (do1).","required":true,"schema":{"type":"string"}},{"name":"sense","in":"query","description":"Only this sense of the entry (e.g. `II.B`).","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","description":"Characters of the entry to skip, for the next part of a long entry.","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The entry"},"404":{"description":"No entry"}}}},"/api/v1/passage":{"get":{"tags":[],"description":"A passage of Latin text, by reference (`Verg. Aen. 1.1-7`) or by author, work and citation. Metered: each line counts against the daily allowance.","operationId":"get_passage","parameters":[{"name":"ref","in":"query","description":"Free-text reference, e.g. `Verg. Aen. 1.1-7`.","required":false,"schema":{"type":"string"}},{"name":"author","in":"query","description":"Or the author by PHI number or name, with `work` and `cit`.","required":false,"schema":{"type":"string"}},{"name":"work","in":"query","description":"The work, by PHI number or title.","required":false,"schema":{"type":"string"}},{"name":"cit","in":"query","description":"The citation in the work, e.g. `1.1-7`.","required":false,"schema":{"type":"string"}},{"name":"max_lines","in":"query","description":"The most lines to return.","required":false,"schema":{"type":"integer","minimum":0}},{"name":"from","in":"query","description":"Go on from this citation (from `next` in the answer before).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The passage, with the edition it follows"},"404":{"description":"The reference does not resolve; the error lists what to try"},"429":{"description":"The daily allowance is used"}}}},"/api/v1/search":{"get":{"tags":[],"description":"Where letters or the forms of a dictionary word occur. Metered: each line of a hit and its context counts; limit=0 (counts only) does not.","operationId":"get_search","parameters":[{"name":"q","in":"query","description":"Letters: a word, a stem or a phrase.","required":false,"schema":{"type":"string"}},{"name":"lemma","in":"query","description":"Or a dictionary form, for all its forms.","required":false,"schema":{"type":"string"}},{"name":"author","in":"query","description":"Only this author (PHI number or name).","required":false,"schema":{"type":"string"}},{"name":"work","in":"query","description":"Only this work of the author.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The most hits to return; 0 gives counts only, which are not metered.","required":false,"schema":{"type":"integer","minimum":0}},{"name":"offset","in":"query","description":"Hits to skip, for the next page.","required":false,"schema":{"type":"integer","minimum":0}},{"name":"context","in":"query","description":"Lines before and after each hit (0 to 3).","required":false,"schema":{"type":"integer","minimum":0}},{"name":"near","in":"query","description":"A second word that must stand near the first: letters, or a lemma.","required":false,"schema":{"type":"string"}},{"name":"near_lemma","in":"query","required":false,"schema":{"type":"string"}},{"name":"within","in":"query","description":"The most lines apart the two may be (0 = same line; default 1).","required":false,"schema":{"type":"integer","minimum":0}},{"name":"spread","in":"query","description":"Sample the hits across authors.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"The hits and the counts by author"},"400":{"description":"A query that cannot be read"},"429":{"description":"The daily allowance is used"}}}},"/api/v1/style/compare":{"get":{"tags":["style"],"description":"Burrows' Delta from an author or a work to other authors. Not metered.","operationId":"get_compare_style","parameters":[{"name":"author","in":"query","description":"The author of the text in question.","required":true,"schema":{"type":"string"}},{"name":"work","in":"query","description":"One work of the author.","required":false,"schema":{"type":"string"}},{"name":"candidates","in":"query","description":"Authors to measure against, separated by commas.","required":false,"schema":{"type":"string"}},{"name":"words","in":"query","description":"How many of the most frequent forms to use (30 to 300).","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The authors, the nearest first"}}}},"/api/v1/style/distinctive":{"get":{"tags":["style"],"description":"The words of an author or a work that other texts seldom use. Not metered.","operationId":"get_distinctive","parameters":[{"name":"author","in":"query","description":"The author: a name (\"Maximianus\"), an abbreviation or a PHI number.","required":true,"schema":{"type":"string"}},{"name":"work","in":"query","description":"One work of the author, to look at it alone: a title, an abbreviation or a number.","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","description":"\"rare\" (default): the words fewest other authors use. \"keyness\": the\nwords it uses more often than the other texts.","required":false,"schema":{"type":"string"}},{"name":"compare_to","in":"query","description":"\"all\" (default), \"earlier\" (only authors dated before it: words new\nin it) or \"same_genre\" (only works of its genre).","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Most words to return (default 30, at most 100).","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The words, names and unknown forms, with references"}}}},"/api/v1/style/phrases":{"get":{"tags":["style"],"description":"The phrases two texts share, the rarest in the corpus first. Not metered.","operationId":"get_shared_phrases","parameters":[{"name":"author","in":"query","description":"The first text: an author.","required":true,"schema":{"type":"string"}},{"name":"work","in":"query","description":"One work of the first author.","required":false,"schema":{"type":"string"}},{"name":"other_author","in":"query","description":"The second text: an author.","required":true,"schema":{"type":"string"}},{"name":"other_work","in":"query","description":"One work of the second author.","required":false,"schema":{"type":"string"}},{"name":"length","in":"query","description":"Words in a phrase, 2 to 6 (default 3).","required":false,"schema":{"type":"integer","minimum":0}},{"name":"limit","in":"query","description":"Most phrases to return (default 30, at most 100).","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The phrases, with a reference in each text"}}}},"/api/v1/style/profile":{"get":{"tags":["style"],"description":"Function-word rates, word and sentence length and type-token ratio of an author or a work, with z-scores. Not metered.","operationId":"get_style_profile","parameters":[{"name":"author","in":"query","description":"The author: a name, an abbreviation or a PHI number.","required":true,"schema":{"type":"string"}},{"name":"work","in":"query","description":"One work of the author.","required":false,"schema":{"type":"string"}},{"name":"compare_to","in":"query","description":"\"all\" (default) or \"same_genre\": the works the rates are compared with.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The profile"}}}},"/api/v1/style/word":{"get":{"tags":["style"],"description":"The use of one dictionary word across authors, eras and genres. Not metered.","operationId":"get_word_profile","parameters":[{"name":"lemma","in":"query","description":"A Latin dictionary word (\"senectus\"). An inflected form gets a list\nof the words it can be.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The profile"},"404":{"description":"Not a dictionary word"}}}},"/api/v1/words":{"get":{"tags":[],"description":"Latin words for an English word.","operationId":"get_words","parameters":[{"name":"english","in":"query","description":"An English word.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The most Latin words to return.","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The Latin words"}}}},"/api/v1/words/check":{"get":{"tags":[],"description":"Whether Latin words occur in the corpus, and as forms of which dictionary words.","operationId":"get_words_check","parameters":[{"name":"w","in":"query","description":"Latin words, separated by commas or spaces.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The words checked"}}}},"/api/v1/works/{author}/{work}":{"get":{"tags":[],"description":"One work and how it is divided.","operationId":"get_work","parameters":[{"name":"author","in":"path","description":"PHI number or name of the author","required":true,"schema":{"type":"string"}},{"name":"work","in":"path","description":"PHI number or title of the work","required":true,"schema":{"type":"string"}},{"name":"division","in":"query","description":"List the parts of this division (`9` -> the letters of book 9).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The work"},"404":{"description":"No such work"}}}}},"components":{}}