> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Namsor

> Name-classification ML API that infers demographic signals from personal names — gender, country of origin, country of residence, ethnicity/diaspora, US race, Indian caste/religion, plus name parsing, name-type detection, and phone formatting.

Name-classification ML API that infers demographic signals from personal names — gender, country of origin, country of residence, ethnicity/diaspora, US race, Indian caste/religion, plus name parsing, name-type detection, and phone formatting. Best for enriching contact lists and demographic analytics when only a name is known. Unlike profile-enrichment APIs (People Data Labs, Apollo) that look up records, Namsor predicts attributes purely from the linguistic structure of the name, in any alphabet.

31 endpoints available through Lava's AI Gateway. See the [Namsor API docs](https://namsor.app/api-documentation/introduction/) for full documentation.

<Info>Supports both **managed** (Lava's API keys) and **unmanaged** (bring your own credentials) mode.</Info>

## Endpoints

### Infer likely gender from a personal name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/gender/John/Smith` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/gender/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2Fgender%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Infer likely gender from a personal name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/genderBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/genderBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FgenderBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"John","lastName":"Smith"}]}'
    ```
  </Tab>
</Tabs>

### Process Chinese names — gender, pinyin romanization, parsing, and romanized↔character matching — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/genderChineseNamePinyin/Wang/Xiaoming` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/genderChineseNamePinyin/Wang/Xiaoming', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FgenderChineseNamePinyin%2FWang%2FXiaoming" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Process Chinese names — gender, pinyin romanization, parsing, and romanized↔character matching — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/parseChineseNameBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/parseChineseNameBatch', { body: {"personalNames":[{"id":"1","name":"王小明"}]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FparseChineseNameBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","name":"王小明"}]}'
    ```
  </Tab>
</Tabs>

### Process Japanese names — gender, kanji↔romaji candidates, parsing, and matching — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/genderJapaneseName/Yamada/Taro` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/genderJapaneseName/Yamada/Taro', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FgenderJapaneseName%2FYamada%2FTaro" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Process Japanese names — gender, kanji↔romaji candidates, parsing, and matching — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/parseJapaneseNameBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/parseJapaneseNameBatch', { body: {"personalNames":[{"id":"1","name":"山田太郎"}]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FparseJapaneseNameBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","name":"山田太郎"}]}'
    ```
  </Tab>
</Tabs>

### Classify a proper noun as a personal name vs. a brand/place/other entity — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/nameType/Apple` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/nameType/Apple', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FnameType%2FApple" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Classify a proper noun as a personal name vs. a brand/place/other entity — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/nameTypeBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/nameTypeBatch', { body: {"properNouns":[{"id":"1","name":"Apple"}]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FnameTypeBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"properNouns":[{"id":"1","name":"Apple"}]}'
    ```
  </Tab>
</Tabs>

### Split a full name into first and last name components — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/John%20Smith` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/parseName/John%20Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FparseName%2FJohn%2520Smith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Split a full name into first and last name components — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/parseNameBatch', { body: {"personalNames":[{"id":"1","name":"John Smith"}]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FparseNameBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","name":"John Smith"}]}'
    ```
  </Tab>
</Tabs>

### Match, search, and transliterate full names across scripts — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/compareFullBatch` — \$0.005 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/compareFullBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "name1": "John Smith",
        "name2": "Jon Smyth"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcompareFullBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","name1":"John Smith","name2":"Jon Smyth"}]}'
    ```
  </Tab>
</Tabs>

### Infer the most likely country of origin from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/origin/John/Smith` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/origin/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2Forigin%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Infer the most likely country of origin from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/originBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/originBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2ForiginBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"John","lastName":"Smith"}]}'
    ```
  </Tab>
</Tabs>

### Infer the most likely country of residence from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/countryFnLn/John/Smith` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/countryFnLn/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcountryFnLn%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Infer the most likely country of residence from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/countryBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/countryBatch', { body: {"personalNames":[{"id":"1","name":"John Smith"}]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcountryBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","name":"John Smith"}]}'
    ```
  </Tab>
</Tabs>

### Estimate US race/ethnicity (Census taxonomy) from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicity/John/Smith` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicity/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FusRaceEthnicity%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Estimate US race/ethnicity (Census taxonomy) from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/usRaceEthnicityBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith",
        "countryIso2": "US"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FusRaceEthnicityBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"John","lastName":"Smith","countryIso2":"US"}]}'
    ```
  </Tab>
</Tabs>

### Estimate Indian caste group from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/castegroupIndian/IN-DL/Anil/Sharma` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/castegroupIndian/IN-DL/Anil/Sharma', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcastegroupIndian%2FIN-DL%2FAnil%2FSharma" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Estimate Indian caste group from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/castegroupIndianBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/castegroupIndianBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "Anil",
        "lastName": "Sharma",
        "countryIso2": "IN",
        "subdivisionIso": "IN-DL"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcastegroupIndianBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"Anil","lastName":"Sharma","countryIso2":"IN","subdivisionIso":"IN-DL"}]}'
    ```
  </Tab>
</Tabs>

### Estimate likely religion from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/religionIndian/IN-DL/Anil/Sharma` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/religionIndian/IN-DL/Anil/Sharma', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FreligionIndian%2FIN-DL%2FAnil%2FSharma" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Estimate likely religion from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/religionBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/religionBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "Anil",
        "lastName": "Sharma",
        "countryIso2": "IN",
        "subdivisionIso": "IN-DL"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FreligionBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"Anil","lastName":"Sharma","countryIso2":"IN","subdivisionIso":"IN-DL"}]}'
    ```
  </Tab>
</Tabs>

### Fine-grained ethnicity subclassification from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/subclassificationIndian/Anil/Sharma` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/subclassificationIndian/Anil/Sharma', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FsubclassificationIndian%2FAnil%2FSharma" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Fine-grained ethnicity subclassification from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/subclassificationBatch` — \$0.05 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/subclassificationBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "Anil",
        "lastName": "Sharma",
        "countryIso2": "IN"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FsubclassificationBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"Anil","lastName":"Sharma","countryIso2":"IN"}]}'
    ```
  </Tab>
</Tabs>

### Validate and format a phone number, inferring country from the name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/phoneCode/John/Smith/2025550143` — \$0.055 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/phoneCode/John/Smith/2025550143', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FphoneCode%2FJohn%2FSmith%2F2025550143" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Validate and format a phone number, inferring country from the name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/phoneCodeBatch` — \$0.055 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/phoneCodeBatch', {
      body: {
    "personalNamesWithPhoneNumbers": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith",
        "phoneNumber": "2025550143"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FphoneCodeBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNamesWithPhoneNumbers":[{"id":"1","firstName":"John","lastName":"Smith","phoneNumber":"2025550143"}]}'
    ```
  </Tab>
</Tabs>

### Infer ethnicity/diaspora from a name given a country of residence — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/John/Smith` — \$0.10 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/US/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2Fdiaspora%2FUS%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Infer ethnicity/diaspora from a name given a country of residence — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch` — \$0.10 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/diasporaBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith",
        "countryIso2": "US"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FdiasporaBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"John","lastName":"Smith","countryIso2":"US"}]}'
    ```
  </Tab>
</Tabs>

### Diaspora-based community engagement segmentation from a name — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/communityEngage/US/John/Smith` — \$0.10 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/communityEngage/US/John/Smith', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcommunityEngage%2FUS%2FJohn%2FSmith" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Diaspora-based community engagement segmentation from a name — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/communityEngageBatch` — \$0.10 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/communityEngageBatch', {
      body: {
    "personalNames": [
      {
        "id": "1",
        "firstName": "John",
        "lastName": "Smith",
        "countryIso2": "US"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcommunityEngageBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"personalNames":[{"id":"1","firstName":"John","lastName":"Smith","countryIso2":"US"}]}'
    ```
  </Tab>
</Tabs>

### Analyze a name pair as a migration/transaction corridor (origin + destination) — single name.

**GET** `https://v2.namsor.com/NamSorAPIv2/api2/json/corridor/US/John/Smith/CN/Wei/Zhang` — \$0.25 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/corridor/US/John/Smith/CN/Wei/Zhang', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2Fcorridor%2FUS%2FJohn%2FSmith%2FCN%2FWei%2FZhang" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Analyze a name pair as a migration/transaction corridor (origin + destination) — batch (up to 100 names).

**POST** `https://v2.namsor.com/NamSorAPIv2/api2/json/corridorBatch` — \$0.25 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://v2.namsor.com/NamSorAPIv2/api2/json/corridorBatch', {
      body: {
    "corridorFromTo": [
      {
        "id": "1",
        "personalNameGeoFrom": {
          "firstName": "John",
          "lastName": "Smith",
          "countryIso2": "US"
        },
        "personalNameGeoTo": {
          "firstName": "Wei",
          "lastName": "Zhang",
          "countryIso2": "CN"
        }
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fv2.namsor.com%2FNamSorAPIv2%2Fapi2%2Fjson%2FcorridorBatch" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"corridorFromTo":[{"id":"1","personalNameGeoFrom":{"firstName":"John","lastName":"Smith","countryIso2":"US"},"personalNameGeoTo":{"firstName":"Wei","lastName":"Zhang","countryIso2":"CN"}}]}'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
