API DOCUMENTATION V2

GenderAPI.io V2: JSON responses and confidence

Read GenderAPI.io V2 data and meta fields: predictions, confidence_kind, unknown results, source evidence, access mode and billing status.

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.

Illustrative JSON response
{
  "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

FieldTypeNullableExampleDescription
data.inputobjectNo{"type":"name","value":"James","country":"US"}Input type, value and country. forceToGenderize is included when true.
data.namestringYes"james"Matched or extracted given name; null when none is available.
data.genderstringYes"male"male, female or JSON null. An inference, not verified personal identity.
data.result_statusstringNo"identified"identified when a gender is returned; unknown otherwise.
data.reasonstringYesnullNull for identified results. Unknown reasons: not_found, no_name_candidate, ambiguous or insufficient_evidence.
data.confidencenumberYes0.950–1 score or null. Null gender has null confidence.
data.confidence_kindstringYes"observed_frequency"observed_frequency: dominant dataset count / total. model_reported: AI score, not a calibrated probability. Null when unavailable.
data.sample_countintegerYes1200Dataset sample size or null. AI does not invent a sample count.
data.sourcestringNo"dataset"dataset, ai or none.
data.countrystringYes"US"Country association from dataset or ai_association, or null. Does not establish nationality, residence or ethnicity.
data.country_sourcestringYes"dataset"Origin of the country association: dataset, ai_association or null.
data.matchobjectNo{"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

FieldTypeNullableExampleDescription
data.input.typestringNo"name"Input category: name, email or username.
data.input.valuestringNo"James"The submitted prediction value.
data.input.countrystringYes"US"Submitted country context; null when omitted.
data.input.forceToGenderizebooleanNotruePresent only when nickname mode is enabled. Otherwise omitted.

Dataset matching fields

FieldTypeNullableExampleDescription
data.match.namestringYes"james"Selected dataset candidate; null when no dataset row was selected.
data.match.methodstringYes"normalized"normalized, token, substring or model_inference; null when unavailable.
data.match.scopestringYes"country"country or global for dataset lookups; null for AI or missing evidence.
data.match.countrystringYes"US"Country of the selected dataset row; null for global rows or AI.

Access, billing and request metadata

FieldTypeNullableExampleDescription
meta.request_idstringNo"550e8400-e29b-41d4-a716-446655440000"Unique identifier for this HTTP attempt; also sent in X-Request-ID.
meta.duration_msintegerNo42Request processing time in milliseconds.
meta.access.modestringNo"api_key"api_key, ip_trial or unauthenticated. Verify api_key when using a paid account.
meta.access.reasonstringYesnullTrial fallback reason: api_key_missing, api_key_invalid or api_key_not_found; null otherwise.
meta.usage.charged_creditsintegerYes1Net credits charged. Zero before charging or after a full confirmed refund; null when billing is unconfirmed.
meta.usage.remaining_creditsintegerYes99Balance when the operation completes. May be negative; null when unavailable or billing is unconfirmed.
meta.usage.billing_statusstringNo"confirmed"not_charged, confirmed or unconfirmed. Check this before retrying a failed prediction.
meta.usage.resets_atstringYes"2026-09-27T12:00:00.000Z"IP trial reset time in UTC (ISO 8601); null for API-key accounts or when unknown.
meta.usage.limitintegerYes10IP trial allowance; null for API-key accounts.
meta.usage.period_secondsintegerYes86400IP 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.

Illustrative JSON response
{
  "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.

OutcomeWhat it meansSuggested handling
identified; gender: male or femaleThe 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_foundNo 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_candidateDataset parsing produced no usable name candidate.Keep null; check the input type and value before choosing any additional inference.
unknown; reason: ambiguousThe 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_evidenceAI 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 errorExecution 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.

Related guides