canonical: https://jentic.com/apis/namsor.com/namsor

# NamSor API v2

Jentic publishes the only available OpenAPI specification for NamSor API v2, keeping it validated and agent-ready. NamSor classifies personal names by likely gender, country of origin, country of residence, ethnicity, and US 'race' for diversity reporting and customer enrichment. The API works across alphabets and languages and exposes 114 endpoints covering single-name lookups, geo-aware variants, batch processing of up to 100 names per request, and admin endpoints for API key usage and feature toggles. Costs are metered in 'units' per name with simple operations using one unit and ethnicity classifiers using 10 to 20 units depending on the taxonomy.

## For AI agents

Classify a name's likely gender, country of origin, residence, and ethnicity across 100+ countries. Single-name and batch (up to 100) operations.

## Scope

Does not handle identity verification, fraud scoring, or PII discovery - use for name-based gender, origin, and ethnicity classification only.

## Capabilities

- Infer the likely gender of a first name or first+last name pair, with optional country context
- Predict the country of origin or country of residence from a personal name
- Classify a name's ethnicity using regional taxonomies (US race, UK, Brazilian, Asian)
- Detect whether a proper noun is a personal name, brand, or place to clean noisy contact data
- Process batches of up to 100 names per request to enrich large customer files efficiently
- Inspect remaining API key units and per-classifier cost via admin endpoints

## Use cases

### Diversity and Inclusion Reporting

Talent and HR teams use name-based ethnicity and gender inference to estimate workforce demographics where self-reporting is incomplete. NamSor's ethnicity endpoints return predicted classes and confidence scores using established US-race taxonomies, letting analytics platforms produce DE&I dashboards while flagging low-confidence predictions for manual review. Batch endpoints handle full applicant pools in a single call.

Example prompt: POST /api2/json/genderBatch with 100 employee first+last names and aggregate the predicted gender distribution by department.

### CRM Contact Enrichment

Sales and marketing platforms enrich contact records with predicted gender, country of origin, and country of residence to personalise outreach. NamSor's geo-aware endpoints accept an ISO country code alongside the name to disambiguate (for example 'Maria' in Spain vs Brazil), improving accuracy for international audiences. Batch processing keeps cost per record predictable.

Example prompt: POST /api2/json/originBatch with a list of leads and append the predicted country of origin to each CRM record.

### Data Cleaning for Inbound Forms

Forms and webhooks often capture noisy data where users enter brand names, places, or generic strings in name fields. The /api2/json/nameType endpoint classifies a proper noun as 'personalName', 'brandName', or 'place' so downstream systems can route or reject the record. This prevents downstream enrichment calls from wasting units on invalid inputs.

Example prompt: Call GET /api2/json/nameType/{properNoun} for each new lead and reject any record where the response is 'brandName' or 'place'.

### AI Agent Name Intelligence

An AI assistant invoked through Jentic enriches contact data on demand by searching for a NamSor operation, loading its schema, and executing it with the contact's name. Jentic stores the X-API-KEY in its vault and exposes only a scoped token, so the agent can call gender, origin, and ethnicity endpoints without ever seeing the raw API key, simplifying compliance for customer-data workflows.

Example prompt: Search Jentic for 'predict gender from name', load POST /api2/json/genderBatch, and execute it with a 50-name batch from the CRM segmentation job.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /api2/json/gender/{firstName}/{lastName} | Infer the likely gender of a first+last name pair |
| POST | /api2/json/genderBatch | Batch gender classification for up to 100 names |
| GET | /api2/json/origin/{firstName}/{lastName} | Predict the likely country of origin (10 units) |
| GET | /api2/json/country/{personalNameFull} | Predict the likely country of residence (10 units) |
| POST | /api2/json/corridorBatch | Batch corridor classifications for migration analysis |
| GET | /api2/json/nameType/{properNoun} | Classify a proper noun as personal name, brand, or place |
| GET | /api2/json/apiUsage | Read current API key unit usage |
| GET | /api2/json/apiServices | List classifiers and their unit costs |

## Key resources

- **Personal** — Gender, origin, residence, and country classifiers for personal names
- **Social** — Diaspora and US-race classifiers for ethnicity-aware analytics
- **Chinese, Japanese, Indian** — Region-specific name classifiers tuned for those scripts
- **Admin** — API key usage, feature toggles, and per-classifier unit costs

## Why Jentic

- **Setup:** Wiring NamSor by hand means holding its X-API-KEY, setting the header on every call against v2.namsor.com, and picking the right classifier out of a large surface yourself. Through Jentic you install once, import the NamSor API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** NamSor carries the name to classify in the URL path or request body rather than a resource you own, so scope the agent to the operations it needs, such as predicting gender or country of origin, and leave batch classifiers out of the allowed set unless you include them.
- **Credential handling:** Your NamSor X-API-KEY is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'predict gender from a name' or 'classify country of origin', and Jentic returns the matching NamSor operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Genderize** — Single-purpose API that predicts gender from a first name
- **Nationalize** — Predicts the most likely nationalities for a given name
- **Agify** — Predicts the likely age of a person from their first name

## FAQ

### Why is there no official OpenAPI spec for NamSor API v2?

NamSor does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call NamSor API v2 via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the NamSor API v2 use?

NamSor uses an API key sent in the X-API-KEY HTTP header. When called through Jentic the key is stored encrypted in the vault and the agent receives a scoped execution token; the raw X-API-KEY never enters the agent's context.

### Can I batch-classify many names with the NamSor API v2?

Yes. The batch endpoints (genderBatch, genderGeoBatch, originBatch, corridorBatch, etc.) accept up to 100 names per request and return one classification object per input. Batch calls are the recommended pattern for any workload above a handful of names per minute.

### How is NamSor API v2 usage priced and rate-limited?

Costs are metered in 'units' per name. Simple operations like gender consume 1 unit per name; origin and country classifications use 10 units; corridor and ethnicity taxonomies can use up to 50 units per name pair. Call GET /api2/json/apiUsage to read remaining units and GET /api2/json/apiServices to see per-classifier costs.

### Can the NamSor API v2 distinguish a personal name from a brand or place?

Yes. GET /api2/json/nameType/{properNoun} returns 'personalName', 'brandName', or 'place' so you can clean noisy form input before sending it to the gender or origin classifiers. There is also a geo-aware variant at /api2/json/nameTypeGeo/{properNoun}/{countryIso2} that uses country context.

### How do I run a gender classification through Jentic?

Run jentic.search('predict gender from name'), load the POST /api2/json/genderBatch operation, then jentic.execute with an array of {firstName, lastName} objects. Jentic returns the structured response so the agent can append predicted gender and probability to each contact record.

### Can I limit what my agent is allowed to do with the NamSor API v2?

Yes. Because NamSor takes the name to classify in the URL path or request body rather than a resource you own, the rules on your self-hosted Jentic One instance decide which NamSor operations the agent may call. You can allow just the classifiers it needs, such as GET /api2/json/gender/{firstName}/{lastName} for gender or GET /api2/json/origin/{firstName}/{lastName} for country of origin, and leave batch endpoints like genderBatch and originBatch out of the allowed set unless you deliberately include them. Your X-API-KEY stays with your own instance and is injected only for the operations you permit.
