Skip to main content

Ethnicity by Name API

Predict ethnicity signals from a first and last name.

Base URL

https://api.genderrecognition.com

Endpoint

POST /v1/voice-gender-recognition/api/ethnicity

Headers

apiKey: YOUR_API_KEY
Content-Type: application/json

Body

{
"firstName": "Alex",
"lastName": "Morgan"
}

Example

curl -X POST "https://api.genderrecognition.com/v1/voice-gender-recognition/api/ethnicity" \
-H "Content-Type: application/json" \
-H "apiKey: YOUR_API_KEY" \
-d '{
"firstName": "Alex",
"lastName": "Morgan"
}'

Response

{
"success": true,
"name": "Alex Morgan",
"ethnicity": "English",
"confidence": 0.74,
"remainingRequests": 2999
}

Error cases

Missing API key

{
"error": "API key is required"
}

Invalid API key

{
"error": "Invalid API key"
}

Missing first name

{
"error": "First name is required"
}

Missing last name

{
"error": "Last name is required"
}

Name value too long

{
"error": "First name must not exceed 50 characters"
}

Missing JSON content type

{
"error": "Content-Type header is required. Please set Content-Type: application/json"
}

Unsupported JSON content type

{
"error": "Content-Type must be application/json"
}

Quota exceeded

{
"error": "Insufficient remaining requests"
}

Processing failed

{
"error": "Internal server error"
}