DocsGuidesWorking with citations

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:

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.

GEThttps://api.essarion.com/api/v1/citations/{session_id}
curl
curl https://api.essarion.com/api/v1/citations/ses_01HXY8K3M4N5P6Q7R8S9T0V1W2 \
  -H "Authorization: Bearer $ESSARION_KEY"
json
{
  "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:

GEThttps://api.essarion.com/api/v1/citations/{session_id}/{format}

where format is one of mla, apa, chicago, ieee, harvard, bibtex.

curl
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.

POSThttps://api.essarion.com/api/v1/citations/{session_id}/export
curl
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.

TipThe BibTeX keys are deterministic. If you regenerate citations for the same session later, you get the same keys, so cross-references in your LaTeX document keep working.

§ 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.

missingfallback
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.comThe 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.
CautionFor high-stakes documents — academic submissions, legal filings, regulated reports — verify any citation that uses fallbacks. The engine flags these in the 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.

TipIf your end-user is writing for a specific journal or publication, check that publication's style guide first. Many fields prefer one style and reject others; asking up-front saves rewriting an entire bibliography later.

§ 08Where to go next