Keep the Arabic spelling and check the matched name
Submit the name in its original Unicode spelling. The input below uses right-to-left Arabic text while the surrounding English guide and JSON remain left-to-right. The API can receive that text without a client-side transliteration step; accepting it is not a promise of dataset coverage.
The dataset path applies Unicode NFKC normalization and token splitting. It does not implement a general Arabic diacritic-removal or spelling-equivalence rule. Vowel marks and other spelling differences can therefore affect which stored key is found. Preserve the original value instead of silently treating every variation as the same person.
A full name can produce several candidate tokens. The available record with the largest stored total wins, so the first word is not guaranteed to be the returned given name. Review data.name and data.match.name before using a result to enrich a record.
| Example input | What it represents | What to check |
|---|---|---|
ليلى الخطيب | Full-name example | Multiple tokens can be considered. Inspect the selected match; this example does not assert a live outcome. |
ليلى / لَيْلَى | Unmarked and marked spellings | Submit the actual spelling. These strings are not guaranteed to resolve to an identical stored record. |
Layla / Leila | Latin spellings | These are separate input values, not an automatic transliteration equivalence promised by V2. |
country: SA | Saudi Arabia demo context | This context is not a default for every Arabic-speaking community. Omit country when it is unknown. |
Choose SA context deliberately
The live demo sends country: SA (Saudi Arabia). The API does not choose this country from the name's script. In your integration, use known, relevant context or omit country; do not turn this sample value into a default for every record.
For each candidate, the dataset path prefers an existing country-specific record and otherwise considers the global record. It then selects the available candidate with the largest stored total. Inspect data.match.scope and data.match.country to see the actual match scope. An ambiguous country-specific record is not automatically replaced by a global result; fallback may use AI instead.
data.input.country describes the request context. data.country and data.country_source describe a returned association. They are different fields and do not establish citizenship, ethnicity or residence.
Send a Arabic name with V2
Run the request on your server with GENDERAPI_API_KEY set to your existing key. The example explicitly enables ordinary AI fallback. It illustrates a request, not a measured prediction or coverage result. Use options.ai_mode: off for dataset-only processing.
Choose your language. Set up your API key, then run the example on your server.
Every prediction request is a new billable operation, including retries. These examples do not automatically retry. Check billing status before sending another request.
Before you run: access and error handling
Run these examples on your server. Set GENDERAPI_API_KEY in the process environment to your existing API key. Confirm meta.access.mode is api_key: an unrecognized key can fall back to the IP trial.
HTTP 4xx and 5xx JSON responses preserve the error body and return a nonzero exit status. Check code, action and meta.usage.billing_status before retrying.
Error and retry guide →cURL 7.76+ in a POSIX shell. Run in your terminal. Runtime documentation
Node.js 22+; built-in fetch. Save as example.mjs and run node example.mjs. Runtime documentation
Python 3.10+; standard library. Save as example.py and run python3 example.py. Runtime documentation
PHP 8+ with the cURL extension. Save as example.php and run php example.php. Runtime documentation
Java 17+; standard HTTP client. Save as GenderApiExample.java and run java GenderApiExample.java. Runtime documentation
.NET 8+ console application. Use as Program.cs in a console project, then run dotnet run. Runtime documentation
Go 1.22+; standard library. Save as main.go and run go run main.go. Runtime documentation
Keep the result and its evidence together
An inferred association is not a person's self-declared gender. Keep the original input, the returned evidence and any information provided by the person separate. An unknown result is a valid outcome; it should not become a guessed category in your application.
| Field | How to use it |
|---|---|
data.gender / data.result_status | Use male or female only when identified. Preserve native JSON null when the result is unknown. |
data.name / data.match | Inspect the returned name and selected candidate. A substring match does not prove that the input belongs to someone with that given name. |
data.confidence / data.confidence_kind | Confidence is on a 0–1 scale or null. observed_frequency comes from stored counts; model_reported is an AI score. Evaluate thresholds separately for each kind. |
data.source / data.sample_count | Distinguish dataset, ai and none. AI results have no stored sample count. A sample count is not a measured accuracy score. |
meta.access.mode | Confirm api_key for an account integration. Missing or unrecognized keys can instead use the shared IP trial. |
meta.usage | Read charged_credits and billing_status. A successful unknown is billable. A lost response does not establish that the request was free. |
Choose when to use AI
forceToGenderize is optional for names, email addresses and usernames. With it enabled, omit ai_mode or use fallback; off and always conflict with it and return 422. A positive starting balance is enough to begin a request even if its final charge takes the balance below zero.
Nickname mode can return a gender with name: null. It can also return an unknown result. Neither ordinary fallback nor nickname inference guarantees a correct or non-null answer.
| Request option | Behavior | Credits for a successful lookup |
|---|---|---|
| options.ai_mode: off | Use the dataset only. | 1, including an unknown result |
| options.ai_mode: fallback | Try the dataset, then ordinary AI when no gender is returned. This is the single-request default. | 1 total, including AI fallback |
| options.ai_mode: always | Ask AI directly. | 2 |
| forceToGenderize: true | Try the dataset first, then allow AI to interpret a personal nickname or alias even without a real given name. | 1 for a resolved dataset result; 2 total if AI is used |
Process a name list without losing its context
Use POST /api/v2/gender/batch for up to 50 items with registered API-key access or 10 items in the IP trial. Assign unique item IDs and retain the original value for each row. Each item can have its own country and AI policy; omit a country when it is unknown.
Batch items default to dataset-only mode, unlike the single-request fallback default. Set options.ai_mode: fallback on each item that needs AI. Check every result, even after HTTP 200, preserve unknown outcomes and review item errors and billing before another submission. Each successful ordinary item uses one credit; one batch HTTP request is not one prediction credit.
Understand what you send
The live demo sends the entered value to GenderAPI only when you submit it. If AI is invoked, the submitted type, value and country context are sent to the configured inference service. For dataset-only prediction, use options.ai_mode: off without forceToGenderize in your integration.
The Privacy Policy, processing agreement and subprocessor register describe the published handling terms. A result is an inferred association; let information supplied by the person take precedence. Do not use it as the basis for consequential decisions about an individual.
Arabic name lookup FAQ
Does V2 accept Arabic text with diacritics?
It accepts Unicode name input, including Arabic text. Dataset normalization does not generally remove Arabic vowel marks, so marked and unmarked spellings may produce different matches or an unknown result.
Does this tool identify an Arabic-speaking person's nationality?
No. SA is the explicit country context for this demonstration. Script, a name association and a returned country field do not establish nationality or residence.
Is accuracy measured for every Arabic name?
No such measurement is published here. Input acceptance, stored counts and a confidence value are not an independent accuracy benchmark. Review the methodology page for the available evidence and the measurements that remain unpublished.
Does an unknown result use credits?
A successful unknown is billable. Ordinary dataset or fallback mode costs one credit total. With forceToGenderize enabled, a resolved dataset result costs one credit and using AI costs two total, including an unknown AI result. Errors have separate billing rules; inspect meta.usage.