Namsor

Diaspora & ethnicity API – Analyze a name to identify ethnic background

Namsor's Diaspora & Ethnicity API provides detailed insights into a person's likely ethnic background or diaspora affiliation based on their name and a local context such as the country of residence. It supports both separated inputs (first and last name) and full name strings, making it easy to adapt to your existing datasets. This flexibility simplifies integration and speeds up your analysis process.


Whether you're conducting academic research, analyzing demographic trends, or building inclusive digital products, this API helps identify cultural diversity with high precision. It's especially effective in multicultural societies where standard origin detection may fall short. Namsor's name-based ethnicity model is trained on rich, global data—ensuring consistent and accurate results across regions and languages.

600+Research contributions

99.99%Names availability

11B billionsNames processed

Name Diaspora

Diaspora from first name (optional), last name , country code (optional).

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "firstName": "Keith",
    "lastName": "Haring",
    "score": 8.653234788906794,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": [
        "German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"
    ],
    "probabilityCalibrated": 0.5197497794419499,
    "probabilityAltCalibrated": 0.5197497794419499
}

Name Diaspora analyzes a name to identify the most likely ethnicity or diaspora, with slightly higher accuracy than the Full Name Diaspora feature. Providing both a first and last name, along with a local context (ex: country of residence, country of work, etc.), significantly improves the accuracy. The response includes the most likely ethnicity or diaspora and a ranked list of the top 10, each accompanied by a calibrated probability.

information

When no value is provided for countryIso2, Name Diaspora uses the United States US as the default local context

  • Precision:Precision gauge
  • Cost: 20 credits per name.
  • Description: Returns the most likely ethnicity or diaspora of up to 100 first names (optional) and last names, according to their country of residence.
  • More about: Name Diaspora

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Request body
NameTypeRequiredDescription
personalNamesArray of objectsRequiredA list of personal names with their country of residence.
[{...}].idStringOptionalUnique identifier.
[{...}].firstNameStringOptionalFirst name, given name, nickname.
[{...}].lastNameStringRequiredLast name, family name, surname.
[{...}].countryIso2StringOptionalCountry of residence, in ISO 3166-1 alpha-2 format. "US" by default (if no value indicated).
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted names with their ethnicities.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].firstNameStringSubmitted first name.
[{...}].lastNameStringSubmitted last name.
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.
[{...}].ethnicityAltStringSecond most likely ethnicity.Ethnicities or diasporas
[{...}].ethnicityStringMost likely ethnicity.Ethnicities or diasporas
[{...}].liftedBooleanIndicates if the output ethnicity is based on machine learning only, or further lifted as a known fact by a country-specific rule.
[{...}].countryIso2StringSubmitted country of residence, in ISO 3166-1 alpha-2 format.Country of residence
[{...}].ethnicitiesTopArrayTop 10 most likely ethnicities, ordered from most likely to least likely.Ethnicities or diasporas
[{...}].probabilityCalibratedNumberThe calibrated probability that ethnicity has been guessed correctly. -1 = still calibrating .
[{...}].probabilityAltCalibratedNumberThe calibrated probability that ethnicity OR ethnicityAlt have been guessed correctly. -1 = still calibrating .
Optional: X-OPTION-RELIGION-STATS = True
[{...}].religionStatsArray of objectsReligious statistics in the country of origin of the most likely diaspora. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True).
[{...}].religionStringReligion within country of origin of most likely diaspora (ethnicity).Religions
[{...}].pctNumberPercentage of the population practicing this religion in the country of origin of the most likely diaspora (ethnicity).
[{...}].religionStatsAltArray of objectsReligious statistics in the country of origin of the second most likely diaspora. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True).
[{...}].religionStringReligion within country of origin of second most likely diaspora (ethnicityAlt).Religions
[{...}].pctNumberPercentage of the population practicing this religion in the country of origin of the second most likely diaspora (ethnicityAlt).

Code sample:

Name Diaspora code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"0d7d6417-0bbb-4205-951d-b3473f605b56","firstName":"Keith","lastName":"Haring","countryIso2":"US"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "firstName": "Keith",
            "lastName": "Haring",
            "score": 8.653234788906794,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
            "probabilityCalibrated": 0.5197497794419499,
            "probabilityAltCalibrated": 0.5197497794419499
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"0d7d6417-0bbb-4205-951d-b3473f605b56\",\"firstName\":\"Keith\",\"lastName\":\"Haring\",\"countryIso2\":\"US\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "firstName": "Keith",
            "lastName": "Haring",
            "score": 8.653234788906794,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
            "probabilityCalibrated": 0.5197497794419499,
            "probabilityAltCalibrated": 0.5197497794419499
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch"

payload = {
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}
headers = {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "firstName": "Keith",
            "lastName": "Haring",
            "score": 8.653234788906794,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
            "probabilityCalibrated": 0.5197497794419499,
            "probabilityAltCalibrated": 0.5197497794419499
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
})
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "firstName": "Keith",
            "lastName": "Haring",
            "score": 8.653234788906794,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
            "probabilityCalibrated": 0.5197497794419499,
            "probabilityAltCalibrated": 0.5197497794419499
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}
  • Precision:Precision gauge
  • Cost: 20 credits per name.
  • Description: Returns the most likely ethnicity or diaspora of a first name (optional) and a last name, according to the country of residence.
information

For requests with a GET method all parameters are required. For more ease in the use of our requests we recommend that you use the POST method.

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/{countryIso2}/{firstName}/{lastName}
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Request parameters
NameTypeRequiredDescription
firstNameStringRequiredFirst name, given name, nickname.
lastNameStringRequiredLast name, family name, surname.
countryIso2StringRequiredCountry of residence, in ISO 3166-1 alpha-2 format. "US" by default (if no value indicated).
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
firstNameStringSubmitted first name.
lastNameStringSubmitted last name.
scoreNumberHigher implies a more reliable result, score is not normalized.
ethnicityAltStringSecond most likely ethnicity.Ethnicities or diasporas
ethnicityStringMost likely ethnicity.Ethnicities or diasporas
liftedBooleanIndicates if the output ethnicity is based on machine learning only, or further lifted as a known fact by a country-specific rule.
countryIso2StringSubmitted country of residence, in ISO 3166-1 alpha-2 format.Country of residence
ethnicitiesTopArrayTop 10 most likely ethnicities, ordered from most likely to least likely.Ethnicities or diasporas
probabilityCalibratedNumberThe calibrated probability that ethnicity has been guessed correctly. -1 = still calibrating .
probabilityAltCalibratedNumberThe calibrated probability that ethnicity OR ethnicityAlt have been guessed correctly. -1 = still calibrating .
religionStringReligion within country of origin of most likely diaspora (ethnicity).Religions
pctNumberPercentage of the population practicing this religion in the country of origin of the most likely diaspora (ethnicity).
religionStringReligion within country of origin of second most likely diaspora (ethnicityAlt).Religions
pctNumberPercentage of the population practicing this religion in the country of origin of the second most likely diaspora (ethnicityAlt).

Code sample:

Name Diaspora code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/Keith/Haring \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "firstName": "Keith",
    "lastName": "Haring",
    "score": 8.653234788906794,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
    "probabilityCalibrated": 0.5197497794419499,
    "probabilityAltCalibrated": 0.5197497794419499
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/Keith/Haring")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "firstName": "Keith",
    "lastName": "Haring",
    "score": 8.653234788906794,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
    "probabilityCalibrated": 0.5197497794419499,
    "probabilityAltCalibrated": 0.5197497794419499
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/Keith/Haring"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "firstName": "Keith",
    "lastName": "Haring",
    "score": 8.653234788906794,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
    "probabilityCalibrated": 0.5197497794419499,
    "probabilityAltCalibrated": 0.5197497794419499
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Name Diaspora code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/Keith/Haring", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "firstName": "Keith",
    "lastName": "Haring",
    "score": 8.653234788906794,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Danish", "Irish", "Norwegian", "Swedish", "Jewish", "NativeHawaiian", "Austrian"],
    "probabilityCalibrated": 0.5197497794419499,
    "probabilityAltCalibrated": 0.5197497794419499
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora

Diaspora from full name , country code .

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "name": "Keith Haring",
    "score": 1.9177978014400305,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": [
        "German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"
    ],
    "probabilityCalibrated": 0.29971840123154375,
    "probabilityAltCalibrated": 0.35544175296700403
}

Full Name Diaspora analyzes an unsplit full name (first and last name combined) to determine the most likely ethnicity or diaspora. The response includes the most likely result along with a ranked list of the top 10 ethnicities or diasporas, each accompanied by a calibrated probability.

information

If the first and last name are clearly identifiable, the Name Diaspora feature will be slightly more accurate.

  • Precision:Precision gauge
  • Cost: 20 credits per name.
  • Description: Returns the most likely ethnicity or diaspora of up to 100 unsplit full names, according to their country of residence.
  • More about: Full Name Diaspora

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFullBatch
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Request body
NameTypeRequiredDescription
personalNamesArray of objectsRequiredA list of personal full names with their country of residence.
[{...}].idStringOptionalUnique identifier.
[{...}].nameStringRequiredUnsplit full name (first name and last name).
[{...}].countryIso2StringRequiredCountry of residence, in ISO 3166-1 alpha-2 format. "US" by default (if no value indicated).
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted full names with their ethnicities.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].nameStringSubmitted full name.
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.
[{...}].ethnicityAltStringSecond most likely ethnicity.Ethnicities or diasporas
[{...}].ethnicityStringMost likely ethnicity.Ethnicities or diasporas
[{...}].liftedBooleanIndicates if the output ethnicity is based on machine learning only, or further lifted as a known fact by a country-specific rule.
[{...}].countryIso2StringSubmitted country of residence, in ISO 3166-1 alpha-2 format.Country of residence
[{...}].ethnicitiesTopArrayTop 10 most likely ethnicities, ordered from most likely to least likely.Ethnicities or diasporas
[{...}].probabilityCalibratedNumberThe calibrated probability that ethnicity has been guessed correctly. -1 = still calibrating .
[{...}].probabilityAltCalibratedNumberThe calibrated probability that ethnicity OR ethnicityAlt have been guessed correctly. -1 = still calibrating .
Optional: X-OPTION-RELIGION-STATS = True
[{...}].religionStatsArray of objectsReligious statistics in the country of origin of the most likely diaspora. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True).
[{...}].religionStringReligion within country of origin of most likely diaspora (ethnicity).Religions
[{...}].pctNumberPercentage of the population practicing this religion in the country of origin of the most likely diaspora (ethnicity).
[{...}].religionStatsAltArray of objectsReligious statistics in the country of origin of the second most likely diaspora. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True).
[{...}].religionStringReligion within country of origin of second most likely diaspora (ethnicityAlt).Religions
[{...}].pctNumberPercentage of the population practicing this religion in the country of origin of the second most likely diaspora (ethnicityAlt).

Code sample:

Full Name Diaspora code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFullBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"0d7d6417-0bbb-4205-951d-b3473f605b56","name":"Keith Haring","countryIso2":"US"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "name": "Keith Haring",
            "score": 1.9177978014400305,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
            "probabilityCalibrated": 0.29971840123154375,
            "probabilityAltCalibrated": 0.35544175296700403
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFullBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"0d7d6417-0bbb-4205-951d-b3473f605b56\",\"name\":\"Keith Haring\",\"countryIso2\":\"US\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "name": "Keith Haring",
            "score": 1.9177978014400305,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
            "probabilityCalibrated": 0.29971840123154375,
            "probabilityAltCalibrated": 0.35544175296700403
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFullBatch"

payload = {
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}
headers = {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "name": "Keith Haring",
            "score": 1.9177978014400305,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
            "probabilityCalibrated": 0.29971840123154375,
            "probabilityAltCalibrated": 0.35544175296700403
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFullBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
})
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

Body parameter:

{
  "personalNames": [
    {
      "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
            "name": "Keith Haring",
            "score": 1.9177978014400305,
            "ethnicityAlt": "British",
            "ethnicity": "German",
            "lifted": false,
            "countryIso2": "US",
            "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
            "probabilityCalibrated": 0.29971840123154375,
            "probabilityAltCalibrated": 0.35544175296700403
        }
    ]
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}
  • Precision:Precision gauge
  • Cost: 20 credits per name.
  • Description: Returns the most likely ethnicity or diaspora of an unsplit full name, according to the country of residence.
information

For requests with a GET method all parameters are required. For more ease in the use of our requests we recommend that you use the POST method.

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFull/{countryIso2}/{name}
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Request parameters
NameTypeRequiredDescription
nameStringRequiredUnsplit full name (first name and last name).
countryIso2StringRequiredCountry of residence, in ISO 3166-1 alpha-2 format. "US" by default (if no value indicated).
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
nameStringSubmitted full name.
scoreNumberHigher implies a more reliable result, score is not normalized.
ethnicityAltStringSecond most likely ethnicity.Ethnicities or diasporas
ethnicityStringMost likely ethnicity.Ethnicities or diasporas
liftedBooleanIndicates if the output ethnicity is based on machine learning only, or further lifted as a known fact by a country-specific rule.
countryIso2StringSubmitted country of residence, in ISO 3166-1 alpha-2 format.Country of residence
ethnicitiesTopArrayTop 10 most likely ethnicities, ordered from most likely to least likely.Ethnicities or diasporas
probabilityCalibratedNumberThe calibrated probability that ethnicity has been guessed correctly. -1 = still calibrating .
probabilityAltCalibratedNumberThe calibrated probability that ethnicity OR ethnicityAlt have been guessed correctly. -1 = still calibrating .
religionStringReligion within country of origin of most likely diaspora (ethnicity).Religions
pctNumberPercentage of the population practicing this religion in the country of origin of the most likely diaspora (ethnicity).
religionStringReligion within country of origin of second most likely diaspora (ethnicityAlt).Religions
pctNumberPercentage of the population practicing this religion in the country of origin of the second most likely diaspora (ethnicityAlt).

Code sample:

Full Name Diaspora code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFull/US/Keith%20Haring \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "name": "Keith Haring",
    "score": 1.9177978014400305,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
    "probabilityCalibrated": 0.29971840123154375,
    "probabilityAltCalibrated": 0.35544175296700403
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFull/US/Keith%20Haring")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "name": "Keith Haring",
    "score": 1.9177978014400305,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
    "probabilityCalibrated": 0.29971840123154375,
    "probabilityAltCalibrated": 0.35544175296700403
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFull/US/Keith%20Haring"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "name": "Keith Haring",
    "score": 1.9177978014400305,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
    "probabilityCalibrated": 0.29971840123154375,
    "probabilityAltCalibrated": 0.35544175296700403
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}

Full Name Diaspora code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaFull/US/Keith%20Haring", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "0d7d6417-0bbb-4205-951d-b3473f605b56",
    "name": "Keith Haring",
    "score": 1.9177978014400305,
    "ethnicityAlt": "British",
    "ethnicity": "German",
    "lifted": false,
    "countryIso2": "US",
    "ethnicitiesTop": ["German", "British", "Dutch", "Irish", "Norwegian", "Danish", "Swedish", "Swiss", "Austrian", "NativeHawaiian"],
    "probabilityCalibrated": 0.29971840123154375,
    "probabilityAltCalibrated": 0.35544175296700403
}

Values ​​returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.

{
  religionStats: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
  religionStatsAlt: [
    { religion: 'Christian', pct: 68.7 },
    { religion: 'Unaffiliated', pct: 24.7 },
    { religion: 'Muslim', pct: 5.8 },
    { religion: 'Buddhist', pct: 0.3 },
    { religion: 'Jewish', pct: 0.3 },
    { religion: 'Other', pct: 0.1 },
    { religion: 'Folk', pct: 0.05 },
    { religion: 'Hindu', pct: 0.05 },
  ],
}