API-Dokumentation

Fehler-Codes

{
    "status":false,
    "errno":94,
    "errmsg":"invalid or missing key",
}
errno errmsg Beschreibung
50 access denied Nicht autorisierte IP-Adresse oder Referer. Bitte überprüfen Sie Ihre Zugriffsrechte.
90 invalid country code Überprüfen Sie die unterstützten Ländercodes. ISO 3166-1 alpha-2
91 name not set || email not set Fehlender Name oder E-Mail-Parameter in Ihrer Anfrage.
92 too many names || too many emails Das Limit ist 100 für Namen, 50 für E-Mails in einer Anfrage.
93 limit reached Die Gutschrift des API-Keys wurde abgeschlossen.
94 invalid or missing key Der API-Key kann nicht gefunden werden.
99 API key has expired Bitte erneuern Sie Ihren API-Key.

Postman

  • 1. Postman-Konfigurationsdatei runterladen (mit der rechten Maustaste auf den Link und dann auf 'Speichern unter' klicken). Postman öffnen, und auf Datei->Importieren
  • 2. Auf den Root-Ordner mit dem Namen 'GenderAPI.io' klicken.
  • 3. Auf den Tab Autorisierung klicken und den API-Key einfügen. Registrieren und 200 Gratis-Credits/Tag erhalten
How to import and configure Postman

Name zu Geschlecht


Einzelner Name

Basisnutzung der Einzelnamenanfrage


GET /api/?name=Anna&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
name=Anna&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
GET
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

POST
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.genderapi.io/api/',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => 'name=abraham&key=<YourAPIkey>',
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

GET
$client = new Client();
$request = new Request('GET', 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>');
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

POST
$client = new Client();
$headers = [
    'Content-Type' => 'application/x-www-form-urlencoded'
];
$options = [
    'form_params' => [
        'name' => 'abraham',
        'key' => '<YourAPIkey>'
    ]];
$request = new Request('POST', 'https://api.genderapi.io/api/', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();

GET
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
    'follow_redirects' => TRUE
));
try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
        echo $response->getBody();
    }
    else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
        $response->getReasonPhrase();
    }
}
catch(HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

POST
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.genderapi.io/api/');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
    'follow_redirects' => TRUE
));
$request->setHeader(array(
    'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->addPostParameter(array(
    'name' => 'maria',
    'key' => '<YourAPIkey>'
));
try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
        echo $response->getBody();
    }
    else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase();
    }
}
catch(HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

GET
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>');
$request->setRequestMethod('GET');
$request->setOptions(array());

$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

POST
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.genderapi.io/api/');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append(new http\QueryString(array(
    'name' => 'maria',
    'key' => '<YourAPIkey>')));$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
    'Content-Type' => 'application/x-www-form-urlencoded'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

GET
import http.client
conn = http.client.HTTPSConnection("api.genderapi.io")
payload = ''
headers = {}
conn.request("GET", "/api/?name=abraham&key=<YourAPIkey>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

POST
import http.client
conn = http.client.HTTPSConnection("api.genderapi.io")
payload = 'name=maria&key=<YourAPIkey>'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

GET
import requests

url = "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>"

payload = {}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

POST
import requests

url = "https://api.genderapi.io/api/"

payload = 'name=maria&key=<YourAPIkey>'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

GET
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
    .url("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>")
    .method("GET", body)
    .build();
Response response = client.newCall(request).execute();

POST
OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "name=maria&key=<YourAPIkey>");
Request request = new Request.Builder()
    .url("https://api.genderapi.io/api/")
    .method("POST", body)
    .addHeader("Content-Type", "application/x-www-form-urlencoded")
    .build();
Response response = client.newCall(request).execute();

GET
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>")
    .asString();

POST
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.genderapi.io/api/")
    .header("Content-Type", "application/x-www-form-urlencoded")
    .field("name", "maria")
    .field("key", "<YourAPIkey>")
    .asString();

GET
var requestOptions = {
    method: 'GET',
    redirect: 'follow'
};

fetch("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

POST
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("name", "maria");
urlencoded.append("key", "<YourAPIkey>");

var requestOptions = {
    method: 'POST',
    headers: myHeaders,
    body: urlencoded,
    redirect: 'follow'
};

fetch("https://api.genderapi.io/api/", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

GET
var settings = {
    "url": "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>",
    "method": "GET",
    "timeout": 0,
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

POST
var settings = {
"url": "https://api.genderapi.io/api/",
"method": "POST",
"timeout": 0,
"headers": {
    "Content-Type": "application/x-www-form-urlencoded"
},
"data": {
    "name": "maria",
    "key": "<YourAPIkey>"
}
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

GET
// WARNING: For GET requests, body is set to null by browsers.
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
    if(this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("GET", "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>");

xhr.send();

POST
// WARNING: For POST requests, body is set to null by browsers.
var data = "name=maria&key=<YourAPIkey>";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
    if(this.readyState === 4) {
        console.log(this.responseText);
    }
});

xhr.open("POST", "https://api.genderapi.io/api/");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xhr.send(data);

GET
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

POST
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.genderapi.io/api/");
var collection = new List<KeyValuePair<string, string>>();
collection.Add(new("name", "maria"));
collection.Add(new("key", "<YourAPIkey>"));
var content = new FormUrlEncodedContent(collection);
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

GET
var options = new RestClientOptions("https://api.genderapi.io")
{
    MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/?name=abraham&key=<YourAPIkey>", Method.Get);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

POST
var options = new RestClientOptions("https://api.genderapi.io")
{
    MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/", Method.Post);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("name", "maria");
request.AddParameter("key", "<YourAPIkey>");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

GET
curl --location 'https://api.genderapi.io/api/?name=abraham&key=<Your-API-Key>'

POST
curl --location 'https://api.genderapi.io/api/' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'name=maria' \
    --data-urlencode 'key=<YourAPIkey>'

GET
var dio = Dio();
var response = await dio.request(
    'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>',
    options: Options(
        method: 'GET',
    ),
);

if (response.statusCode == 200) {
    print(json.encode(response.data));
}
else {
    print(response.statusMessage);
}

POST
var headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
};
var data = {
    'name': 'maria',
    'key': '<YourAPIkey>'
};
var dio = Dio();
var response = await dio.request(
    'https://api.genderapi.io/api/',
    options: Options(
        method: 'POST',
        headers: headers,
    ),
    data: data,
);

if (response.statusCode == 200) {
    print(json.encode(response.data));
}
else {
    print(response.statusMessage);
}

GET
var request = http.Request('GET', Uri.parse('https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>'));
http.StreamedResponse response = await request.send(); if (response.statusCode == 200) { print(await response.stream.bytesToString()); } else { print(response.reasonPhrase); }
POST
var headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
};
var request = http.Request('POST', Uri.parse('https://api.genderapi.io/api/'));
request.bodyFields = {
    'name': 'maria',
    'key': '<YourAPIkey>'
};
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
    print(await response.stream.bytesToString());
}
else {
    print(response.reasonPhrase);
}

GET
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>"
    method := "GET"

    client := &http.Client {}
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}

POST
package main
import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.genderapi.io/api/"
    method := "POST"

    payload := strings.NewReader("name=maria&key=<YourAPIkey>")

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}

GET
val client = OkHttpClient()
val request = Request.Builder()
    .url("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>")
    .build()
val response = client.newCall(request).execute()

POST
val client = OkHttpClient()
val mediaType = "application/x-www-form-urlencoded".toMediaType()
val body = "name=maria&key=<YourAPIkey>".toRequestBody(mediaType)
val request = Request.Builder()
    .url("https://api.genderapi.io/api/")
    .post(body)
    .addHeader("Content-Type", "application/x-www-form-urlencoded")
    .build()
val response = client.newCall(request).execute()

GET
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
    curl_easy_setopt(curl, CURLOPT_URL, "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>");
    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
    curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
    struct curl_slist *headers = NULL;
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_URL, "https://api.genderapi.io/api/");
    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
    curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
    struct curl_slist *headers = NULL;
    headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    const char *data = "name=maria&key=<YourAPIkey>";
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
    res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

GET
const axios = require('axios');

let config = {
    method: 'get',
    maxBodyLength: Infinity,
    url: 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>',
    headers: { }
};

axios.request(config)
    .then((response) => {
        console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
        console.log(error);
    });

POST
const axios = require('axios');
const qs = require('qs');

let data = qs.stringify({
    'name': 'maria',
    'key': '<YourAPIkey>'
});

let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: 'https://api.genderapi.io/api/',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    data : data
};

axios.request(config)
    .then((response) => {
        console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
        console.log(error);
    });

GET
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
    'method': 'GET',
    'hostname': 'api.genderapi.io',
    'path': '/api/?name=abraham&key=<YourAPIkey>',
    'headers': {},
    'maxRedirects': 20
};

var req = https.request(options, function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function (chunk) {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
    });

    res.on("error", function (error) {
        console.error(error);
    });
});

req.end();

POST
var https = require('follow-redirects').https;
var fs = require('fs');

var qs = require('querystring');

var options = {
    'method': 'POST',
    'hostname': 'api.genderapi.io',
    'path': '/api/',
    'headers': {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    'maxRedirects': 20
};

var req = https.request(options, function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function (chunk) {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
    });

    res.on("error", function (error) {
        console.error(error);
    });
});

var postData = qs.stringify({
    'name': 'maria',
    'key': '<YourAPIkey>'
});

req.write(postData);

req.end();

GET
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>',
    'headers': {}
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});

POST
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://api.genderapi.io/api/',
    'headers': {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        'name': 'maria',
        'key': '<YourAPIkey>'
    }
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});

GET
var unirest = require('unirest');
var req = unirest('GET', 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>')
    .end(function (res) {
        if (res.error) throw new Error(res.error);
        console.log(res.raw_body);
    });

POST
var unirest = require('unirest');
var req = unirest('POST', 'https://api.genderapi.io/api/')
    .headers({
        'Content-Type': 'application/x-www-form-urlencoded'
    })
    .send('name=maria')
    .send('key=<YourAPIkey>')
    .end(function (res) {
        if (res.error) throw new Error(res.error);
        console.log(res.raw_body);
    });

GET
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>"]
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];

[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
    if (error) {
        NSLog(@"%@", error);
        dispatch_semaphore_signal(sema);
    } else {
        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
        NSError *parseError = nil;
        NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
        NSLog(@"%@",responseDictionary);
        dispatch_semaphore_signal(sema);
    }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);

POST
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.genderapi.io/api/"]
    cachePolicy:NSURLRequestUseProtocolCachePolicy
    timeoutInterval:10.0];
NSDictionary *headers = @{
    @"Content-Type": @"application/x-www-form-urlencoded"
};

[request setAllHTTPHeaderFields:headers];
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"name=maria" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&key=<YourAPIkey>" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
    if (error) {
        NSLog(@"%@", error);
        dispatch_semaphore_signal(sema);
    } else {
        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
        NSError *parseError = nil;
        NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
        NSLog(@"%@",responseDictionary);
        dispatch_semaphore_signal(sema);
    }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);

GET
open Lwt
open Cohttp
open Cohttp_lwt_unix

let reqBody =
let uri = Uri.of_string "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>" in
Client.call `GET uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body

let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)

POST
open Lwt
open Cohttp
open Cohttp_lwt_unix

let postData = ref "name=maria&key=<YourAPIkey>";;

let reqBody =
let uri = Uri.of_string "https://api.genderapi.io/api/" in
let headers = Header.init ()
|> fun h -> Header.add h "Content-Type" "application/x-www-form-urlencoded"
in
let body = Cohttp_lwt.Body.of_string !postData in

Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body

let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)

GET
$response = Invoke-RestMethod 'https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json

POST
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/x-www-form-urlencoded")

$body = "name=maria&key=<YourAPIkey>"

$response = Invoke-RestMethod 'https://api.genderapi.io/api/' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json

GET
library(httr)
res <- VERB("GET", url = "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>") cat(content(res, 'text'))
POST
library(httr)

headers = c(
    'Content-Type' = 'application/x-www-form-urlencoded'
)

body = list(
    'name' = 'maria',
    'key' = '<YourAPIkey>'
)

res <- VERB("POST", url = "https://api.genderapi.io/api/", body = body, add_headers(headers), encode = 'form')

cat(content(res, 'text'))

GET
library(RCurl)
res <- getURL("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>", .opts=list(followlocation = TRUE))
cat(res)

POST
library(RCurl)
headers = c(
    "Content-Type" = "application/x-www-form-urlencoded"
)
params = c(
    "name" = "maria",
    "key" = "<YourAPIkey>"
)
res <- postForm("https://api.genderapi.io/api/", .params = params, .opts=list(httpheader = headers, followlocation = TRUE), style = "post")
cat(res)

GET
require "uri"
require "net/http"

url = URI("https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body

POST
require "uri"
require "net/http"

url = URI("https://api.genderapi.io/api/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "name=maria&key=<YourAPIkey>"

response = https.request(request)
puts response.read_body

GET
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::builder()
        .build()?;

    let request = client.request(reqwest::Method::GET, "https://api.genderapi.io/api/?name=abraham&key=<YourAPIkey>");

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}

POST
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::builder()
        .build()?;

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("Content-Type", "application/x-www-form-urlencoded".parse()?);

    let mut params = std::collections::HashMap::new();
    params.insert("name", "maria");
    params.insert("key", "<YourAPIkey>");

    let request = client.request(reqwest::Method::POST, "https://api.genderapi.io/api/")
        .headers(headers)
        .form(&params);

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}

GET
var request = URLRequest(url: URL(string: "https://api.genderapi.io/api/?name=Anna&key=<YourAPIkey>")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    guard let data = data else {
        print(String(describing: error))
        return
    }
    print(String(data: data, encoding: .utf8)!)
}

task.resume()

POST
let parameters = "name=abraham&key=<YourAPIkey>"
let postData =  parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.genderapi.io/api/")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    guard let data = data else {
        print(String(describing: error))
        return
    }
    print(String(data: data, encoding: .utf8)!)
}

task.resume()

GET
http --follow --timeout 3600 GET 'https://api.genderapi.io/api/?name=Anna&key=<YourAPIkey>'

POST
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.genderapi.io/api/' \
    'name'='abraham' \
    'key'='<YourAPIkey>' \
    Content-Type:'application/x-www-form-urlencoded'

GET
wget --no-check-certificate --quiet \
    --method GET \
    --timeout=0 \
    --header '' \
    'https://api.genderapi.io/api/?name=Anna&key=<YourAPIkey>'

POST
wget --no-check-certificate --quiet \
    --method POST \
    --timeout=0 \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --body-data 'name=abraham&key=<YourAPIkey>' \
    'https://api.genderapi.io/api/'


ANTWORT
{
    "status": true,
    "used_credits": 1,
    "remaining_credits": 7295,
    "expires": 1717069765,
    "q": "anna",
    "name": "anna",
    "gender": "female",
    "country": "US",
    "total_names": 80455,
    "probability": 99,
    "duration": "4ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses
duration String milliseconds "4ms" Die Bearbeitungszeit Ihrer Anfrage auf dem Server

Einzelner Name mit Länderfilter

In einem Land kann ein Name weiblich sein, während er in einem anderen Land männlich ist.
Indem Sie den Länderfilter zu Ihren Abfragen hinzufügen, können Sie die für das jeweilige Land spezifischen Geschlechtsinformationen erhalten..
Finden Sie die ISO 3166-1 alpha-2 Ländercodes

* Wenn Sie mit dem Länderfilter kein Ergebnis erhalten, geben wir das globale Namensergebnis aus.


GET /api/?name=Anna&country=US&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
name=Anna&country=US&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 1,
    "remaining_credits": 7295,
    "expires": 1717069765,
    "q": "anna",
    "name": "anna",
    "gender": "female",
    "country": "US",
    "total_names": 80455,
    "probability": 99,
    "duration": "4ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses
duration String milliseconds "4ms" Die Bearbeitungszeit Ihrer Anfrage auf dem Server

Mehrere Namen

Sie können mehrere Namen auf einmal abfragen. Die maximale Anzahl ist 100.


GET /api/?name[]=Anna&name[]=james&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
name=Anna&name=james&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 2,
    "remaining_credits": 7291,
    "expires": 1717069765,
    "q": "anna;james brown",
    "names": [
        {
            "name": "james",
            "q": "james brown",
            "gender": "male",
            "country": "US",
            "total_names": 70373,
            "probability": 99
        },
        {
            "name": "anna",
            "q": "anna",
            "gender": "female",
            "country": "US",
            "total_names": 80455,
            "probability": 99
        }
    ],
    "duration": "2ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
names Array Any Ihre Ergebnisliste
duration String milliseconds("4ms") Die Bearbeitungszeit Ihrer Anfrage auf dem Server
names(Array)
Feld Datentyp Wert Beschreibung
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses

Mehrere Namen mit Länderfilter

In einem Land kann ein Name weiblich sein, während er in einem anderen Land männlich ist.
Indem Sie den Länderfilter zu Ihren Abfragen hinzufügen, können Sie die für das jeweilige Land spezifischen Geschlechtsinformationen erhalten..
Finden Sie die ISO 3166-1 alpha-2 Ländercodes

* Wenn Sie mit dem Länderfilter kein Ergebnis erhalten, geben wir das globale Namensergebnis aus.

* Sie können mehrere Namen auf einmal abfragen. Die maximale Anzahl ist 100.


POST /api/name/multi/country HTTP/1.1
Host: api.genderapi.io
Content-Type: application/json

{
"key":"<YourAPIkey>",
"data":[
    {"name":"Andrea","country":"DE"},
    {"name":"andrea","country":"IT"},
    {"name":"james","country":"US"}
  ]
}

Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 3,
    "remaining_credits": 7265,
    "expires": 1717069765,
    "names": [
        {
            "name": "andrea",
            "q": "Andrea",
            "gender": "female",
            "country": "DE",
            "total_names": 644,
            "probability": 88
        },
        {
            "name": "andrea",
            "q": "andrea",
            "gender": "male",
            "country": "IT",
            "total_names": 13537,
            "probability": 98
        },
        {
            "name": "james",
            "q": "james",
            "gender": "male",
            "country": "US",
            "total_names": 45274,
            "probability": 100
        }
    ],
    "duration": "5ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
names Array Any Ihre Ergebnisliste
duration String milliseconds("4ms") Die Bearbeitungszeit Ihrer Anfrage auf dem Server
names(Array)
Feld Datentyp Wert Beschreibung
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses

E-Mail zu Geschlecht


Einzelne E-Mail

Basisnutzung der einzelnen E-Mail-Abfrage


GET /api/email/?email=annarobinson@gmail.com&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/email/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
email=annarobinson@gmail.com&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 1,
    "remaining_credits": 4,
    "expires": 1717046468,
    "q": "annarobinson@gmail.com",
    "name": "anna",
    "gender": "female",
    "country": "US",
    "total_names": 80455,
    "probability": 99,
    "duration": "11ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses
duration String milliseconds "4ms" Die Bearbeitungszeit Ihrer Anfrage auf dem Server

Einzelne E-Mail mit Länderfilter

In einem Land kann ein Name weiblich sein, während er in einem anderen Land männlich ist.
Indem Sie den Länderfilter zu Ihren Abfragen hinzufügen, können Sie die für das jeweilige Land spezifischen Geschlechtsinformationen erhalten..
Finden Sie die ISO 3166-1 alpha-2 Ländercodes

* Wenn Sie mit dem Länderfilter kein Ergebnis erhalten, geben wir das globale Namensergebnis aus.


GET /api/email/?email=annarobinson@gmail.com&country=US&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/email/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
email=annarobinson@gmail.com&country=US&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 1,
    "remaining_credits": 4,
    "expires": 1717046468,
    "q": "annarobinson@gmail.com",
    "name": "anna",
    "gender": "female",
    "country": "US",
    "total_names": 80455,
    "probability": 99,
    "duration": "11ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses
duration String milliseconds "4ms" Die Bearbeitungszeit Ihrer Anfrage auf dem Server

Mehrere Emails

Sie können mehrere E-Mails auf einmal abfragen. Die max. Anzahl ist 50.


GET /api/email/?email[]=annarobinson@gmail.com&email[]=jameswhite@gmail.com&key=<YourAPIkey> HTTP/1.1
Host: api.genderapi.io

POST /api/email/ HTTP/1.1
Host: api.genderapi.io
Content-Type: application/x-www-form-urlencoded
email=annarobinson@gmail.com&email=jameswhite@gmail.com&key=<YourAPIkey>
Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 2,
    "remaining_credits": 7276,
    "expires": 1717069765,
    "q": "annarobinson@mail.com;jameswhite@mail.com",
    "names": [
        {
            "name": "anna",
            "q": "annawhite@mail.com",
            "gender": "female",
            "country": "US",
            "total_names": 80455,
            "probability": 99
        },
        {
            "name": "james",
            "q": "jamesbrown@mail.com",
            "gender": "male",
            "country": "US",
            "total_names": 70373,
        "probability": 99
        }
    ],
    "duration": "4ms"
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
names Array Any Ihre Ergebnisliste
duration String milliseconds("4ms") Die Bearbeitungszeit Ihrer Anfrage auf dem Server
names(Array)
Feld Datentyp Wert Beschreibung
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses

Mehrere E-Mails mit Länderfilter

In einem Land kann ein Name weiblich sein, während er in einem anderen Land männlich ist.
Indem Sie den Länderfilter zu Ihren Abfragen hinzufügen, können Sie die für das jeweilige Land spezifischen Geschlechtsinformationen erhalten..
Finden Sie die ISO 3166-1 alpha-2 Ländercodes

* Wenn Sie mit dem Länderfilter kein Ergebnis erhalten, geben wir das globale Namensergebnis aus.

* Sie können mehrere E-Mails auf einmal abfragen. Die max. Anzahl ist 50.


POST /api/email/multi/country HTTP/1.1
Host: api.genderapi.io
Content-Type: application/json

{
"key":"<YourAPIkey>",
"data":[
    {"email":"Andreawhite@mail.com","country":"DE"},
    {"email":"andreabrown@gmail.com","country":"IT"},
    {"email":"jamesblack@yandex.com","country":"US"}
  ]
}

Wählen Sie Ihre Programmiersprache
Loading...

ANTWORT
{
    "status": true,
    "used_credits": 3,
    "remaining_credits": 7282,
    "expires": 1717069765,
    "duration": "6ms",
    "names": [
        {
            "name": "andrea",
            "q": "Andreablack@email.com",
            "gender": "female",
            "country": "DE",
            "total_names": 644,
            "probability": 88
        },
        {
            "name": "andrea",
            "q": "andreawhite@gmail.com",
            "gender": "male",
            "country": "IT",
            "total_names": 13537,
            "probability": 98
        },
        {
            "name": "james",
            "q": "jamesbrown@gmail.com",
            "gender": "male",
            "country": "US",
            "total_names": 45274,
            "probability": 100
        }
    ]
}
Feld Datentyp Wert Beschreibung
status Boolean true,false Bitte prüfen Sie die Fehlercodes, wenn false
used_credits Integer Any Anzahl der verbrauchten Credits für die letzte Anfrage
remaining_credits Integer Any Anzahl der verbleibenden Credits für Ihr Paket
expires Integer Any Verfallsdatum Ihres Pakets als Zeitstempel in Sekunden
names Array Any Ihre Ergebnisliste
duration String milliseconds("4ms") Die Bearbeitungszeit Ihrer Anfrage auf dem Server
names(Array)
Feld Datentyp Wert Beschreibung
q String Any Ihre Anfrage
name String Any Der gefundene Name
gender enum[String] ["male","female","null"] Ergebnis des Geschlechts
country enum[String] ["US","DE","FR","IT",...] Am häufigsten gefundenes Land
total_names Integer Any Die Anzahl der Beispiele
probability Integer 50 - 100 Die prozentuale Genauigkeit des Ergebnisses