Genderize.io

GRATUIT
Par stromgren | Mise à jour 2달 전 | Data
Health Check

100%

Retour à toutes les discussions

unable to get response

Rapid account: Kvyadav
kvyadav
vor 10 Jahren

$ch = curl_init(“https://genderize.p.mashape.com/?country_id=US&language_id=en&name=peter”);

    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPGET, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($ch);       
    curl_close($ch);
   $optarray=json_decode($output); 
   print_r($optarray);

this is my code but i am not getting output

Rapid account: Stromgren
stromgren Commented vor 10 Jahren

When using the API through Mashape, you’ll have to append your Mashape API key:

<pre><code>curl --get --include “https://genderize.p.mashape.com/?country_id=US&language_id=en&name=peter
-H “X-Mashape-Key: 2GwWV8tqXWmshjrC1HZE12AgbWpup10ifrrjsnbJilVdRCRGp0”</code></pre>
Or you can use the API directly. Refer to the documentation at http://genderize.io
Your URL would then look like this:

<pre><code>http://api.genderize.io?name=peter&country_id=US&language_id=en</code></pre>

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires