Check Bitcoin Balance with mybitx api https GET url

0 votes

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 https://api.mybitx.com/api/1/balance

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?

Sep 12, 2018 in Blockchain by digger
• 26,740 points

retagged Nov 22, 2018 by Priyaj 2,544 views

2 answers to this question.

0 votes

The easiest way I know to convert curl commands to executable PHP code is to use this site: https://incarnate.github.io/curl-to-php/

Just add your curl command:

curl -u keyid:keysecret https://api.mybitx.com/api/1/balance

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

answered Sep 12, 2018 by slayer
• 29,370 points
0 votes

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

<?php
    include('vendor/rmccue/requests/library/Requests.php');
    Requests::register_autoloader();
    // 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('https://api.mybitx.com/api/1/balance', $headers, $options);
    // The result is available in $response
?>
answered Sep 17, 2018 by Lalit

Related Questions In Blockchain

0 votes
1 answer

How to get iota balance via api url?

Either run your own node (thus, the localhost reference ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
1,006 views
0 votes
1 answer

How to get price from bitcoin to USD with api

If I'm not wrong, is this what ...READ MORE

answered Apr 7, 2022 in Blockchain by Aditya
• 7,680 points
2,882 views
0 votes
0 answers

API - Convert Bitcoin Amount into USD with my Api

After apiv2.bitcoinaverage.com is not free anymore I ...READ MORE

Mar 2, 2022 in Blockchain by Aditya
• 7,680 points
1,021 views
+1 vote
0 answers

How to check a Bitcoin wallet balance from first generated address (m/44'/0'/0'/0/0)

Is there a way to check a ...READ MORE

Mar 4, 2022 in Blockchain by Soham
• 9,710 points
2,236 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
45,222 views
0 votes
1 answer

How do I add multiple recipients for transactions via Blockchain API?

Convert the recipes into JSON objects. x = ...READ MORE

answered Jul 6, 2018 in Blockchain by Perry
• 17,100 points
890 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,927 views
0 votes
1 answer

PHP. Bitcoin to Ukrainian Hrivna price ticker

nstead of dividing the values - i ...READ MORE

answered Sep 11, 2018 in Blockchain by slayer
• 29,370 points
922 views
0 votes
2 answers

How to check if bitcoin address is valid?

For Java, have a look at the ...READ MORE

answered Aug 20, 2018 in Blockchain by Omkar
• 69,220 points
3,229 views
0 votes
1 answer

How to open bitcoin-qt wallet with bitcoinj?

I found this issue solved at the ...READ MORE

answered Aug 24, 2018 in Blockchain by slayer
• 29,370 points
707 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP