Namsor

U.S. race ethnicity API – Classify names according to the US Census taxonomy

Namsor's US Race Ethnicity API predicts the most likely race and ethnicity classification of a person according to the standards set by the United States Census taxonomy. You can submit a name as either a full string or in the form of first and last name. Our system handles both formats with ease, making integration simple and flexible.


This API is particularly valuable for organizations working on diversity analytics, public policy, compliance, and research projects in the United States. It maps names to official demographic categories such as White, Black or African American, Asian, Hispanic or Latino, American Indian or Alaska Native, and others. Powered by extensive U.S. datasets and advanced name recognition algorithms, Namsor delivers accurate and ethical ethnicity classification while maintaining strict privacy standards.

600+Research contributions

99.99%Names availability

11B billionsNames processed

Name US Race

US race from first name (optional), last name (optional), country code (optional).

Select a taxonomy :
For international names (non US resident) please choose 4 classes. Enumerators for the returned 'race' ethnicity. US race enumerators.
{
    "script": "LATIN",
    "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": [
        "W_NL", "B_NL", "A", "HL"
    ],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race analyzes a first name and/or last name to determine the most likely US race, with slightly higher accuracy than the Full Name US Race feature. Providing both a full name and a country of residence enhances accuracy. US race ethnicity refers to classifications defined by the United States Census Taxonomy.

  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race of up to 100 first names and/or last names.
  • More about: Name US Race

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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.
[{...}].lastNameStringOptionalLast name, family name, surname.
[{...}].countryIso2StringOptionalCountry of residence, in ISO 3166-1 alpha-2 format.
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted names with their race.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].firstNameStringSubmitted first name.
[{...}].lastNameStringSubmitted last name.
[{...}].raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.
[{...}].raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
[{...}].probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Name US Race code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"85dd5f48-b9e1-4019-88ce-ccc7e56b763f","firstName":"Keith","lastName":"Haring","countryIso2":"US"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"85dd5f48-b9e1-4019-88ce-ccc7e56b763f\",\"firstName\":\"Keith\",\"lastName\":\"Haring\",\"countryIso2\":\"US\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race code sample for python:

import requests

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

payload = {
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}
  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race from a first name and/or a last name.
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/usRaceEthnicity/{firstName}/{lastName}
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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.
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
firstNameStringSubmitted first name.
lastNameStringSubmitted last name.
raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
scoreNumberHigher implies a more reliable result, score is not normalized.
raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Name US Race code sample for shell:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicity/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicity/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicity/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Full Name US Race

US race from full name , country code (optional).

Select a taxonomy :
For international names (non US resident) please choose 4 classes. Enumerators for the returned 'race' ethnicity. US race enumerators.
{
    "script": "LATIN",
    "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "name": "Keith Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 6.493299531249249,
    "raceEthnicitiesTop": [
        "W_NL", "B_NL", "A", "HL"
    ],
    "probabilityCalibrated": 0.7239234645232184,
    "probabilityAltCalibrated": 0.8814496032861949
}

Name US Race ZIP builds upon the basic Name US Race feature by incorporating ZIP code data to improve accuracy. It analyzes a first name and/or last name—optionally with a country of residence—to identify the most likely US race ethnicity. US race ethnicity refers to classifications defined by the United States Census Taxonomy.

  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race of up to 100 unsplit full names.
  • More about: Full Name US Race

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFullBatch
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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).
[{...}].countryIso2StringOptionalCountry of residence, in ISO 3166-1 alpha-2 format.
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted full names with their race.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].nameStringSubmitted full name.
[{...}].raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.
[{...}].raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
[{...}].probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Full Name US Race code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFullBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"85dd5f48-b9e1-4019-88ce-ccc7e56b763f","name":"Keith Haring","countryIso2":"US"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "name": "Keith Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 6.493299531249249,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.7239234645232184,
            "probabilityAltCalibrated": 0.8814496032861949
        }
    ]
}

Full Name US Race code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFullBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"85dd5f48-b9e1-4019-88ce-ccc7e56b763f\",\"name\":\"Keith Haring\",\"countryIso2\":\"US\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "name": "Keith Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 6.493299531249249,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.7239234645232184,
            "probabilityAltCalibrated": 0.8814496032861949
        }
    ]
}

Full Name US Race code sample for python:

import requests

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

payload = {
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "name": "Keith Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 6.493299531249249,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.7239234645232184,
            "probabilityAltCalibrated": 0.8814496032861949
        }
    ]
}

Full Name US Race code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFullBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
      "name": "Keith Haring",
      "countryIso2": "US"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
            "name": "Keith Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 6.493299531249249,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.7239234645232184,
            "probabilityAltCalibrated": 0.8814496032861949
        }
    ]
}
  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race from an unsplit full name.
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/usRaceEthnicityFull/{name}
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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.
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
nameStringSubmitted full name.
raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
scoreNumberHigher implies a more reliable result, score is not normalized.
raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Full Name US Race code sample for shell:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "name": "Keith Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 6.493299531249249,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.7239234645232184,
    "probabilityAltCalibrated": 0.8814496032861949
}

Full Name US Race code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFull/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "name": "Keith Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 6.493299531249249,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.7239234645232184,
    "probabilityAltCalibrated": 0.8814496032861949
}

Full Name US Race code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFull/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "name": "Keith Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 6.493299531249249,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.7239234645232184,
    "probabilityAltCalibrated": 0.8814496032861949
}

Full Name US Race code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityFull/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": "85dd5f48-b9e1-4019-88ce-ccc7e56b763f",
    "name": "Keith Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 6.493299531249249,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.7239234645232184,
    "probabilityAltCalibrated": 0.8814496032861949
}

Name US Race ZIP

US race from first name (optional), last name (optional), country code (optional), 5 digit zip code .

Select a taxonomy :
For international names (non US resident) please choose 4 classes. Enumerators for the returned 'race' ethnicity. US race enumerators.
{
    "script": "LATIN",
    "id": "728767f9-c5b2-4ed3-a071-828077f16552",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": [
        "W_NL", "B_NL", "A", "HL"
    ],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Full Name US Race analyzes an unsplit full name (first and last name combined) to determine the most likely US race ethnicity. US race ethnicity refers to classifications defined by the United States Census Taxonomy.

information

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

  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race of up to 100 first names and/or last names using their ZIP code.
  • More about: Name US Race ZIP

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/usZipRaceEthnicityBatch
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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 and postal code.
[{...}].idStringOptionalUnique identifier.
[{...}].firstNameStringOptionalFirst name, given name, nickname.
[{...}].lastNameStringOptionalLast name, family name, surname.
[{...}].countryIso2StringOptionalCountry of residence, in ISO 3166-1 alpha-2 format.
[{...}].zipCodeStringRequiredPostal code (5-digit) of residence used by the United States Postal Service (USPS).
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted names with their race.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].firstNameStringSubmitted first name.
[{...}].lastNameStringSubmitted last name.
[{...}].raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.
[{...}].raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
[{...}].probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
[{...}].probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Name US Race ZIP code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/usZipRaceEthnicityBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"728767f9-c5b2-4ed3-a071-828077f16552","firstName":"Keith","lastName":"Haring","countryIso2":"US","zipCode":"10019"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "728767f9-c5b2-4ed3-a071-828077f16552",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race ZIP code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/usZipRaceEthnicityBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"728767f9-c5b2-4ed3-a071-828077f16552\",\"firstName\":\"Keith\",\"lastName\":\"Haring\",\"countryIso2\":\"US\",\"zipCode\":\"10019\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "728767f9-c5b2-4ed3-a071-828077f16552",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race ZIP code sample for python:

import requests

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

payload = {
  "personalNames": [
    {
      "id": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
}
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": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "728767f9-c5b2-4ed3-a071-828077f16552",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}

Name US Race ZIP code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usZipRaceEthnicityBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
})
});

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": "728767f9-c5b2-4ed3-a071-828077f16552",
      "firstName": "Keith",
      "lastName": "Haring",
      "countryIso2": "US",
      "zipCode": "10019"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "728767f9-c5b2-4ed3-a071-828077f16552",
            "firstName": "Keith",
            "lastName": "Haring",
            "raceEthnicityAlt": "B_NL",
            "raceEthnicity": "W_NL",
            "score": 3.9546190943560813,
            "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
            "probabilityCalibrated": 0.619185913005526,
            "probabilityAltCalibrated": 0.7534347105665851
        }
    ]
}
  • Precision:Precision gauge
  • Cost: 10 credits per name.
  • Description: Returns the most likely US race from a first name and/or a last name using their ZIP code.
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/usRaceEthnicityZIP5/{firstName}/{lastName}/{zipCode}
Request header
PropertyValuesRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
X-OPTION-USRACEETHNICITY-TAXONOMYUSRACEETHNICITY-6CLASSESOptionalEnumerators for the returned 'race' ethnicity.
Do not specify the property of the http request to obtain 4 classes W_NL, HL, A, B_NL. USRACEETHNICITY-6CLASSES will return 6 classes W_NL, HL, A, B_NL, AI_AN, PI.
For international names (non US resident) please choose 4 classes.
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.
zipCodeStringRequiredPostal code (5-digit) of residence used by the United States Postal Service (USPS).
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
firstNameStringSubmitted first name.
lastNameStringSubmitted last name.
raceEthnicityAltStringSecond most likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
raceEthnicityStringMost likely race (US race categorization from US Census Taxonomy).U.S. race ethnicities
scoreNumberHigher implies a more reliable result, score is not normalized.
raceEthnicitiesTopArrayMost likely race, sorted from most likely to least likely (US race categorization from US Census Taxonomy).U.S. race ethnicities
probabilityCalibratedNumberThe calibrated probability that raceEthnicity has been guessed correctly. -1 = still calibrating.
probabilityAltCalibratedNumberThe calibrated probability that raceEthnicity OR raceEthnicityAlt have been guessed correctly. -1 = still calibrating.

Code sample:

Name US Race ZIP code sample for shell:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "728767f9-c5b2-4ed3-a071-828077f16552",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race ZIP code sample for java:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "728767f9-c5b2-4ed3-a071-828077f16552",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race ZIP code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityZIP5/Keith/Haring/10019"

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": "728767f9-c5b2-4ed3-a071-828077f16552",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}

Name US Race ZIP code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityZIP5/Keith/Haring/10019", {
  "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": "728767f9-c5b2-4ed3-a071-828077f16552",
    "firstName": "Keith",
    "lastName": "Haring",
    "raceEthnicityAlt": "B_NL",
    "raceEthnicity": "W_NL",
    "score": 3.9546190943560813,
    "raceEthnicitiesTop": ["W_NL", "B_NL", "A", "HL"],
    "probabilityCalibrated": 0.619185913005526,
    "probabilityAltCalibrated": 0.7534347105665851
}