Documentation
Predict nationality from a name. Use Nationalize from your API client, your spreadsheet, your no-code workflow, or your AI assistant. Pick the surface that matches how you work.
What Nationalize does
Nationalize answers one question: which countries is a name most likely to come
from? Send a last name, like nguyen, or a full name like Sarah Johnson, and the answer comes back as a ranked list of
up to five countries, each with its own probability, and the number of records
behind it.
Names travel with families and cultures, and surnames in particular are strong markers of origin. Nationalize looks the name up in a large dataset of real-world name records and reports the countries where it is most common.
What the response contains
Every Nationalize response contains three fields.
name
|
The name from the request, echoed exactly as sent. |
country
|
Up to five candidate countries, ordered by descending probability. Each candidate pairs a two-letter country_id with a probability between 0 and 1. Empty when no prediction can be made. |
count
|
Data points behind the prediction. |
How Nationalize reads names
Send the fullest form of the name you have. Every part of a name carries signal:
the surname is the dominant signal for nationality, and the given name adds to it.
When both parts point to the same country, the prediction strengthens —
Sarah Johnson
produces a better prediction than
Johnson
alone.
-
Name parts are identified by evidence, not position.
Tanaka HiroshiandHiroshi Tanakaproduce the same prediction. -
You can send names with titles, initials, or nicknames — Nationalize handles them.
Dr. J. Sarah Johnsonreads asSarah Johnson. -
You can send accented or unaccented spellings — Nationalize handles
both
JoséandJose.
The
name
field in the response always echoes the input exactly as sent.
Pick your surface
API
HTTPS endpoint,
GET
requests, JSON responses. Backend code, batch jobs, any language with an HTTP client.
CLI
Predict nationality from your terminal. Pipe a list of names or enrich a spreadsheet in place.
Read moreMCP server
Connect Claude Code and other MCP clients to predict nationality from natural-language prompts.
Read moreSpreadsheet
Predict nationality on a column of names. Upload a file in the browser, download the enriched output.
Read moreUse it where you already work
Need gender, age, and nationality together?
Nationalize is one of three Demografix services. The same API key works on all three — set it up once and call any of them.
Genderize
Predict gender from a name.
Read moreAgify
Predict age from a name.
Read moreNationalize
Predict nationality from a name.