Nationalize API
Predict the likely nationality for a first name — free and no-key.
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
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 -s "https://api.nationalize.io?name=Nguyen"
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
| name | Echo of the input |
| country[] | Ranked predictions, highest probability first |
| country[].country_id | ISO 3166-1 alpha-2 code |
| country[].probability | 0–1 likelihood for that country |
Common errors
| 422 | Missing 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.