Keep script and reading uncertainty visible
Submit the spelling available in your record, such as kanji, kana or a Latin rendering. V2 accepts Unicode input but does not promise that different readings or spellings resolve to an equivalent dataset key. The dataset path does not convert kanji into a reading or split an uninterrupted full name into surname and given name.
For the common Japanese characters shown here, the current dataset candidate filter skips one- and two-character tokens. In the demo value 葵 高橋, both space-separated tokens are skipped. Ordinary fallback may ask AI about the original full value; a dataset-only request will preserve an unknown result with reason: no_name_candidate.
Removing the space creates a different candidate, not a reliable segmentation fix. Preserve the actual input and check the returned source and match. A possible reading, a naming convention or JP context does not verify an individual's gender identity.
| Example input | What it represents | What to check |
|---|---|---|
葵 高橋 | Short separated tokens | Neither token reaches the dataset filter's minimum length for these characters. Fallback can still consider the original value. |
高橋葵 | Uninterrupted full-name example | One candidate; the dataset path does not decide where the surname ends. |
あおい | Three-character kana example | Eligible as a token, but eligibility does not mean a stored match exists or imply a live gender result. |
Aoi Takahashi | Latin-script input | Separate tokens can be considered. This does not establish a unique original spelling or guarantee the intended given name wins. |
Choose JP context deliberately
The live demo sends country: JP (Japan). 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 Japanese 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.
Japanese name lookup FAQ
Why does the example 葵 高橋 need AI fallback?
Both tokens are too short for the current dataset candidate filter, so dataset-only mode returns unknown with reason: no_name_candidate. Fallback can attempt the original full value, but an AI answer is not guaranteed.
Does V2 resolve the exact reading of a Japanese name?
It does not provide a verified reading-resolution service. The dataset path does not convert kanji to kana or guarantee equivalent results for a romanized spelling. Preserve the input and review the returned evidence.
Is accuracy measured for every Japanese 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.