Documentation

Learn how to integrate CitationAPI into your application. Generate perfectly formatted citations from any URL with a single API call.

Base URL

https://api.citationapi.com
All endpoints require HTTPS

Getting Started

Get up and running in under a minute.

1

Sign up

Create a free account at citationapi.com/signup

2

Copy your API key

Find it on your dashboard after signing in.

3

Make a request

Use the example below to cite your first URL.

cURL
curl -X POST https://api.citationapi.com/v1/citations \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ca_live_your_key_here" \
  -d '{"url": "https://doi.org/10.1038/s41586-020-2649-2"}'

Authentication

Authenticate requests with an API key.

All API requests require an API key passed in the X-API-Key header. You can create and manage API keys from your dashboard.

Header
X-API-Key: ca_live_your_key_here

Note: Requests without a valid API key will receive a 401 Unauthorized response. Sign up for a free account to get your API key.

Endpoints

Create and retrieve citations.

POST/v1/citations

Create a citation from a URL. Returns structured CSL-JSON metadata and pre-formatted citations.

Request Body

ParameterTypeStatusDescription
urlstringRequiredThe URL to generate a citation for.
stylestringOptionalAny CSL style ID (e.g. apa, mla, chicago, ieee, vancouver, and 9,000+ more). Omit to return all default styles (APA, MLA, Chicago, BibTeX).
forcebooleanOptionalBypass cache and re-extract. Default: false.

Example Request

JSON
{
  "url": "https://doi.org/10.1038/s41586-020-2649-2",
  "style": "apa",
  "force": false
}

Response

JSON
{
  "id": "a1b2c3d4e5f6...",
  "url": "https://doi.org/10.1038/s41586-020-2649-2",
  "source": "crossref",
  "confidence": 0.98,
  "csl": {
    "type": "article-journal",
    "title": "Array programming with NumPy",
    "author": [
      {"family": "Harris", "given": "Charles R."},
      {"family": "Millman", "given": "K. Jarrod"}
    ],
    "issued": {"date-parts": [[2020, 9, 16]]},
    "container-title": "Nature",
    "volume": "585",
    "issue": "7825",
    "page": "357-362",
    "DOI": "10.1038/s41586-020-2649-2"
  },
  "formatted": {
    "apa": "Harris, C. R., Millman, K. J., ... (2020). Array programming with NumPy. Nature, 585(7825), 357–362.",
    "mla": "Harris, Charles R., et al. \"Array Programming with NumPy.\" Nature, vol. 585, ...",
    "chicago": "Harris, Charles R., K. Jarrod Millman, ... 2020. \"Array Programming with NumPy.\" ...",
    "bibtex": "@article{harris2020array, ...}"
  },
  "cached": false,
  "extracted_at": "2025-02-10T14:30:00Z"
}
GET/v1/citations/:id

Retrieve a previously extracted citation by its hash ID. Returns the same response format as the POST endpoint.

Path Parameters

ParameterTypeStatusDescription
idstringRequiredThe SHA256 hash ID returned from the POST endpoint.

Rate Limits

Limits vary by plan and are applied per API key.

PlanRate LimitMonthly Requests
Free10 req/min500
Developer60 req/min50,000
Pro300 req/min500,000

When rate limited, the API returns 429 Too Many Requests. Cached responses do not count against your extraction quota.

Error Codes

Standard HTTP error codes with descriptive messages.

CodeMeaningDescription
400Bad RequestMissing or invalid URL in request body
401UnauthorizedInvalid or missing API key
404Not FoundCitation ID not found in cache
422UnprocessableURL is valid but could not be cited (extraction failed across all layers)
429Rate LimitedToo many requests — slow down or upgrade plan
500Server ErrorInternal error — retry with exponential backoff

CSL-JSON Schema

The canonical data format for citation metadata.

CitationAPI uses CSL-JSON (Citation Style Language JSON) as its canonical data format. This is the same schema used by Zotero, Mendeley, and other reference managers.

Key Fields

FieldTypeDescription
typestringCSL type: "article-journal", "book", "software", "post", etc.
titlestringTitle of the work
authorarrayArray of name objects with "family" and "given" or "literal" keys
issuedobjectPublication date as date-parts array
container-titlestringJournal name, book title, or repository
DOIstringDigital Object Identifier
URLstringSource URL of the work

Example Object

JSON
{
  "type": "article-journal",
  "title": "Array programming with NumPy",
  "author": [
    {"family": "Smith", "given": "John"},
    {"literal": "Organization Name"}
  ],
  "issued": {
    "date-parts": [[2024, 3, 15]]
  },
  "container-title": "Nature",
  "volume": "585",
  "issue": "7825",
  "page": "357-362",
  "DOI": "10.1038/s41586-020-2649-2",
  "URL": "https://example.com",
  "abstract": "..."
}

The csl field in every API response contains the full CSL-JSON object. You can use this with any CSL-compatible tool to render citations in custom styles.

Ready to get started?

Get your free API key and start citing in seconds.