Genderize.io

GRATIS
Door stromgren | Bijgewerkt 2 months ago | Data
Health Check

100%

Terug naar alle discussies

unable to get response

Rapid account: Kvyadav
kvyadav
10 years ago

$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 10 years ago

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>

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen