# Verify numeric arithmetic

Check a numeric claim against figures selected from retained source evidence.

Documentation index: https://webcite.co/llms.txt
Canonical page: https://webcite.co/api-docs/numeric
API origin: https://api.webcite.co
Authentication: x-api-key header. Keep keys on your server.

## When to use it

Supply one or two operands using immutable IDs already returned by a retained-source workflow. `figure_index` is zero-based within the selected source unit. Inspect the source text before choosing it. Do not substitute an upload asset ID or invent a source version.

`escalate`, `not_applicable`, null arithmetic, or unknown comparability are unresolved states. Do not translate them into supported.

## Request

POST /api/v2/verify/numeric

No fixed public credit price is specified for this V2 operation.

### curl

```curl
curl --fail-with-body -X POST 'https://api.webcite.co/api/v2/verify/numeric' \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "claim": "Revenue rose from 12.5 to 20.0, up 60%",
  "operands": [
    {
      "source_version_id": "YOUR_SOURCE_VERSION_ID",
      "representation_id": "YOUR_REPRESENTATION_ID",
      "source_unit_id": "YOUR_SOURCE_UNIT_ID",
      "figure_index": 0
    },
    {
      "source_version_id": "YOUR_SOURCE_VERSION_ID",
      "representation_id": "YOUR_REPRESENTATION_ID",
      "source_unit_id": "YOUR_SOURCE_UNIT_ID",
      "figure_index": 1
    }
  ]
}'
```

### Node.js

```javascript
const response = await fetch("https://api.webcite.co/api/v2/verify/numeric", {
  method: "POST",
  headers: {
    "x-api-key": process.env.WEBCITE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "claim": "Revenue rose from 12.5 to 20.0, up 60%",
  "operands": [
    {
      "source_version_id": "YOUR_SOURCE_VERSION_ID",
      "representation_id": "YOUR_REPRESENTATION_ID",
      "source_unit_id": "YOUR_SOURCE_UNIT_ID",
      "figure_index": 0
    },
    {
      "source_version_id": "YOUR_SOURCE_VERSION_ID",
      "representation_id": "YOUR_REPRESENTATION_ID",
      "source_unit_id": "YOUR_SOURCE_UNIT_ID",
      "figure_index": 1
    }
  ]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());
```

### python

```python
import os
import json
import requests

payload = json.loads("{\n  \"claim\": \"Revenue rose from 12.5 to 20.0, up 60%\",\n  \"operands\": [\n    {\n      \"source_version_id\": \"YOUR_SOURCE_VERSION_ID\",\n      \"representation_id\": \"YOUR_REPRESENTATION_ID\",\n      \"source_unit_id\": \"YOUR_SOURCE_UNIT_ID\",\n      \"figure_index\": 0\n    },\n    {\n      \"source_version_id\": \"YOUR_SOURCE_VERSION_ID\",\n      \"representation_id\": \"YOUR_REPRESENTATION_ID\",\n      \"source_unit_id\": \"YOUR_SOURCE_UNIT_ID\",\n      \"figure_index\": 1\n    }\n  ]\n}")
response = requests.post(
    "https://api.webcite.co/api/v2/verify/numeric",
    headers={"x-api-key": os.environ["WEBCITE_API_KEY"]},
    json=payload,
    timeout=(10, 300),
)
response.raise_for_status()
print(response.json())
```

## Response

HTTP 201 returns outcome, arithmetic, comparability, reason, scope, limitation, and operands. scope is arithmetic_only. Figure selection and the full semantic claim are not certified.

## Errors

400 includes invalid claim or operand fields, an unavailable figure index, or ambiguous source numbers. Authentication and source ownership checks also apply. Do not retry with fabricated operand values.

## OpenAPI operation

```json
{
  "path": "/api/v2/verify/numeric",
  "method": "POST",
  "operation": {
    "operationId": "NumericClaimController_assess",
    "parameters": [],
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "additionalProperties": false,
            "properties": {
              "claim": {
                "maxLength": 10000,
                "minLength": 1,
                "type": "string"
              },
              "operands": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "figure_index": {
                      "maximum": 10000,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "representation_id": {
                      "type": "string"
                    },
                    "source_unit_id": {
                      "type": "string"
                    },
                    "source_version_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_version_id",
                    "representation_id",
                    "source_unit_id",
                    "figure_index"
                  ],
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "claim",
              "operands"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "201": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "arithmetic": {
                  "nullable": true,
                  "properties": {
                    "computed": {
                      "nullable": true,
                      "type": "number"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "tolerance": {
                      "type": "number"
                    },
                    "verdict": {
                      "enum": [
                        "holds",
                        "fails",
                        "not_computable"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "verdict",
                    "computed",
                    "tolerance",
                    "reason"
                  ],
                  "type": "object"
                },
                "comparability": {
                  "nullable": true,
                  "properties": {
                    "facets": {
                      "items": {
                        "properties": {
                          "decidedBy": {
                            "enum": [
                              "code",
                              "judge"
                            ],
                            "type": "string"
                          },
                          "facet": {
                            "enum": [
                              "unit",
                              "scale",
                              "entity",
                              "period",
                              "basis"
                            ],
                            "type": "string"
                          },
                          "p": {
                            "nullable": true,
                            "type": "number"
                          },
                          "passed": {
                            "nullable": true,
                            "type": "boolean"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "verdict": {
                      "enum": [
                        "comparable",
                        "not_comparable",
                        "unknown"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "verdict",
                    "facets",
                    "reason"
                  ],
                  "type": "object"
                },
                "limitation": {
                  "type": "string"
                },
                "operands": {
                  "items": {
                    "properties": {
                      "binding": {
                        "enum": [
                          "retained_source_slice"
                        ],
                        "type": "string"
                      },
                      "figure": {
                        "properties": {
                          "accounting": {
                            "type": "boolean"
                          },
                          "index": {
                            "type": "integer"
                          },
                          "magnitude": {
                            "type": "number"
                          },
                          "raw": {
                            "type": "string"
                          },
                          "scale": {
                            "type": "number"
                          },
                          "sign": {
                            "enum": [
                              -1,
                              1
                            ],
                            "type": "integer"
                          },
                          "unit": {
                            "nullable": true,
                            "type": "string"
                          },
                          "unitClass": {
                            "enum": [
                              "percent",
                              "percentage_point",
                              "basis_point",
                              "currency",
                              "none"
                            ],
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          }
                        },
                        "type": "object"
                      },
                      "source": {
                        "properties": {
                          "representation_id": {
                            "type": "string"
                          },
                          "source_unit_id": {
                            "type": "string"
                          },
                          "source_version_id": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "required": [
                      "figure",
                      "source",
                      "binding"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "outcome": {
                  "enum": [
                    "supported",
                    "contradicted",
                    "escalate",
                    "not_applicable"
                  ],
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "scope": {
                  "enum": [
                    "arithmetic_only"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "outcome",
                "arithmetic",
                "comparability",
                "reason",
                "scope",
                "limitation",
                "operands"
              ],
              "type": "object"
            }
          }
        },
        "description": "Arithmetic assessment over owned retained source figures, never full semantic verification."
      }
    },
    "security": [
      {
        "x-api-key": []
      },
      {
        "bearer": []
      }
    ],
    "tags": [
      "Verification"
    ]
  },
  "schemas": {}
}
```
