Nationalize.io API

⭐ Beginner's Pick Development / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

Nationalize.io predicts the likely nationality of a person based on their first name by analyzing a large database of name-to-country associations. The API returns a ranked list of countries with probability scores, so you can see which nationalities are most common for that name. It is free for moderate use and requires no API key, making it one of the simplest name-analysis APIs available.

💡

Beginner Tip

Pass a first name as the "name" query parameter and you will receive an array of country predictions sorted by probability. For example, querying "Yuki" will return Japan with a high probability score. You can also send multiple names in one request using repeated "name[]" parameters to save round trips.

Available Data

country name and code
population
capital city
region and subregion
flag image URL
prediction result with confidence score

Example Response

JSON Response
{
  "name": "Japan",
  "capital": "Tokyo",
  "population": 125800000,
  "region": "Asia",
  "languages": [
    "Japanese"
  ],
  "flag": "https://flagcdn.com/jp.svg",
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen"
    }
  ]
}

Field Reference

name The input name that was analyzed.
country Ranked list of country predictions.
country[].country_id ISO 3166-1 alpha-2 country code for the predicted nationality, e.g. "JP".
country[].probability Confidence score between 0 and 1 indicating how likely the name belongs to this country.
count Total number of data points used to generate the prediction.

Implementation Example

const url = "https://nationalize.io/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

422 Unprocessable Entity The "name" query parameter is missing or empty.
Always include ?name=firstname in the URL. The parameter is required.
Empty "country" array in response The name is too rare or too new to have enough data for a prediction.
This is expected for uncommon names. Handle the empty array gracefully in your code rather than throwing an error.
429 Too Many Requests Free-tier rate limit exceeded. The API allows a set number of requests per day without a key.
Add a free API key (available on the Nationalize.io website) to increase your daily quota significantly.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 483ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →