Citation API

Detect fabricated academic citations and check citation relevance. Verify citations against CrossRef, Semantic Scholar, and OpenAlex. Check if cited papers are actually relevant to the citing context.

POST/v1/citation/verify

Verify Citation

POST/v1/citation/verify

Verify one or more academic citations against CrossRef, Semantic Scholar, and OpenAlex. Detects fabricated or hallucinated references. Supports single and batch verification (up to 50 citations).

Parameters

Request body is a JSON object with a citations array (1-50 items). Each item:

ParameterTypeRequiredDescription
citation_textstringOptionalRaw citation string (min 10 chars). At least one of citation_text or structured is required.
structuredobjectOptionalStructured metadata: title, authors, year, journal, doi, etc.
format_hintstringOptional (default: auto)'apa', 'mla', 'chicago', 'ieee', 'gbt7714', or 'auto'

Batch Verification

Pass multiple items in the citations array to verify up to 50 citations in a single request. The response includes aggregate counts (verified_count, uncertain_count, fabricated_count).

Citation Relevance

POST/v1/citation/relevance

Check if a cited paper is actually relevant to the citing context. Uses a cascade of BM25, NLI, and LLM evaluation to determine relevance. Supports auto-fetching abstracts via DOI.

Parameters

ParameterTypeRequiredDescription
citing_contextstringRequiredThe sentence or paragraph where the citation appears (min 10 chars)
cited_paper_titlestringOptionalTitle of the cited paper
cited_paper_abstractstringOptionalAbstract of the cited paper (auto-fetched if DOI provided)
cited_doistringOptionalDOI of the cited paper (used to auto-fetch abstract)
check_depthstringOptional (default: auto)'fast', 'standard', 'deep', or 'auto'

At least one of cited_paper_title, cited_paper_abstract, or cited_doi must be provided.

Response

Response
{
  "result": {
    "relevance_verdict": "RELEVANT",
    "relevance_score": 85.2,
    "citation_intent": "supporting",
    "nli_label": "entailment",
    "explanation": "The cited paper directly introduces the transformer architecture...",
    "tier_used": 2,
    "processing_time_ms": 450.3
  }
}

Verdict Types

Verification Verdicts

VERIFIED Citation matches a real publication with high confidence

UNCERTAIN Partial match found, manual review recommended

FABRICATED No matching publication found, likely hallucinated

Relevance Verdicts

RELEVANT Cited paper is clearly relevant to the citing context

WEAKLY_RELEVANT Some topical overlap but not a strong match

IRRELEVANT No meaningful relevance to the citing context

CONTRADICTORY Cited paper contradicts the citing claim

Parameters

ParameterTypeRequiredDescription
citation_textstringOptionalRaw citation string (min 10 chars). At least one of citation_text or structured is required.
structuredobjectOptionalStructured citation metadata with fields: title, authors (string[]), year (int), journal, volume, issue, pages, doi.
format_hintstringOptional (default: auto)Citation format hint: 'apa', 'mla', 'chicago', 'ieee', 'gbt7714', or 'auto' (auto-detect)

Response

Response
{
  "result": {
    "parsed_metadata": {
      "title": "Attention Is All You Need",
      "authors": [
        "Vaswani, A.",
        "Shazeer, N.",
        "Parmar, N."
      ],
      "year": 2017,
      "journal": "Advances in Neural Information Processing Systems",
      "doi": null
    },
    "verdict": "VERIFIED",
    "confidence": 92.5,
    "best_match": {
      "source": "crossref",
      "title": "Attention is all you need",
      "authors": [
        "Vaswani, Ashish",
        "Shazeer, Noam",
        "Parmar, Niki"
      ],
      "year": 2017,
      "doi": "10.5555/3295222.3295349",
      "overall_similarity": 100
    },
    "sources_queried": [
      "crossref"
    ],
    "hallucination_signals": [],
    "processing_time_ms": 320.5
  }
}

Examples

import requests

API_KEY = "your_api_key_here"
BASE_URL = "https://api.qinyanai.com"

# --- Verify a single citation ---
response = requests.post(
    f"{BASE_URL}/v1/citation/verify",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "citations": [{
            "citation_text": "Vaswani, A., Shazeer, N. et al. (2017). Attention Is All You Need. NeurIPS, 30."
        }]
    }
)
results = response.json()["results"]
for r in results:
    print(f"Verdict: {r['verdict']}  Confidence: {r['confidence']}%")

# --- Batch verification (up to 50) ---
response = requests.post(
    f"{BASE_URL}/v1/citation/verify",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "citations": [
            {"citation_text": "Vaswani, A. et al. (2017). Attention Is All You Need. NeurIPS."},
            {"citation_text": "Devlin, J. et al. (2019). BERT: Pre-training of Deep Bidirectional Transformers. NAACL."},
        ]
    }
)
batch = response.json()
print(f"Verified: {batch['verified_count']}, Fabricated: {batch['fabricated_count']}")

# --- Check citation relevance ---
response = requests.post(
    f"{BASE_URL}/v1/citation/relevance",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "citing_context": "Transformer models have achieved state-of-the-art results in NLP tasks [1].",
        "cited_paper_title": "Attention Is All You Need",
        "check_depth": "auto"
    }
)
result = response.json()["result"]
print(f"Relevance: {result['relevance_verdict']}  Score: {result['relevance_score']}")