Understand the JSON response
GenderAPI.io V2 single predictions return a data object for the result and a meta object for request, access and billing information. Read data.gender and data.confidence together with data.confidence_kind and data.source. The following dataset example is a real response captured on 1 October 2026 with an API key; only the account balance is replaced. It does not represent measured product accuracy, and a live request can return a different result. API-key requests report access.mode: api_key and null trial-only quota fields; IP-trial requests report ip_trial with the trial limit and reset time.
{
"data": {
"input": {
"type": "name",
"value": "James",
"country": "US"
},
"name": "james",
"gender": "male",
"country": "US",
"confidence": 0.9956045412377965,
"confidence_kind": "observed_frequency",
"sample_count": 45274,
"source": "dataset",
"result_status": "identified",
"reason": null,
"country_source": "dataset",
"match": {
"name": "james",
"method": "normalized",
"scope": "country",
"country": "US"
}
},
"meta": {
"request_id": "7b68043d-2656-4e2d-abcf-dabb4bbc6445",
"duration_ms": 12,
"access": {
"mode": "api_key",
"reason": null
},
"usage": {
"charged_credits": 1,
"remaining_credits": 49999,
"billing_status": "confirmed",
"resets_at": null,
"limit": null,
"period_seconds": null
}
}
}Prediction response fields
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
data.input | object | No | {"type":"name","value":"James","country":"US"} | Input type, value and country. forceToGenderize is included when true. |
data.name | string | Yes | "james" | Matched or extracted given name; null when none is available. |
data.gender | string | Yes | "male" | male, female or JSON null. An inference, not verified personal identity. |
data.result_status | string | No | "identified" | identified when a gender is returned; unknown otherwise. |
data.reason | string | Yes | null | Null for identified results. Unknown reasons: not_found, no_name_candidate, ambiguous or insufficient_evidence. |
data.confidence | number | Yes | 0.95 | 0–1 score or null. Null gender has null confidence. |
data.confidence_kind | string | Yes | "observed_frequency" | observed_frequency: dominant dataset count / total. model_reported: AI score, not a calibrated probability. Null when unavailable. |
data.sample_count | integer | Yes | 1200 | Dataset sample size or null. AI does not invent a sample count. |
data.source | string | No | "dataset" | dataset, ai or none. |
data.country | string | Yes | "US" | Country association from dataset or ai_association, or null. Does not establish nationality, residence or ethnicity. |
data.country_source | string | Yes | "dataset" | Origin of the country association: dataset, ai_association or null. |
data.match | object | No | {"name":"james","method":"normalized","scope":"country","country":"US"} | Matched dataset name, method (normalized, token, substring or model_inference), country/global scope and matched country. Unavailable evidence is null. |
Returned input fields
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
data.input.type | string | No | "name" | Input category: name, email or username. |
data.input.value | string | No | "James" | The submitted prediction value. |
data.input.country | string | Yes | "US" | Submitted country context; null when omitted. |
data.input.forceToGenderize | boolean | No | true | Present only when nickname mode is enabled. Otherwise omitted. |
Dataset matching fields
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
data.match.name | string | Yes | "james" | Selected dataset candidate; null when no dataset row was selected. |
data.match.method | string | Yes | "normalized" | normalized, token, substring or model_inference; null when unavailable. |
data.match.scope | string | Yes | "country" | country or global for dataset lookups; null for AI or missing evidence. |
data.match.country | string | Yes | "US" | Country of the selected dataset row; null for global rows or AI. |
Access, billing and request metadata
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
meta.request_id | string | No | "550e8400-e29b-41d4-a716-446655440000" | Unique identifier for this HTTP attempt; also sent in X-Request-ID. |
meta.duration_ms | integer | No | 42 | Request processing time in milliseconds. |
meta.access.mode | string | No | "api_key" | api_key, ip_trial or unauthenticated. Verify api_key when using a paid account. |
meta.access.reason | string | Yes | null | Trial fallback reason: api_key_missing, api_key_invalid or api_key_not_found; null otherwise. |
meta.usage.charged_credits | integer | Yes | 1 | Net credits charged. Zero before charging or after a full confirmed refund; null when billing is unconfirmed. |
meta.usage.remaining_credits | integer | Yes | 99 | Balance when the operation completes. May be negative; null when unavailable or billing is unconfirmed. |
meta.usage.billing_status | string | No | "confirmed" | not_charged, confirmed or unconfirmed. Check this before retrying a failed prediction. |
meta.usage.resets_at | string | Yes | "2026-09-27T12:00:00.000Z" | IP trial reset time in UTC (ISO 8601); null for API-key accounts or when unknown. |
meta.usage.limit | integer | Yes | 10 | IP trial allowance; null for API-key accounts. |
meta.usage.period_seconds | integer | Yes | 86400 | IP trial window in seconds; null for API-key accounts. |
A successful unknown result
HTTP 200 means the operation completed; it does not guarantee a gender. Preserve JSON null rather than converting it to male, female, an empty string or zero confidence. Check data.result_status and data.reason separately from HTTP errors.
This real dataset-only example, captured on 1 October 2026, returns source: none and reason: not_found and still costs 1 credit. A tied dataset row can return reason: ambiguous with its sample_count retained. An unknown AI result uses source: ai and reason: insufficient_evidence.
{
"data": {
"input": {
"type": "name",
"value": "zzzxxyy",
"country": null
},
"name": null,
"gender": null,
"country": null,
"confidence": null,
"confidence_kind": null,
"sample_count": null,
"source": "none",
"result_status": "unknown",
"reason": "not_found",
"country_source": null,
"match": {
"name": null,
"method": null,
"scope": null,
"country": null
}
},
"meta": {
"request_id": "54fdcd4e-f8bc-4224-918f-3a5732e08b9c",
"duration_ms": 10,
"access": {
"mode": "api_key",
"reason": null
},
"usage": {
"charged_credits": 1,
"remaining_credits": 49999,
"billing_status": "confirmed",
"resets_at": null,
"limit": null,
"period_seconds": null
}
}
}Interpret confidence and matching evidence
A confidence of 0.9 is on a 0–1 scale. For observed_frequency it means the dominant count divided by the selected dataset total; it is not measured end-to-end product accuracy. A model_reported score is provided by AI and is not calibrated against dataset frequencies.
Choose any application threshold using your own evaluation data and confidence_kind. Do not directly rank dataset and AI scores as if they measured the same thing. AI match.name, match.scope and match.country are null because no dataset row was selected; match.method is model_inference.
For full names, a dataset result may come from a component rather than the full string. data.input preserves the submitted value; data.name describes the returned name, and data.match describes the candidate and lookup scope.
Decide what your application should do next
Handle request and item errors first, then inspect result_status. For a single prediction, read data; for a batch, apply the same decision to each successful item's data. Keep unknown outcomes in your application instead of forcing a male or female label.
| Outcome | What it means | Suggested handling |
|---|---|---|
| identified; gender: male or female | The inference produced a gender, with dataset or AI evidence. | Apply a policy evaluated for that confidence_kind; preserve source and matching evidence. |
| unknown; reason: not_found | No stored dataset record matched the parsed candidates. | Keep gender as null. A deliberate request with different AI options is a new billable operation. |
| unknown; reason: no_name_candidate | Dataset parsing produced no usable name candidate. | Keep null; check the input type and value before choosing any additional inference. |
| unknown; reason: ambiguous | The selected dataset row has tied male and female counts; sample_count can still be present. | Do not break the tie yourself or convert the null confidence to zero. |
| unknown; reason: insufficient_evidence | AI completed without enough evidence to return a gender. | Treat it as a completed unknown, not a provider failure or an automatic retry candidate. |
| Problem Details or an item's error | Execution failed, for example because of ai_upstream_error or prediction_timeout. | Keep the error code and request ID, inspect billing, and follow the retry guidance. |
Choose thresholds using your own evaluation
There is no universal confidence cutoff that makes a prediction correct. Evaluate observed_frequency and model_reported separately on representative, independently labeled examples from your use case. A dataset frequency and an AI self-reported score are different signals, even when both happen to be 0.9. Measure how often your policy answers and how often its answered predictions are correct; retain an unknown or review path for everything else.
For example, if result_status is identified but confidence_kind is model_reported, apply your evaluated AI policy rather than the dataset threshold. If forceToGenderize was used, name: null with a non-null gender is valid: an alias can be inferred without extracting a real given name. Check gender and result_status, not name alone, to decide whether the inference answered. This remains an estimate, not verification of a person's identity.