Currency Conversion Endpoint

Using the convert endpoint, you may request the IpForensics API to perform a Single currency conversion on your behalf. e.g converting $500 Dollars to Naira

To use this endpoint, simply specify a from currency code, a to Currency Code, and the amount you would like to convert.

Each request to the currency conversion endpoint consumes 1 token.

Code Snippet

<?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;

Sample Response

{
    "status": true,
    "code": 200,
    "message": "Successful",
    "meta_data": {
        "from": "usd",
        "to": "ngn",
        "amount": "500",
        "exchange_rate": "220,315.02"
    }
}

Endpoint

Returns the converted currency.

GET https://ipforensics.net

Returns response object and a metadata of the request

Query Parameters

NameTypeDescription

apikey*

String

Your API key

from*

String

Specify the currency to convert from.

to*

String

Specify the currency to convert to.

amount*

String

Specify the amount to convert.

{
    "status": true,
    "code": 200,
    "message": "Successful",
    "meta_data": {
        "from": "usd",
        "to": "ngn",
        "amount": "500",
        "exchange_rate": "220,315.02"
    }
}

Last updated