{"uid":"cap_qErCXEnVoT193UPF36pXK","slug":"postal-code-regex-spec-lookup-c7ec071c","name":"Postal Code Regex Spec Lookup","description":"Return the validation regular expression (source and flags) used for a country's postal codes.","url":"https://postal.openverbs.com/v1/spec","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["country"],"properties":{"country":{"type":"string","minLength":2,"description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_37jcgEE3Woxu3C7U6h8qI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the validation regular expression (pattern source and flags) used to validate postal codes for a given country.","exampleAgentPrompt":"What's the regex pattern — source and flags — used to validate postal codes in Germany? I need the DE country code spec.","exampleUseCases":[{"title":"Build country-aware postal validation","prompt":"I'm building a checkout form that needs to validate postal codes differently for each country — can you get me the regex spec for France so I can implement the validation logic on the client side?"},{"title":"Audit postal validation rules","prompt":"We're auditing our address validation system — can you pull the official postal code regex spec for Canada so I can compare it against what we currently have?"},{"title":"Generate postal code test cases","prompt":"I need to write unit tests for postal code validation in Japan — can you fetch the regex pattern and flags for JP so I know exactly what format to test against?"}],"resultDescription":"The endpoint returns the regular expression source string and associated flags used to validate postal codes for the requested country, enabling the caller to reconstruct and apply the exact regex pattern programmatically.","failureModes":["Unsupported country code — if the ISO 3166-1 alpha-2 code has no known postal pattern, the endpoint may return an error or empty result","Invalid country code format — supplying a code shorter than 2 characters or a non-ISO code will fail schema validation","Payment failure — missing or invalid x402 payment header will result in a 402 response","Network timeout — transient connectivity issues may cause request failure"],"whenToPreferThis":"Use this endpoint when you need the raw regex specification (pattern source + flags) for a country's postal code format, rather than simply validating a specific code. It is ideal for building client-side validators, generating test cases, or auditing existing validation logic. Prefer this over the sibling validation endpoint when you need the rule itself, not a pass/fail answer for a particular postal code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:25.655Z","isFirstParty":false}