Citation Generator API
Format a reference for a book, journal article, website, newspaper article or report in APA 7, MLA 9, Chicago (notes-bibliography) or Harvard style.
POST /api/v1/tools/citation-generatorMCP citation_generatorText & WritingCreate reference list entries for books, journal articles, web pages, news articles and reports in APA 7, MLA 9, Chicago 17 and Harvard, with italics ready to paste.
Input
Send these as a JSON object. Unknown fields are rejected.
- style
- Citation style. (string, one of apa, mla, chicago, harvard, required)
- type
- Kind of source. (string, one of book, journal, website, newspaper, report, required)
- title
- Title of the book, article, page or report. (string, up to 1000 characters, required)
- authors
- Authors separated by semicolons, each as "Family, Given" (e.g. "Smith, Mary Jane; Lee, Ken"). An organisation is just its name with no comma. (string, up to 5000 characters)
- container
- Journal, website, newspaper or magazine name. (string, up to 500 characters)
- publisher
- Publisher. (string, up to 500 characters)
- place
- Place of publication (used by Chicago and Harvard for books and reports). (string, up to 500 characters)
- edition
- Edition, e.g. 2 or 2nd. (string, up to 50 characters)
- volume
- Volume number. (string, up to 50 characters)
- issue
- Issue number. (string, up to 50 characters)
- pages
- Page or page range, e.g. 45-67. (string, up to 50 characters)
- reportNumber
- Report number. (string, up to 100 characters)
- year
- Publication year, e.g. 2024 (a letter suffix such as 2024a is allowed). (string, up to 10 characters)
- month
- Publication month as 1 to 12, or a season such as Spring. (string, up to 20 characters)
- day
- Day of the month (needs a numeric month). (string, up to 2 characters)
- doi
- DOI, with or without https://doi.org/. (string, up to 500 characters)
- url
- URL of an online source. (string, up to 2000 characters)
- accessed
- Date you accessed an online source, as YYYY-MM-DD. (string, up to 10 characters)
curl https://pithlab.com/api/v1/tools/citation-generator \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"style":"apa","type":"journal","title":"Attention is all you need","authors":"Vaswani, Ashish; Shazeer, Noam","container":"Advances in Neural Information Processing Systems","volume":"30","pages":"5998-6008","year":"2017"}'Example response
{
"ok": true,
"result": {
"text": "Vaswani, A., & Shazeer, N. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30, 5998–6008.",
"html": "Vaswani, A., & Shazeer, N. (2017). Attention is all you need. <i>Advances in Neural Information Processing Systems</i>, <i>30</i>, 5998–6008.",
"markdown": "Vaswani, A., & Shazeer, N. (2017). Attention is all you need. *Advances in Neural Information Processing Systems*, *30*, 5998–6008."
}
}