Working with citations.
Every research run produces formal, exportable citations in any of MLA, APA, Chicago, IEEE, Harvard, and BibTeX. This guide covers how to request them, how to embed them in your own documents, and what to do when source metadata is incomplete.
§ 01Where citations live
Citations are first-class objects on the platform. They are built once, during the research run that discovers a source, and then persisted on the source itself. Every later request — for the same source, in the same or different format — reads from that persisted record rather than regenerating.
That has three practical consequences:
- Citation generation is essentially free at fetch time. You can ask for any of the six formats on demand without re-running research.
- Citations are stable. If two reports cite the same source, they get byte-identical citation strings.
- Sources surfaced in different sessions share the same underlying citation record. Improving one improves them all.
Each source on a session carries a citations object with all six formats pre-rendered. You can either pull the full bundle in one call, or request a single format.
§ 02The six formats
One example of each, for the same hypothetical source: a December 2024 Treasury rule on hydrogen tax credits.
MLA
U.S. Department of the Treasury. "Final Rule: Section 45V Clean Hydrogen
Production Credit." Treasury.gov, 15 Dec. 2024,
home.treasury.gov/news/press-releases/jy2789. Accessed 1 May 2026.
APA
U.S. Department of the Treasury. (2024, December 15). Final rule: Section
45V clean hydrogen production credit. Treasury.gov.
https://home.treasury.gov/news/press-releases/jy2789
Chicago Author-Date
U.S. Department of the Treasury. 2024. "Final Rule: Section 45V Clean
Hydrogen Production Credit." December 15, 2024.
https://home.treasury.gov/news/press-releases/jy2789.
IEEE
[1] U.S. Department of the Treasury, "Final rule: Section 45V clean hydrogen
production credit," Treasury.gov, Dec. 15, 2024. [Online]. Available:
https://home.treasury.gov/news/press-releases/jy2789
Harvard
U.S. Department of the Treasury (2024) Final rule: Section 45V clean
hydrogen production credit. Available at:
https://home.treasury.gov/news/press-releases/jy2789
(Accessed: 1 May 2026).
BibTeX
@misc{treasury2024_45v,
author = {{U.S. Department of the Treasury}},
title = {Final Rule: Section 45V Clean Hydrogen Production Credit},
year = {2024},
month = {dec},
day = {15},
url = {https://home.treasury.gov/news/press-releases/jy2789},
note = {Accessed: 2026-05-01}
}
§ 03Fetching citations for a session
Two endpoints. The first returns all six formats for every source in the session. The second narrows to a single format.
curl https://api.essarion.com/api/v1/citations/ses_01HXY8K3M4N5P6Q7R8S9T0V1W2 \
-H "Authorization: Bearer $ESSARION_KEY"
{
"session_id": "ses_01HXY8K3M4N5P6Q7R8S9T0V1W2",
"sources": [
{
"id": "src_01HXY...",
"title": "Final Rule: Section 45V Clean Hydrogen Production Credit",
"url": "https://home.treasury.gov/news/press-releases/jy2789",
"citations": {
"mla": "U.S. Department of the Treasury. \"Final Rule...",
"apa": "U.S. Department of the Treasury. (2024, December 15)...",
"chicago": "U.S. Department of the Treasury. 2024. \"Final Rule...",
"ieee": "[1] U.S. Department of the Treasury, \"Final rule...",
"harvard": "U.S. Department of the Treasury (2024) Final rule...",
"bibtex": "@misc{treasury2024_45v, ..."
}
}
]
}
For just one format:
where format is one of mla, apa, chicago, ieee, harvard, bibtex.
curl https://api.essarion.com/api/v1/citations/ses_01HXY.../bibtex \
-H "Authorization: Bearer $ESSARION_KEY"
The single-format endpoint returns just the rendered strings, ready to drop into a bibliography file or pasted into a paper.
§ 04Bulk export
For a research project with dozens of sources, fetch a zip of all six formats with one call.
curl -X POST https://api.essarion.com/api/v1/citations/ses_01HXY.../export \
-H "Authorization: Bearer $ESSARION_KEY" \
-o citations.zip
The archive contains one file per format: mla.txt, apa.txt, chicago.txt, ieee.txt, harvard.txt, and references.bib. The text files are one source per paragraph, in the order they appeared in the report. The .bib file uses stable BibTeX keys derived from the source's first author and year.
§ 05Embedding citations in your own document
The answer field returned from /api/v1/query contains inline markers — [1], [2], etc. — that index into the citations array on the response. To produce a proper bibliography in any format you like, you can substitute those markers for footnotes (or endnotes, or hyperlinks) at render time.
Here's a minimal Markdown example. Given an answer like:
Treasury issued final rules on §45V in December 2024 [1], replacing
the proposed rules from May 2023 [2].
and a citations array with two entries, you can render it as:
Treasury issued final rules on §45V in December 2024[^1], replacing
the proposed rules from May 2023[^2].
[^1]: U.S. Department of the Treasury. (2024, December 15). Final rule:
Section 45V clean hydrogen production credit. Treasury.gov.
https://home.treasury.gov/news/press-releases/jy2789
[^2]: U.S. Department of the Treasury. (2023, May 22). Notice of proposed
rulemaking: Section 45V. Federal Register.
https://www.federalregister.gov/...
The substitution is a regex pass — replace [N] with [^N] in the body, then append the footnote definitions. The same shape works for HTML (<sup> tags + an ordered list at the bottom), LaTeX (\cite{...} + a .bib), or plain text.
§ 06When citations are missing fields
Real-world web sources are messy. Blog posts often have no listed publisher; news articles drop bylines; some pages have no published date at all. The citation engine has fallback rules so you never get a malformed citation, but you should know what they are.
| missing | fallback |
|---|---|
| year | n.d. (no date) is used in MLA, APA, Chicago, Harvard. BibTeX omits the year field. |
| publisher | The site's domain (e.g. nytimes.com → The New York Times; unknown domains use the bare host). |
| author | The publisher is used in author position, with no separate publisher field. |
| access date | The current date at the time of the research run. |
| title | The page's <title> tag, then og:title, then the URL path as a fallback. |
fallback_fields array on each source object so you can spot them quickly.If you need a missing field, ask the user for it. The PATCH /api/v1/citations/{session_id}/{source_id} endpoint accepts overrides — you supply the missing publisher or correct year, and the citation strings are regenerated for that source across all six formats.
§ 07Style consistency tips
If you're letting end-users export from your product, a few editorial habits will save them grief downstream.
- Pick one style and stick to it within a single document. Mixing MLA in-text citations with APA bibliography entries — easy to do if you're copy-pasting from multiple tools — will fail style review.
- Always show the access date for online sources. URLs decay. Including the date you accessed a page makes it possible for someone to retrieve an archived copy from the Wayback Machine even if the live URL has gone 404.
- Verify URLs resolve before publishing. The engine validates URLs at research time, but pages move. For long-lived documents, run a link-check pass before final delivery.
- For BibTeX users: the keys are stable but visible in your LaTeX source. If you don't like the auto-generated keys (
treasury2024_45v), the export endpoint supports a?key_style=param.
§ 08Where to go next
- Citations in the research workflow → Research · Citations
- Source library and reuse → Sources & library
- How research runs assemble citations → Research workflow