PHP Curl Javascript Node Js Python C#
Copy <? php
$curl = curl_init ();
curl_setopt_array ($curl , array (
CURLOPT_URL => 'https://ipforensics.net/api/v1/currency/convert?apikey=IPF-36ae36a6-4a32-4fae-a422-e45e70b0a515-X&from=USD&to=NGN&amount=500' ,
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' ,
));
$response = curl_exec ($curl);
curl_close ($curl);
echo $response;
Copy var requestOptions = {
method : 'POST' ,
redirect : 'follow'
};
fetch ( "https://ipforensics.net/api/v1/currency/convert?apikey=IPF-36ae36a6-4a32-4fae-a422-e45e70b0a515-X&from=USD&to=NGN&amount=500" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy var axios = require ( 'axios' );
var config = {
method : 'post' ,
url : 'https://ipforensics.net/api/v1/currency/convert?apikey=IPF-36ae36a6-4a32-4fae-a422-e45e70b0a515-X&from=USD&to=NGN&amount=500' ,
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy import requests
url = "https://ipforensics.net/api/v1/currency/convert?apikey=IPF-36ae36a6-4a32-4fae-a422-e45e70b0a515-X&from=USD&to=NGN&amount=500"
payload = {}
response = requests . request ( "POST" , url, data = payload)
print (response.text)
Copy var client = new RestClient ( "https://ipforensics.net/api/v1/currency/convert?apikey=IPF-36ae36a6-4a32-4fae-a422-e45e70b0a515-X&from=USD&to=NGN&amount=500" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . POST );
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy {
"status" : true ,
"code" : 200 ,
"message" : "Successful" ,
"meta_data" : {
"from" : "usd" ,
"to" : "ngn" ,
"amount" : "500" ,
"exchange_rate" : "220,315.02"
}
}
Returns the converted currency.