Snipget.ai

Text extract numbers

Exact
text_extract_numbers

Deterministic and authoritative — the canonical answer for this input.

Pull all numbers (with optional sign, thousands separators, and decimals) out of free text, as strings in order of appearance. Processing multiple inputs? Use `text_extract_numbers_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The free text to extract values from.

Call it

curl -X POST https://api.snipget.ai/v1/text/extract/numbers \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"We invoiced 1,234 units at 19.99 each, minus -42 returns."}'

The Batch tab sends up to 1000 inputs in one call via /v1/text/extract/numbers/batch.

Example response

{
  "input": "We invoiced 1,234 units at 19.99 each, minus -42 returns.",
  "is_valid": true,
  "values": [
    "1,234",
    "19.99",
    "-42"
  ],
  "count": 3
}

FAQ

What does it return?

Every number found in free text, in order, as strings. It understands plus and minus signs (+3.5, -2), thousands separators (1,234), and decimals (19.99), so it grabs them as written.

Why are the numbers returned as text and not converted?

It preserves exactly what appeared, including commas and signs, so nothing is rounded or reformatted. If you need a clean numeric value, pass each one to a number parsing tool afterward.

Does it pull numbers out of dates, phone numbers, or IDs?

It matches anything shaped like a number, so digits inside other strings can be picked up too. It does not know the difference between a price and a phone number; it only extracts the numeric runs.

What if the text has no numbers?

You get an empty values list and a count of 0, not an error.

Is it consistent?

Yes. It is deterministic and authoritative: the same text always yields the same numbers in the same order.

Related tools