{"uid":"cap_4bDmAKovAwCcmcs19ymxI","slug":"bcp-47-language-tag-parser-and-validator-efe03389","name":"BCP 47 Language Tag Parser and Validator","description":"Parses a BCP 47 language tag into language, extlang, script, region, variant, extension and private-use subtags, validates each against the IANA registry, and returns the canonical form.","url":"https://fittings.sh/v1/lang/bcp47","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["tag"],"properties":{"tag":{"type":"string","description":"Language tag, e.g. zh-Hant-HK, at most 100 characters"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Sn1tBz34fZtjgUCHhIfEi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses a BCP 47 language tag into its subtag components (language, extlang, script, region, variant, extension, private-use), validates each against the IANA registry, and returns the canonical form.","exampleAgentPrompt":"Parse and validate the BCP 47 language tag 'zh-Hant-HK' — break it into its language, script, and region subtags, validate each against the IANA registry, and give me the canonical form.","exampleUseCases":[{"title":"Validate locale tags before shipping","prompt":"I need to check whether 'sr-Latn-RS' is a valid BCP 47 language tag and see its canonical form — can you parse it into its subtags and confirm each one is registered with IANA?"},{"title":"Canonicalize malformed language codes","prompt":"Our database has the language tag 'ZH-hant-hk' stored in mixed case — can you parse it and return the correctly canonicalized BCP 47 form?"},{"title":"Debug an i18n configuration error","prompt":"We're getting a locale error in our app for the tag 'en-US-u-ca-buddhist' — can you break it down into its BCP 47 components and validate each subtag against the IANA registry?"}],"resultDescription":"Returns the parsed BCP 47 tag broken into its subtag components (language, extlang, script, region, variant, extension, private-use), a validation status for each against the IANA registry, and the canonical normalized form of the full tag.","failureModes":["Tag exceeds 100 characters — request rejected","Malformed tag that cannot be parsed into BCP 47 structure — error returned","Unrecognized subtag not found in IANA registry — validation failure indicated","Empty or missing 'tag' query parameter — bad request error","Network timeout or service unavailability — HTTP 5xx error"],"whenToPreferThis":"Choose this endpoint when you need authoritative BCP 47 parsing and IANA validation in a single call — especially useful for i18n pipelines, locale configuration validation, or any system that must accept and normalize user-supplied language tags. Prefer it over regex-based validation when correctness against the actual IANA registry matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:51:17.826Z","isFirstParty":false}