# BCP 47 Language Tag Parser and Validator

> BCP 47 Language Tag Parser and Validator is a paid API for AI agents from fittings.sh, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

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.

## Facts

- Endpoint: GET https://fittings.sh/v1/lang/bcp47
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bcp-47-language-tag-parser-and-validator-efe03389
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4bDmAKovAwCcmcs19ymxI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bcp-47-language-tag-parser-and-validator-efe03389
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bcp-47-language-tag-parser-and-validator-efe03389/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
