# Extract a name and infer gender from one username

> Canonical documentation: https://www.genderapi.io/docs-gender-from-username-single

Canonical HTML: https://www.genderapi.io/docs-gender-from-username-single

Last reviewed: 2026-09-14

## Request

POST https://api.genderapi.io/api/username

Use Bearer authentication from trusted server-side code. Check the canonical OpenAPI document before production use.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| username | string | Required | See OpenAPI schema. |
| country | string | Optional | ISO 3166-1 alpha-2 country code used as regional context. |
| askToAI | boolean | Optional | See OpenAPI schema. |
| forceToGenderize | boolean | Optional | See OpenAPI schema. |

```json
{
  "username": "anna_smith88",
  "country": "US"
}
```

## Response

A successful lookup may still return a null gender. Preserve probability and unknown outcomes.

| Field | Type | Description |
| --- | --- | --- |
| status | boolean | Returned response field. |
| used_credits | integer | Credits consumed for processed records. |
| remaining_credits | integer | Returned response field. |
| expires | integer | Package expiration as a UNIX timestamp. |
| duration | string | Returned response field. |
| name | string | Returned response field. |
| q | string | Original submitted value. |
| gender | string | Probabilistic result. An unresolved input is returned as the literal string "null", not JSON null. |
| country | string | ISO 3166-1 alpha-2 country code used as regional context. |
| total_names | integer | Returned response field. |
| probability | integer | Returned response field. |
| id | string integer | Caller record identifier. |

```json
{
  "status": true,
  "used_credits": 1,
  "remaining_credits": 4999,
  "expires": 1743659200,
  "q": "anna_smith88",
  "name": "Anna",
  "gender": "female",
  "country": "US",
  "total_names": 10234,
  "probability": 98,
  "duration": "4ms"
}
```

## Errors and usage

One lookup; AI options may have different usage accounting. Confirm current terms.

- [Error codes](https://www.genderapi.io/docs-error-codes)
- [Authentication](https://www.genderapi.io/docs-authentication)
- [OpenAPI JSON](https://www.genderapi.io/openapi/openapi.json)
