Numbers parse boolean
Exactnumbers_parse_booleanDeterministic and authoritative — the canonical answer for this input.
Parse a boolean from messy input. Accepts yes/no, y/n, true/false, 1/0, on/off, enabled/disabled, and any numeric value — native or string ('5', '0.0') — nonzero → true, zero → false. Returns `parsed: null` for unrecognized input. Processing multiple inputs? Use `numbers_parse_boolean_batch` to do up to 1000 in one call.
Parameters
valuestringrequiredValue to parse. Accepts any JSON type.
Call it
curl -X POST https://api.snipget.ai/v1/numbers/parse/boolean \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"value":"YES"}'The Batch tab sends up to 1000 inputs in one call via /v1/numbers/parse/boolean/batch.
Example response
{
"input": "YES",
"parsed": true,
"ok": true
}FAQ
Why do I need this for a yes/no value?
Real data spells true and false a dozen ways: 'Yes', 'Y', 'on', 'enabled', '1', 'TRUE'. This turns all of those into a real true/false for you, so you do not have to write and maintain a long list of if-checks.
Which words count as true and which as false?
True: true, t, yes, y, 1, on, enabled, enable, ok, and any non-zero number. False: false, f, no, n, 0, off, disabled, disable, and zero. Matching ignores case and surrounding spaces.
What happens with a word it doesn't recognize?
It returns parsed as null with ok false and confidence 0, not an error. So 'maybe' or an empty value comes back clearly unparsed rather than guessed at, and you can decide how to handle it.
Is the result reliable?
Yes. The mapping is a fixed, deterministic table, so the same input always gives the same authoritative answer. There is no fuzzy guessing involved.
Does it understand things like 'sure' or 'nope'?
No. It only recognizes the listed words and numbers. Anything outside that set is returned as unparsed (null) rather than being interpreted, which keeps the behavior predictable.