Skip to content

Find figures that disagree across pages and documents

Send figures with their source locations to the conflicts endpoint, or a whole file to analyze document, and get back each disagreement and recomputation for review.

Last updated

Markdown

Endpoint and minimal request

POST https://api.webcite.co/api/v1/analyze/conflicts takes figures, an array where each figure has metric, value, unit, period and provenance. To start from a file instead, POST /api/v1/analyze/document takes an asset_id and extracts the figures itself. Agents call analyze_conflicts or analyze_document.

A recorded request sent ten figures from two pages of the U.S. Mint's 2024 annual report, typed from the PDF with their page and quote. The first two:

json
{
  "figures": [
    {
      "metric": "revenue",
      "value": 3385700000,
      "decimalValue": "3385700000",
      "unit": "currency",
      "period": "FY2024",
      "basis": "actual",
      "provenance": {
        "assetId": "d22dac9c-7cb0-4687-9cf5-a0789242beeb",
        "documentName": "us-mint-2024-annual-report-pages-9-and-36",
        "page": 1,
        "method": "rule",
        "quote": "FY 2024 revenue was $3,385.7 million"
      },
      "currency": "USD"
    },
    {
      "metric": "cogs",
      "value": 2968500000,
      "decimalValue": "2968500000",
      "unit": "currency",
      "period": "FY2024",
      "basis": "actual",
      "provenance": {
        "assetId": "d22dac9c-7cb0-4687-9cf5-a0789242beeb",
        "documentName": "us-mint-2024-annual-report-pages-9-and-36",
        "page": 1,
        "method": "rule",
        "quote": "Cost of goods sold (COGS) decreased 27.3 percent to $2,968.5 million"
      },
      "currency": "USD"
    }
  ]
}

Read conflicts and recomputations

The recorded response returned one conflict and two recomputations:

json
{
  "conflicts": [
    {
      "entity": "gold bullion coins",
      "metric": "revenue_growth",
      "period": "FY2024",
      "values": [
        {
          "value": -40.4,
          "page": 1
        },
        {
          "value": -50,
          "page": 2
        }
      ],
      "reconciliationQuestion": "Reconcile Revenue growth: sources report -40.4 and -50. Which is correct and why?"
    }
  ],
  "recomputations": [
    {
      "metric": "gross_margin",
      "state": "incompatible"
    },
    {
      "metric": "revenue_growth",
      "state": "comparison_unavailable"
    }
  ],
  "review": {
    "needs_review": true,
    "reasons": [
      "cross-document conflict",
      "a numeric comparison is unavailable or unresolved"
    ]
  }
}

A conflict names both values and their pages and asks a question rather than choosing a winner. A recomputation that comes back incompatible or comparison_unavailable is an unresolved state, not a clean result: here the margin inputs described different entities. Full response.

When to use it, and what to use instead

Use this endpoint when figures should agree, such as the same metric for the same period stated on two pages or in two files. Compare figures only when entity, period, unit, currency, scale and basis match. Use figure extraction to get figures from a file, and check the numbers in a sentence for the arithmetic in a narrative statement. The reference pages are compare figures and analyze document.