Tools

/

Country Code Check

country

Country Code Check

Validate ISO country codes with a fast, API-ready check.

1 credit / run

Playground

About this tool

Country code check API helps you validate ISO 3166 alpha-2 and alpha-3 codes before they enter your systems. Use this country code check to catch typos, block invalid inputs, and keep datasets clean across forms, imports, and integrations. The endpoint returns a simple boolean so you can branch logic quickly without extra parsing. Send a country code like US or DE and receive a true or false response. This country code check is ideal for onboarding flows, CRM imports, shipping logic, and analytics pipelines where inconsistent country values can break reporting. Pair it with conversion tools to normalize values only after they pass validation. Common use cases include address validation, billing checks, geo segmentation, and compliance gating. It also helps when ingesting large CSVs, where a fast validation pass can prevent bad data from polluting downstream systems. Because the output is minimal, you can run validations in bulk and log failures for cleanup. If you process large datasets, group validations in batches and cache results for common codes to reduce repeated lookups. Add monitoring around error rates so you can detect upstream issues early and improve data quality over time. This keeps imports stable and avoids manual cleanup later. It also keeps partner integrations consistent across regions and reduces support tickets from bad data. For best results, validate inputs as early as possible. If your UI allows user entry, run the check on blur or submit and surface a clear error message when the code is invalid. In back-end services, validate before writing to your database to prevent mismatched country data across tables. Call /api/run/country-validate with JSON to integrate it into your workflow. If you need to convert valid codes to names or other formats, use country-code-convert after validation. For language lookups by country, use country-language once you have a valid code.

Inputs

Name

Type

Required

Description

code

string

true

Country code in ISO alpha-2 or alpha-3 format.

Outputs

Name

Type

Description

valid

boolean

True if the code is valid.

Examples

Request

{ "code": "US" }

Response

{ "valid": true }

Frequently Asked Questions

Which formats are supported?

ISO alpha-2 and alpha-3 country codes.

How do I use the country code check API?

POST to /api/run/country-validate with a JSON body containing code.

What does the response look like?

It returns a boolean valid field indicating whether the code is recognized.

When should I run a country code check?

Before saving user input, importing CSVs, or converting codes.

Does it validate names too?

No. It validates ISO codes only; use conversion for names.

Changelog

2025-01-05

Initial tool release.

Similar Tools

Browse additional tools within this category that solve related problems. Each tool is designed to handle a specific task, but they work best when combined. Use multiple endpoints together to create efficient data processing pipelines, automate repetitive tasks, or build complete solutions tailored to your needs."

Pricing

Top quality, fair pricing

Start free, then unlock premium tools and higher limits when you’re ready.

Guest

$0Forever

For quick tests and light usage.

  • Privacy first
  • Access to basic tools
  • Strict rate limits applied
  • No API keys needed
  • No support

Paid

$79/ month

For production apps and premium tools.

  • Privacy first
  • Access to basic tools
  • Access to premium tools
  • Access to AI tools
  • Higher rate limits
  • Priority support
  • Usage insights
  • 250,000 credits per month

Enterprise

Custom

For teams needing custom limits, security, and SLAs.

  • Privacy first
  • Full access to tools
  • Custom limits
  • SLA
  • Dedicated support
  • Team onboarding
  • Security review
  • Real‑time streaming responses

Technical & Professional Built for Divhunt. Available for Enterprise.

Skip building infrastructure. Use the same battle-tested APIs that power Divhunt V2.

Get in Touch

Built in Divhunt

We use cookies.

By clicking “Accept All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View ourCookie Policyfor more information.

Optahunt

Preferences

Manage your cookie preferences.

Essentials

Always Active

These are required for the website to work, like remembering your privacy settings, keeping you logged in, or enabling secure payments.

Performance

These help us understand how people use our site (like which pages are most popular) so we can make improvements.

Personalization

These allow the site to remember your preferences (such as language or region) and provide enhanced features.

Advertising & Targeting

These are used to deliver ads more relevant to you, limit how often you see them, and measure campaign performance.

Save my preferences

You can always change these settings later via ourCookie Policy pagepage, or via the cookie widget placed at the bottom left of the page.