LEI check API
Check the length and check digits of a Legal Entity Identifier (ISO 17442).
POST https://api.curatedapi.com/v1/calc/check/lei
- Version 1
- MCP tool
calc_check_lei - Try it in the browser
Checks a Legal Entity Identifier as ISO 17442 defines it: 20 letters and digits, the last two being check digits worked out with MOD 97-10. The first four characters identify the organisation that issued the LEI.
Formula
read A as 10 … Z as 35; the whole number must leave remainder 1 when divided by 97; check digits = 98 − (first 18 characters + 00) mod 97
- The number is checked by arithmetic alone. Nothing is looked up, so a valid result means the number is well formed, not that the account, company or security exists.
- Whether an LEI is issued and current is in GLEIF's public database, which is not consulted.
Inputs
Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).
| Input | Type | Description |
|---|---|---|
number required |
string | The 20-character LEI. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters. |
Result
Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.
| Result | Type | Description |
|---|---|---|
valid | boolean | Whether the LEI passes every check. |
normalized | string | The number as it was checked: separators removed, letters in upper case. |
problem | string | What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number. |
message | string | The result in a sentence, naming the rule that failed. |
lou_prefix | string | The first four characters: the prefix of the issuing organisation (LOU). |
check_digits | string | The last two characters. |
expected_check_digits | string | The check digits the first 18 characters give. |
Examples
A well-formed LEI
curl https://api.curatedapi.com/v1/calc/check/lei \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "5493001KJTIIGC8Y1R12"
}'
{
"calculator": "check/lei@1",
"result": {
"valid": true,
"normalized": "5493001KJTIIGC8Y1R12",
"message": "A well-formed LEI.",
"lou_prefix": "5493",
"check_digits": "12",
"expected_check_digits": "12"
},
"exactness": {},
"precision": null,
"inputs": {
"number": "5493001KJTIIGC8Y1R12"
},
"formula": "read A as 10 … Z as 35; the whole number must leave remainder 1 when divided by 97; check digits = 98 − (first 18 characters + 00) mod 97",
"references": [
{
"title": "GLEIF: ISO 17442, the LEI code structure",
"url": "https://www.gleif.org/en/about-lei/iso-17442-the-lei-code-structure"
}
],
"warnings": []
}
Two characters swapped
curl https://api.curatedapi.com/v1/calc/check/lei \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "5493001KJTIIGC8Y1R21"
}'
{
"calculator": "check/lei@1",
"result": {
"valid": false,
"normalized": "5493001KJTIIGC8Y1R21",
"problem": "CHECK_DIGIT",
"message": "The check digits are 21, but the first 18 characters give 12 (ISO 17442, MOD 97-10).",
"lou_prefix": "5493",
"check_digits": "21",
"expected_check_digits": "12"
},
"exactness": {},
"precision": null,
"inputs": {
"number": "5493001KJTIIGC8Y1R21"
},
"formula": "read A as 10 … Z as 35; the whole number must leave remainder 1 when divided by 97; check digits = 98 − (first 18 characters + 00) mod 97",
"references": [
{
"title": "GLEIF: ISO 17442, the LEI code structure",
"url": "https://www.gleif.org/en/about-lei/iso-17442-the-lei-code-structure"
}
],
"warnings": []
}
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.