Expand description
Client for the NameGender API.
use namegender::{NameGender, Options};
let client = NameGender::new(std::env::var("NAMEGENDER_API_KEY").unwrap());
let result = client
.name("Andrea", &Options { country: Some("IT".into()), ..Default::default() })
.await?;
println!("{:?} {} {}", result.gender, result.probability, result.sample_size);Every lookup costs one credit, unknown results included. Success is the
HTTP status; any other response is returned as Error::Api carrying the
API’s reason code.
Structs§
- Account
- Credit balance and account status. Costs no credit.
- AgeBulk
Response - Response of a bulk age estimate;
resultsis in the order the names were sent. - AgeOptions
- Options for the age endpoints. Fields left as
Noneare not sent. - AgeRange
- A range of ages in years,
lowtohighinclusive. - AgeResponse
- Response of a single age estimate.
- AgeResult
- The typical age of the people who carry a first name. It describes a group, not a person: never use it for decisions about an individual.
- Bulk
Response - Response of a bulk lookup;
resultsis in the order the values were sent. - Bulk
Summary - Countries
Response - Which countries a name is recorded in. Not a country-of-origin or
ethnicity inference: show
basis["note"]next to any percentage. - Gender
Response - Response of a single lookup.
- Gender
Result - One resolved value.
- Name
Check Bulk Response - Response of a bulk name check;
resultsis in the order the names were sent. - Name
Check Evidence - What the database knows about the first name. Surnames are judged by their shape only.
- Name
Check Options - Options for the name check endpoints. Fields left as
Noneare not sent. - Name
Check Response - Response of a single name check.
- Name
Check Result - Whether one name looks like a real person’s name. It never calls a name fake: use it to flag records, not to reject people automatically.
- Name
Check Signal - One reason behind an assessment.
- Name
Check Summary - Name
Gender - The API client. Cheap to clone; reuse one per process.
- Options
- Options shared by the name, email, username and bulk lookups.
- Registration
- Salutation
Bulk Response - Response of a bulk salutation;
resultsis in the order the names were sent. - Salutation
Lines - The three ready lines.
neutralis always the gender-free form. - Salutation
Options - Options for the salutation endpoints. Fields left as
Noneare not sent. - Salutation
Parts - Pieces of the formal line, for building your own template.
- Salutation
Response - Response of a single salutation.
- Salutation
Result - The salutation for one name.
- Salutation
Summary