genderapi_item: Build one prediction item

View source: R/gender.R

genderapi_itemR Documentation

Build one prediction item

Description

Validates the input with the cheap, certain rules of the V2 schema and returns the exact wire object (type, value, country, id, forceToGenderize, options$ai_mode). Invalid input raises a genderapi_validation_error; no request is sent. The API performs the authoritative checks (email syntax, country membership, trial limits).

Usage

genderapi_item(
  type,
  value,
  country = NULL,
  ai_mode = NULL,
  force_to_genderize = FALSE,
  id = NULL
)

Arguments

type

One of "name", "email" or "username".

value

The name, email address or username: 1 to 254 characters, not only whitespace, no control characters.

country

Optional ISO 3166-1 alpha-2 code in upper case, such as "TR". Omit it when unknown.

ai_mode

Optional "off", "fallback" or "always". When omitted the server default applies: fallback for single requests and off for batch items. fallback costs 1 credit in total; always costs 2.

force_to_genderize

TRUE to try the dataset first and, if gender is unknown, infer it from nickname or alias semantics (2 credits in total in that case). Cannot be combined with ai_mode "off" or "always".

id

Optional item id, 1 to 64 characters. In a batch, ids must be unique and are echoed back in each result.

Value

A list of class genderapi_item.

Examples

genderapi_item("name", "Onur", country = "TR", ai_mode = "off", id = "row-1")

genderapi documentation built on Oct. 1, 2026, 5:13 p.m.