{"id":"currency-lookup","version":"1.0.0","description":"Look up an ISO 4217 alphabetic or numeric currency code: name, minor-unit exponent, entities, active or withdrawn.","supported_operations":["what is the ISO 4217 code for a currency","how many decimal places does ISK have","currency numeric code 978","is HRK still a valid currency code","minor unit of Kuwaiti dinar","ISO 4217 code 532","which countries use CHF","is XAU a currency with decimals"],"unsupported_operations":["exchange rates or currency conversion","search by currency name or country name","symbols, locale formatting or cash rounding rules","currency codes not in the pinned ISO 4217 snapshot (cryptocurrencies, ISO 3166 country codes)"],"semantics":["Input is one field \"code\": exactly 3 ASCII letters (case-insensitive, echoed upper-case) or exactly 3 ASCII digits (numeric code, leading zeros kept). No trimming: \" USD\", \"US\", \"USDX\" and non-ASCII digits are invalid_input. A code over 64 UTF-8 bytes is limit_exceeded, checked before the pattern.","Data is the pinned snapshot named by data_version (ISO 4217 List One current and List Three historic rows; datasets/currency-codes commit 7cdc784, ODC-PDDL-1.0). Nothing is looked up online; rows without an alphabetic code are ignored.","An unknown code (ZZZ, 000) is not an error: found is false and every other field except data_version is null.","A code with at least one current row is active: name and minor_unit come from its current row, entities are the distinct current entities sorted ascending, withdrawn is null. Codes with earlier withdrawn rows under the same code (EUR, PEN, RON, TRY) are active and the withdrawn rows are ignored.","A code whose rows are all withdrawn is historic: name, numeric and entities come from the rows with the latest withdrawal date, withdrawn is that date normalized to YYYY-MM (HRK \"2023-01\", ANG \"2025-03\"): dates already in YYYY-MM are kept, a range (\"1989 to 1990\", \"1990-07 to 1990-09\") uses its end (\"1990-12\", \"1990-09\"), a bare year Y becomes \"Y-12\"; the latest row is chosen after normalization; minor_unit is null.","minor_unit is the ISO exponent (ISK 0, JPY 0, TND 3, KWD 3, CLF 4, UYW 4) and null for historic codes and for active codes without one (XAU, XAG, XDR, XXX).","A numeric lookup prefers the active code (532 is XCG, not ANG; 008 is ALL); with several active codes the alphabetically smallest wins; with none, the latest withdrawal wins (191 is HRK). The numeric field is a 3-digit string.","currency-lookup only reports what the record says; the money tools additionally reject historic codes and codes without a minor unit as unsupported_input."],"limits":{"max_code_bytes":64},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"type":"string","minLength":3,"maxLength":3,"pattern":"^([A-Za-z]{3}|[0-9]{3})$","description":"ISO 4217 alphabetic code (3 ASCII letters, case-insensitive) or numeric code (3 ASCII digits, leading zeros kept)."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["found","code","numeric","name","minor_unit","entities","status","withdrawn","data_version"],"properties":{"found":{"type":"boolean"},"code":{"type":["string","null"],"pattern":"^[A-Z]{3}$"},"numeric":{"type":["string","null"],"pattern":"^[0-9]{3}$","description":"Numeric code as a 3-digit string, leading zeros kept (\"008\")."},"name":{"type":["string","null"],"minLength":1,"maxLength":120},"minor_unit":{"type":["integer","null"],"minimum":0,"maximum":4,"description":"Minor-unit exponent; null for historic codes and for active codes with no minor unit (XAU, XDR, XXX, ...)."},"entities":{"type":["array","null"],"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":120}},"status":{"type":["string","null"],"enum":["active","historic",null]},"withdrawn":{"type":["string","null"],"minLength":1,"maxLength":32,"description":"Withdrawal month as YYYY-MM, normalized from the dataset (a range such as \"1989 to 1990\" uses its end, \"1990-12\"); null unless status is historic."},"data_version":{"type":"string","const":"iso4217-datasets-7cdc784-2026-07-27"}}},"examples":[{"input":{"code":"JPY"},"output":{"found":true,"code":"JPY","numeric":"392","name":"Yen","minor_unit":0,"entities":["JAPAN"],"status":"active","withdrawn":null,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}},{"input":{"code":"zzz"},"output":{"found":false,"code":null,"numeric":null,"name":null,"minor_unit":null,"entities":null,"status":null,"withdrawn":null,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}},{"input":{"code":"532"},"output":{"found":true,"code":"XCG","numeric":"532","name":"Caribbean Guilder","minor_unit":2,"entities":["CURAÇAO","SINT MAARTEN (DUTCH PART)"],"status":"active","withdrawn":null,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}}],"execute_url":"/v1/tools/currency-lookup/versions/1.0.0/execute"}