BYTETOOLS

Nationalize API

Free API predicting likely nationality from a first name, returning ranked countries with probabilities. 100 requests/day, no key. Tested curl example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the Nationalize API?

Nationalize is a free API that predicts the likely country of origin for a first name, returning a ranked list of countries each with a probability score. It allows 100 requests per day with no API key.

Unlike its sibling APIs Agify and Genderize, Nationalize returns a ranked list rather than a single answer — typically the top few countries with a probability each. That structure is more honest, because names genuinely do span multiple countries.

The same caution applies: this reflects statistical name distribution, not a person's actual nationality, citizenship or ethnicity. It is appropriate for aggregate analysis and localisation experiments, and inappropriate for any decision about an individual.

Quick facts

Base URL
https://api.nationalize.io
Authentication
No key for the free tier; optional key for higher limits.
Rate limit
100 requests per day without a key.
Pricing
Free tier; paid plans available.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Nationalize API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Predict likely nationality from a name

GET https://api.nationalize.io?name=nathaniel

curl
curl 'https://api.nationalize.io?name=nathaniel'
JavaScript (fetch)
const res = await fetch("https://api.nationalize.io?name=nathaniel");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.nationalize.io?name=nathaniel", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "count": 57823,
  "name": "nathaniel",
  "country": [
    {
      "country_id": "US",
      "probability": 0.357622
    },
    {
      "country_id": "NG",
      "probability": 0.07579
    },
    {
      "country_id": "PH",
      "probability": 0.069334
    },
    {
      "country_id": "GH",
      "probability": 0.067883
    },
    {
      "country_id": "GB",
      "probability": 0.054157
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
namestringRequiredFirst name to analyse. nathaniel

Response fields

namestring
The name queried.
countryarray
Ranked country predictions, highest probability first.
country[].country_idstring
ISO 3166-1 alpha-2 country code.
country[].probabilityfloat
Probability for that country, 0 to 1.

What you can build with the Nationalize API

  • Analyse the geographic distribution of names in a dataset
  • Suggest a default language or locale as a low-stakes hint
  • Support onomastics and migration research
  • Teach ranked probabilistic output and its interpretation

Common errors and how to fix them

Empty country array

The name is not in the dataset.

Fix: Handle the empty case; coverage varies considerably by region.

Over-confident use of the top result

Probabilities are often spread thinly across several countries.

Fix: Compare the top probability against the runner-up before treating it as meaningful.

429

Daily allowance exhausted.

Fix: Cache by name — results do not change.

Nationalize API — frequently asked questions

How does Nationalize work?

It analyses the statistical distribution of a first name across countries and returns a ranked list with probabilities, rather than a single answer — which better reflects that names cross borders.

Is Nationalize free?

Yes, 100 requests per day with no API key. Paid plans raise the limit.

Can it tell me someone's actual nationality?

No. It reflects where a name is statistically common, which is not the same as a person's nationality, citizenship or ethnicity. Use it for aggregate analysis, never for decisions about individuals.

Why does it return several countries?

Because names genuinely span countries. The ranked list with probabilities is more honest than forcing a single answer — compare the top two before drawing conclusions.

Tools that pair with this API

Nationalize is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.