Check Bitcoin Balance with mybitx api https GET url

Charles Adeyemo Source

I am new to integrating bitcoin API to my PHP page, I have created a bitcoin account with luno, I have created API Key.

I have been given this url to get balance using my generated API Key:

$ curl -u keyid:keysecret

Can anybody help with a proper example on how I can use my API with this given url to display my wallet balance on a PHP page?



answered 6 months ago Michael #1

The easiest way I know to convert curl commands to executable PHP code is to use this site:

Just add your curl command:

curl -u keyid:keysecret

to the textbox that says "Paste curl here". Then take the PHP that is output and integrate it into your app.

answered 6 months ago Sudheesh Singanamalla #2

You can use the PHP Requests library for an easy way to make HTTP Requests. Your curl command can be converted as follows:

    // Use additional headers if necessary
    $headers = array();
    // Create authorization using key and secret.
    $options = array('auth' => array('keyid', 'keysecret'));
    // Create the GET request to the URL
    $response = Requests::get('', $headers, $options);
    // The result is available in $response

comments powered by Disqus