API Directory › 📚 Data, Text & Words › Nationalize
No authHTTPSCORS

Nationalize API

Predict the likely nationality for a first name — free and no-key.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open Nationalize docs ↗

What it does

Nationalize.io predicts the likely country (or countries) of origin for a first or last name, returning a ranked list of country codes with probabilities. It is built from the same kind of large name–location dataset as its sibling APIs.

Base URL

https://api.nationalize.io

Authentication

None for the free tier. ?name=juan, or batch ?name[]=juan&name[]=nguyen (up to 10). A paid key raises the daily limit.

Code examples

curl
curl -s "https://api.nationalize.io?name=Nguyen"
Python
import requests

r = requests.get("https://api.nationalize.io", params={"name": "Schmidt"}, timeout=10)
for c in r.json()["country"][:3]:
    print(c["country_id"], round(c["probability"], 3))

Rate limits & quotas

Free tier: 100 names/day per IP (batches count per name). Rate-limit headers (X-Rate-Limit-Remaining, X-Rate-Reset) track usage; over the cap returns HTTP 429.

Key response fields

nameEcho of the input
country[]Ranked predictions, highest probability first
country[].country_idISO 3166-1 alpha-2 code
country[].probability0–1 likelihood for that country

Common errors

422Missing name parameter.
429 "Request limit reached"Daily 100-name cap hit.
country: []No confident prediction — treat as unknown.

When to use it (and alternatives)

Lightweight enrichment for analytics, localisation defaults or curiosity features — with the same caveat as its siblings: it is a statistical guess about a name, not a person’s identity, and should never gate access or be shown as fact. Pair-family: Agify, Genderize.

FAQ

Should I use this to guess someone's ethnicity?

No. It predicts a country association for a name string from population statistics. Applying it to individuals — especially to infer ethnicity or make decisions — is inaccurate and can be discriminatory. Keep it to aggregate analysis.

First name or last name?

Either works, but surnames usually give a stronger country signal than given names.

Why several countries in the result?

Many names occur across borders (colonial history, migration, shared languages). The ranked list with probabilities reflects that ambiguity — don’t collapse it to the top hit without checking the probability gap.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

Word CounterJSON Formatter

Related Data, Text & Words APIs

← Back

More Data, Text & Words APIs · All 196 APIs