Origin API – Determine a country of origin from names
Namsor's Origin API identifies the country of origin associated with any personal name. The API accepts various input formats: first and last name separately, or a single full name string. This makes it easy to integrate into any workflow, regardless of how your data is structured.
For multicultural countries like the United States, Canada, Australia, France, Belgium, United Kingdom, Germany, Brazil, New Zealand, Switzerland, Netherlands, South Africa, etc., the Name Diaspora feature often yields more accurate insights by accounting for complex cultural backgrounds.
Designed for precision and scale, our API is trusted by researchers, analysts, and global institutions. With the largest onomastic database in the world, Namsor delivers unmatched accuracy in name origin detection.
600+Research contributions
99.99%Names availability
11B billionsNames processed
Name Origin
Origin from first name (optional), last name (optional).
{
"script": "LATIN",
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"firstName": "Keith",
"lastName": "Haring",
"countryOrigin": "GB",
"countryOriginAlt": "IE",
"countriesOriginTop": [
"GB", "IE", "DE", "NL", "EE", "SE", "DK", "MY", "ID", "KH"
],
"score": 10.255274142073363,
"regionOrigin": "Europe",
"topRegionOrigin": "Europe",
"subRegionOrigin": "Northern Europe",
"probabilityCalibrated": 0.7724670883776785,
"probabilityAltCalibrated": 0.8719112661893521
}
Name Origin analyzes a first name and/or last name to determine the most likely country of origin. This feature offers slightly higher accuracy than Full Name Origin, especially when both the first and last names are provided. The response includes the region of origin, the most likely country of origin, and a ranked list of the top 10 possible countries, each with a calibrated probability.

In multicultural countries (e.g. the United States, Canada, Australia, New Zealand), the Name Diaspora feature may provide a more relevant classification or improved accuracy.
- Precision:
- Cost: 10 credits per name.
- Description: Returns the most likely country of origin of up to 100 first names and/or last names.
- More about: Name Origin
HTTP request

https://v2.namsor.com/NamSorAPIv2/api2/json/originBatch
Property | Values | Required | Description |
---|---|---|---|
X-API-KEY | Required | Your Namsor's services API key | |
X-OPTION-RELIGION-STATS | True | Optional | Returns religious statistics for countries of origin. By default the feature is disabled. Add to the Header of the request the parameter X-OPTION-RELIGION-STATS on True to activate it. |

To get an API key for free, please create an account.
Name | Type | Required | Description |
---|---|---|---|
personalNames | Array of objects | Required | A list of personal names. |
[{...}].id | String | Optional | Unique identifier. |
[{...}].firstName | String | Optional | First name, given name, nickname. |
[{...}].lastName | String | Optional | Last name, family name, surname. |
Name | Type | Description | Enumerators |
---|---|---|---|
personalNames | Array of objects | List of submitted names with their countries of origin. | |
[{...}].script | String | Name of the script used for the name, in ISO 15924 format. | Script |
[{...}].id | String | Provided unique identifier. | |
[{...}].firstName | String | Submitted first name, given name or nickname. | |
[{...}].lastName | String | Submitted last name, family name or surname. | |
[{...}].countryOrigin | String | Most likely country of origin, in ISO 3166-1 alpha-2 format. | Country of origin |
[{...}].countryOriginAlt | String | Second most likely country of origin, in ISO 3166-1 alpha-2 format. | Country of origin |
[{...}].countriesOriginTop | Array | Top 10 most likely countries of origin, in ISO 3166-1 alpha-2 format, sorted from most likely to least likely. | Country of origin |
[{...}].score | Number | Higher implies a more reliable result, score is not normalized. | |
[{...}].regionOrigin | String | Most likely region of origin. | Regions of origin or residence |
[{...}].topRegionOrigin | String | Most likely region of origin (alternative classification). | Regions of origin or residence |
[{...}].subRegionOrigin | String | Most likely sub-region of origin. | Sub regions of origin or residence |
[{...}].probabilityCalibrated | Number | The calibrated probability that countryOrigin has been guessed correctly. -1 = still calibrating. | |
[{...}].probabilityAltCalibrated | Number | The calibrated probability that countryOrigin OR countryOriginAlt have been guessed correctly. -1 = still calibrating. | |
Optional: X-OPTION-RELIGION-STATS = True | |||
[{...}].religionStats | Array of objects | Religious statistics for the most likely country of origin. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True). | |
[{...}].religion | String | Religion in most likely country of origin (countryOrigin). | Religions |
[{...}].pct | Number | Percentage of population practicing this religion in most likely country of origin (countryOrigin). | |
[{...}].religionStatsAlt | Array of objects | Religious statistics for the second most likely country of origin. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True). | |
[{...}].religion | String | Religion in second most likely country of origin (countryOriginAlt). | Religions |
[{...}].pct | Number | Percentage of population practicing this religion in second most likely country of origin (countryOriginAlt). |
Code sample:
Name Origin code sample for shell:
curl --request POST \
--url https://v2.namsor.com/NamSorAPIv2/api2/json/originBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"e630dda5-13b3-42c5-8f1d-648aa8a21c42","firstName":"Keith","lastName":"Haring"}]}'
Body parameter:
{
"personalNames": [
{
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"firstName": "Keith",
"lastName": "Haring"
}
]
}
The above command returns JSON structured like this:
{
"personalNames": [
{
"script": "LATIN",
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"firstName": "Keith",
"lastName": "Haring",
"countryOrigin": "GB",
"countryOriginAlt": "IE",
"countriesOriginTop": ["GB", "IE", "DE", "NL", "EE", "SE", "DK", "MY", "ID", "KH"],
"score": 10.255274142073363,
"regionOrigin": "Europe",
"topRegionOrigin": "Europe",
"subRegionOrigin": "Northern Europe",
"probabilityCalibrated": 0.7724670883776785,
"probabilityAltCalibrated": 0.8719112661893521
}
]
}
Values returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.
{
religionStats: [
{ religion: 'Christian', pct: 85.24262131 },
{ religion: 'Unaffiliated', pct: 14.20710355 },
{ religion: 'Other', pct: 0.300150075 },
{ religion: 'Buddhist', pct: 0.050025013 },
{ religion: 'Folk', pct: 0.050025013 },
{ religion: 'Hindu', pct: 0.050025013 },
{ religion: 'Jewish', pct: 0.050025013 },
{ religion: 'Muslim', pct: 0.050025013 },
],
religionStatsAlt: [
{ religion: 'Christian', pct: 88.97427291753932 },
{ religion: 'Unaffiliated', pct: 9.78531187532157 },
{ religion: 'Muslim', pct: 0.6298564872835054 },
{ religion: 'Other', pct: 0.16200879680269425 },
{ religion: 'Buddhist', pct: 0.13284624102403442 },
{ religion: 'Folk', pct: 0.13284624102403442 },
{ religion: 'Hindu', pct: 0.13284624102403442 },
{ religion: 'Jewish', pct: 0.050011199980789234 },
],
}
Full Name Origin
Origin from full name .
{
"script": "LATIN",
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"name": "Keith Haring",
"countryOrigin": "GB",
"countryOriginAlt": "IE",
"countriesOriginTop": [
"GB", "IE", "DE", "NL", "DK", "SE", "CH", "EE", "MY", "HK"
],
"score": 11.240061482140302,
"regionOrigin": "Europe",
"topRegionOrigin": "Europe",
"subRegionOrigin": "Northern Europe",
"probabilityCalibrated": 0.8369777938445658,
"probabilityAltCalibrated": 0.9297055536113793
}
Full Name Origin analyzes an unsplit full name (first and last name combined) to identify the most likely country of origin. The response includes the region of origin, the most likely country of origin, and a ranked list of the top 10 possible countries, each with a calibrated probability.

In multicultural countries (e.g. the United States, Canada, Australia, New Zealand), the Full Name Diaspora feature may provide a more relevant classification or improved accuracy.
- Precision:
- Cost: 10 credits per name.
- Description: Returns the most likely country of origin of up to 100 unsplit full names.
- More about: Full Name Origin
HTTP request

https://v2.namsor.com/NamSorAPIv2/api2/json/originFullBatch
Property | Values | Required | Description |
---|---|---|---|
X-API-KEY | Required | Your Namsor's services API key | |
X-OPTION-RELIGION-STATS | True | Optional | Returns religious statistics for countries of origin. By default the feature is disabled. Add to the Header of the request the parameter X-OPTION-RELIGION-STATS on True to activate it. |

To get an API key for free, please create an account.
Name | Type | Required | Description |
---|---|---|---|
personalNames | Array of objects | Required | A list of personal names. |
[{...}].id | String | Optional | Unique identifier. |
[{...}].name | String | Required | Unsplit full name (first name and last name). |
Name | Type | Description | Enumerators |
---|---|---|---|
personalNames | Array of objects | List of submitted full names with their countries of origin. | |
[{...}].script | String | Name of the script used for the name, in ISO 15924 format. | Script |
[{...}].id | String | Provided unique identifier. | |
[{...}].name | String | Submitted full name. | |
[{...}].countryOrigin | String | Most likely country of origin, in ISO 3166-1 alpha-2 format. | Country of origin |
[{...}].countryOriginAlt | String | Second most likely country of origin, in ISO 3166-1 alpha-2 format. | Country of origin |
[{...}].countriesOriginTop | Array | Top 10 most likely countries of origin, in ISO 3166-1 alpha-2 format, sorted from most likely to least likely. | Country of origin |
[{...}].score | Number | Higher implies a more reliable result, score is not normalized. | |
[{...}].regionOrigin | String | Most likely region of origin. | Regions of origin or residence |
[{...}].topRegionOrigin | String | Most likely region of origin (alternative classification). | Regions of origin or residence |
[{...}].subRegionOrigin | String | Most likely sub-region of origin. | Sub regions of origin or residence |
[{...}].probabilityCalibrated | Number | The calibrated probability that countryOrigin has been guessed correctly. -1 = still calibrating. | |
[{...}].probabilityAltCalibrated | Number | The calibrated probability that countryOrigin OR countryOriginAlt have been guessed correctly. -1 = still calibrating. | |
Optional: X-OPTION-RELIGION-STATS = True | |||
[{...}].religionStats | Array of objects | Religious statistics for the most likely country of origin. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True). | |
[{...}].religion | String | Religion in most likely country of origin (countryOrigin). | Religions |
[{...}].pct | Number | Percentage of population practicing this religion in most likely country of origin (countryOrigin). | |
[{...}].religionStatsAlt | Array of objects | Religious statistics for the second most likely country of origin. Returned only if the religious statistics option is enabled (X-OPTION-RELIGION-STATS: True). | |
[{...}].religion | String | Religion in second most likely country of origin (countryOriginAlt). | Religions |
[{...}].pct | Number | Percentage of population practicing this religion in second most likely country of origin (countryOriginAlt). |
Code sample:
Full Name Origin code sample for shell:
curl --request POST \
--url https://v2.namsor.com/NamSorAPIv2/api2/json/originFullBatch \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'
--header 'Content-Type: application/json' \
--data '{"personalNames":[{"id":"e630dda5-13b3-42c5-8f1d-648aa8a21c42","name":"Keith Haring"}]}'
Body parameter:
{
"personalNames": [
{
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"name": "Keith Haring"
}
]
}
The above command returns JSON structured like this:
{
"personalNames": [
{
"script": "LATIN",
"id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
"name": "Keith Haring",
"countryOrigin": "GB",
"countryOriginAlt": "IE",
"countriesOriginTop": ["GB", "IE", "DE", "NL", "DK", "SE", "CH", "EE", "MY", "HK"],
"score": 11.240061482140302,
"regionOrigin": "Europe",
"topRegionOrigin": "Europe",
"subRegionOrigin": "Northern Europe",
"probabilityCalibrated": 0.8369777938445658,
"probabilityAltCalibrated": 0.9297055536113793
}
]
}
Values returned only if the religious statistics option is enabled X-OPTION-RELIGION-STATS: True.
{
religionStats: [
{ religion: 'Christian', pct: 85.24262131 },
{ religion: 'Unaffiliated', pct: 14.20710355 },
{ religion: 'Other', pct: 0.300150075 },
{ religion: 'Buddhist', pct: 0.050025013 },
{ religion: 'Folk', pct: 0.050025013 },
{ religion: 'Hindu', pct: 0.050025013 },
{ religion: 'Jewish', pct: 0.050025013 },
{ religion: 'Muslim', pct: 0.050025013 },
],
religionStatsAlt: [
{ religion: 'Christian', pct: 88.97427291753932 },
{ religion: 'Unaffiliated', pct: 9.78531187532157 },
{ religion: 'Muslim', pct: 0.6298564872835054 },
{ religion: 'Other', pct: 0.16200879680269425 },
{ religion: 'Buddhist', pct: 0.13284624102403442 },
{ religion: 'Folk', pct: 0.13284624102403442 },
{ religion: 'Hindu', pct: 0.13284624102403442 },
{ religion: 'Jewish', pct: 0.050011199980789234 },
],
}