---
title: "[USES 20 UNITS PER NAME] Infer the likely ethnicity/diaspora of a personal name, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.)"
method: GET
path: "/api2/json/diaspora/{countryIso2}/{firstName}/{lastName}"
tags: ["personal"]
---

# \[USES 20 UNITS PER NAME\] Infer the likely ethnicity/diaspora of a personal name, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.)

`GET /api2/json/diaspora/{countryIso2}/{firstName}/{lastName}`

## Request

- Base URL: `https://v2.namsor.com/NamSorAPIv2`
- URL: `https://v2.namsor.com/NamSorAPIv2/api2/json/diaspora/{countryIso2}/{firstName}/{lastName}`
- Auth: API key in header `X-API-KEY`

## Path parameters

- `countryIso2` string, required
- `firstName` string, required
- `lastName` string, required

## Response `200`

A diaspora / ethnicity for given name and geography.

- FirstLastNameDiasporaedOut: Represents the output of inferring the LIKELY ethnicity from a personal name, given an country of residence.
  - `script` string
  - `id` string
  - `explanation` string
  - `firstName` string: The first name (also known as given name)
  - `lastName` string: The last name (also known as family name, or surname)
  - `score` number, double: Compatibility to NamSor_v1 Diaspora score value. Higher score is better, but score is not normalized. Use calibratedProbability if available.
  - `ethnicityAlt` string: The second best alternative ethnicity
  - `ethnicity` string: The most likely ethnicity
  - `lifted` boolean: Indicates if the output ethnicity is based on machine learning only, or further lifted as a known fact by a country-specific rule. Let us know if you believe ethnicity is incorrect on a specific case where lifted is true.
  - `countryIso2` string: From input data, the countryIso2 of geographic context (US,CA etc.)
  - `ethnicitiesTop` string[]: List most likely ethnicities (top 10)
  - `probabilityCalibrated` number, double: The calibrated probability for ethnicity to have been guessed correctly. -1 = still calibrating.
  - `probabilityAltCalibrated` number, double: The calibrated probability for ethnicity OR ethnicityAlt to have been guessed correctly. -1 = still calibrating.
  - `religionStats` ReligionStatOut[]: Geographic religious statistics, assuming ethnicity is correctly predicted.
    - `religion` string
    - `pct` number, double
  - `religionStatsAlt` ReligionStatOut[]: Geographic religious statistics, for country best alternative.
    - `religion` string
    - `pct` number, double

## Other responses

- `401`: Missing or incorrect API Key
- `403`: Email not Verified, or API Limit Reached, or API Key Disabled
- `429`: Too Many Requests

## Changes

- **2025-05-16** `6297d39b756d`: 4 info
  - added the non-success response with the status `429`
  - added the optional property `explanation` to the response with the `200` status
  - added the optional property `religionStats` to the response with the `200` status
  - added the optional property `religionStatsAlt` to the response with the `200` status
- **2022-08-19** `c084be2dba5a`: 2 info
  - added the optional property `probabilityAltCalibrated` to the response with the `200` status
  - added the optional property `probabilityCalibrated` to the response with the `200` status

[Operation history](https://skmtc.dev/namsor/apis/namsor-api-v2/changes/api2/json/diaspora/:countryIso2/:firstName/:lastName/get.md)

---

[API](https://skmtc.dev/namsor/apis/namsor-api-v2.md) - [All operations](https://skmtc.dev/namsor/apis/namsor-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/namsor/apis/namsor-api-v2/revisions/305e4f6eeaf5?raw)
