Namsor

Split API – Split a name into first and last names

Namsor's Split Name API accurately separates a full name into its first name and last name components. Whether you provide a combined full name or separate first and last names, our API adapts seamlessly to your data format, ensuring smooth integration into your systems.


Providing a country of residence can further improve the precision, especially for names from cultures where name order varies. This functionality is invaluable for applications in data normalization, user profiling, and cross-cultural research.

Split Name

Split name from full name .

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "John Smith",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": null,
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "John",
        "lastName": "Smith"
    },
    "score": 23.31368511252333
}

Split Name analyzes an unsplit full name to accurately identify and separate the first name and last name.

  • Precision:Precision gauge
  • Cost: 1 credit per name.
  • Description: Returns the most likely first name and last name structure of up to 100 full names.
  • More about: Split Name

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch
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 unsplit full names.
[{...}].idStringOptionalUnique identifier.
[{...}].nameStringRequiredFull name (first name and last name).
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted names separated into first name and last name structure.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].nameStringSubmitted full name.
[{...}].nameParserTypeStringMost likely structure of the name.Name structures
[{...}].nameParserTypeAltStringSecond most likely structure of the name.Name structures
[{...}].firstLastNameObjectSplit name.
{...}.scriptStringName of the script used for the name, in ISO 15924 format.Script
{...}.idStringProvided unique identifier.
{...}.firstNameStringFirst name (or given name).
{...}.lastNameStringLast name (or family name).
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.

Code sample:

Split Name code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch \
--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":"John Smith"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "John Smith",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": null,
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "John",
                "lastName": "Smith"
            },
            "score": 23.31368511252333
        }
    ]
}

Split Name code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"e630dda5-13b3-42c5-8f1d-648aa8a21c42\",\"name\":\"John Smith\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "John Smith",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": null,
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "John",
                "lastName": "Smith"
            },
            "score": 23.31368511252333
        }
    ]
}

Split Name code sample for python:

import requests

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

payload = {
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
}
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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "John Smith",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": null,
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "John",
                "lastName": "Smith"
            },
            "score": 23.31368511252333
        }
    ]
}

Split Name code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
})
});

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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "John Smith"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "John Smith",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": null,
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "John",
                "lastName": "Smith"
            },
            "score": 23.31368511252333
        }
    ]
}
  • Precision:Precision gauge
  • Cost: 1 credit per name.
  • Description: Returns the most likely first name and last name structure of a 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/parseName/{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
nameStringRequiredFull name (first name and last name).
Response
NameTypeDescriptionEnumerators
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
nameStringSubmitted full name.
nameParserTypeStringMost likely structure of the name.Name structures
nameParserTypeAltStringSecond most likely structure of the name.Name structures
firstLastNameObjectSplit name.
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
firstNameStringFirst name (or given name).
lastNameStringLast name (or family name).
scoreNumberHigher implies a more reliable result, score is not normalized.

Code sample:

Split Name code sample for shell:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "John Smith",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": null,
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "John",
        "lastName": "Smith"
    },
    "score": 23.31368511252333
}

Split Name code sample for java:

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

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "John Smith",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": null,
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "John",
        "lastName": "Smith"
    },
    "score": 23.31368511252333
}

Split Name code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/John%20Smith"

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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "John Smith",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": null,
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "John",
        "lastName": "Smith"
    },
    "score": 23.31368511252333
}

Split Name code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/John%20Smith", {
  "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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "John Smith",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": null,
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "John",
        "lastName": "Smith"
    },
    "score": 23.31368511252333
}

Split Name Geo

Split name from full name , country code .

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "Ricardo Darín",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": "FN1LN2",
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "Ricardo",
        "lastName": "Darín"
    },
    "score": 3.447624982163207
}

Split Name Geo enhances the basic Split Name feature by incorporating a country of residence into the analysis. This contextual information improves the accuracy of identifying the first name and last name from an unsplit full name.

  • Precision:Precision gauge
  • Cost: 1 credit per name.
  • Description: Returns the most likely first name and last name structure of up to 100 full names using their geographic context.
  • More about: Split Name Geo

HTTP request

http request
POST
https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameGeoBatch
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 unsplit full names with their country of residence.
[{...}].idStringOptionalUnique identifier.
[{...}].nameStringRequiredFull name (first name and last name).
[{...}].countryIso2StringRequiredMost likely country of origin, in ISO 3166-1 alpha-2 format.
Response
NameTypeDescriptionEnumerators
personalNamesArray of objectsList of submitted names separated into first name and last name structure.
[{...}].scriptStringName of the script used for the name, in ISO 15924 format.Script
[{...}].idStringProvided unique identifier.
[{...}].nameStringSubmitted full name.
[{...}].nameParserTypeStringMost likely structure of the name.Name structures
[{...}].nameParserTypeAltStringSecond most likely structure of the name.Name structures
[{...}].firstLastNameObjectSplit name.
{...}.scriptStringName of the script used for the name, in ISO 15924 format.Script
{...}.idStringProvided unique identifier.
{...}.firstNameStringFirst name (or given name).
{...}.lastNameStringLast name (or family name).
[{...}].scoreNumberHigher implies a more reliable result, score is not normalized.

Code sample:

Split Name Geo code sample for shell:

curl --request POST \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameGeoBatch \
--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":"Ricardo Darín","countryIso2":"AR"}]}'

Body parameter:

{
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "Ricardo Darín",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": "FN1LN2",
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "Ricardo",
                "lastName": "Darín"
            },
            "score": 3.447624982163207
        }
    ]
}

Split Name Geo code sample for java:

HttpResponse<String> response = Unirest.post("https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameGeoBatch")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body("{\"personalNames\":[{\"id\":\"e630dda5-13b3-42c5-8f1d-648aa8a21c42\",\"name\":\"Ricardo Darín\",\"countryIso2\":\"AR\"}]}")
.asString();

Body parameter:

{
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "Ricardo Darín",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": "FN1LN2",
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "Ricardo",
                "lastName": "Darín"
            },
            "score": 3.447624982163207
        }
    ]
}

Split Name Geo code sample for python:

import requests

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

payload = {
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
}
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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "Ricardo Darín",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": "FN1LN2",
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "Ricardo",
                "lastName": "Darín"
            },
            "score": 3.447624982163207
        }
    ]
}

Split Name Geo code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameGeoBatch", {
  "method": "POST",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json",
    "Content-Type": "application/json"
  },
  "body": JSON.stringify({
  "personalNames": [
    {
      "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
})
});

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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
      "name": "Ricardo Darín",
      "countryIso2": "AR"
    }
  ]
}

The above command returns JSON structured like this:

{
    "personalNames": [
        {
            "script": "LATIN",
            "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
            "name": "Ricardo Darín",
            "nameParserType": "FN1LN1",
            "nameParserTypeAlt": "FN1LN2",
            "firstLastName": {
                "script": null,
                "id": null,
                "firstName": "Ricardo",
                "lastName": "Darín"
            },
            "score": 3.447624982163207
        }
    ]
}
  • Precision:Precision gauge
  • Cost: 1 credit per name.
  • Description: Returns the most likely first name and last name structure of a full name using its geographic context.
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/parseName/{name}/{countryIso2}
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
nameStringRequiredFull name (first name and last name).
countryIso2StringRequiredMost likely country of origin, 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.
nameParserTypeStringMost likely structure of the name.Name structures
nameParserTypeAltStringSecond most likely structure of the name.Name structures
firstLastNameObjectSplit name.
scriptStringName of the script used for the name, in ISO 15924 format.Script
idStringProvided unique identifier.
firstNameStringFirst name (or given name).
lastNameStringLast name (or family name).
scoreNumberHigher implies a more reliable result, score is not normalized.

Code sample:

Split Name Geo code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/Ricardo%20Darín/AR \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "Ricardo Darín",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": "FN1LN2",
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "Ricardo",
        "lastName": "Darín"
    },
    "score": 3.447624982163207
}

Split Name Geo code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/Ricardo%20Darín/AR")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "script": "LATIN",
    "id": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "Ricardo Darín",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": "FN1LN2",
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "Ricardo",
        "lastName": "Darín"
    },
    "score": 3.447624982163207
}

Split Name Geo code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/Ricardo%20Darín/AR"

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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "Ricardo Darín",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": "FN1LN2",
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "Ricardo",
        "lastName": "Darín"
    },
    "score": 3.447624982163207
}

Split Name Geo code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/Ricardo%20Darín/AR", {
  "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": "e630dda5-13b3-42c5-8f1d-648aa8a21c42",
    "name": "Ricardo Darín",
    "nameParserType": "FN1LN1",
    "nameParserTypeAlt": "FN1LN2",
    "firstLastName": {
        "script": null,
        "id": null,
        "firstName": "Ricardo",
        "lastName": "Darín"
    },
    "score": 3.447624982163207
}