GENDER API JAVASCRIPT

Nejprve nainstalujte naši knihovnu pomocí composeru:

Zde naleznete kompletní dokumentaci klienta:

https://github.com/markus-perl/gender-api-client

Nejprve nainstalujte naši knihovnu pomocí npm:

Zde naleznete kompletní dokumentaci klienta:

https://github.com/markus-perl/gender-api-client-npm

Nejprve nainstalujte naši knihovnu pomocí npm:

npm install gender-api.com-client --save
const { Client } = require('gender-api.com-client');

const client = new Client('your-api-key');

// Simple gender lookup
client.getByFirstName('Theresa').then(result => {
  console.log(`${result.first_name} is ${result.gender} (Probability: ${result.probability}`);
}).catch(error => {
  console.error('Error:', error);
});

// First name with country (e.g., "Andrea" varies by country)
client.getByFirstName('Andrea', { country: 'IT' }).then(result => {
  console.log(`${result.first_name} in Italy is ${result.gender}`);
}).catch(error => {
  console.error('Error:', error);
});

// Full name with automatic first/last name splitting
client.getByFullName('John Smith').then(result => {
  console.log(`${result.first_name} ${result.last_name} is ${result.gender}`);
}).catch(error => {
  console.error('Error:', error);
});

// Email address analysis
client.getByEmailAddress('marie.curie@example.com').then(result => {
  console.log(`Email gender: ${result.gender}`);
}).catch(error => {
  console.error('Error:', error);
});

// Batch processing - multiple names in one call
const names = [
  { id: '1', first_name: 'Theresa', country: 'US' },
  { id: '2', first_name: 'John', country: 'US' }
];

client.getByFirstNameMultiple(names).then(results => {
  results.forEach(r => {
    console.log(`ID: ${r.input.id}, Gender: ${r.gender}`);
  });
}).catch(error => {
  console.error('Error:', error);
});

// Account statistics
client.getStatistics().then(stats => {
  console.log(`Credits Remaining: ${stats.remaining_credits}`);
}).catch(error => {
  console.error('Error:', error);
});

Zde naleznete kompletní dokumentaci klienta:

https://github.com/markus-perl/gender-api-client-npm

Nejprve si nainstaluj naši knihovnu pomocí pip:

Zde naleznete kompletní dokumentaci klienta:

https://github.com/markus-perl/gender-api-client-python
https://pypi.org/project/gender-api-client/

Chat