Nationalize.io API

Beginner's Pick Development / No Auth Required Beginner HTTPS CORS
Free to Use 25 per window
78 B
Measured Score 0 50 100 Speed 10/30 Consistency 20/20 Security 18/20 Browser access 15/15 Transparency 15/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.nationalize.io/?name=Yuki
Result
HTTP 200 · application/json · 256 bytes · compressed
Response time
318 ms (median of 3) · fastest 317 ms
Transport
TLSv1.2 · ECDHE-RSA-AES128-GCM-SHA256 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Rate limit
25 per window
Served by
nginx/1.16.1
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
count integer 29153
name string Yuki
country array [1 item]

Captured Response

Captured from a real request to https://api.nationalize.io/?name=Yuki on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "count": 29153,
  "name": "Yuki",
  "country": [
    {
      "country_id": "JP",
      "probability": 0.463358
    }
  ]
}

Field Reference

name The input name that was analyzed.
country Ranked list of country predictions.
count Total number of data points used to generate the prediction.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.nationalize.io/?name=Yuki";
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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist text/html

Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 10/30
Consistency 20/20
Security 18/20
Browser access 15/15
Transparency 15/15
Endpoint Response Time 318ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →