Bitcoin Forum
May 11, 2024, 04:56:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin to USD  (Read 470 times)
ravininave (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
September 22, 2016, 09:16:08 AM
 #1

Hello,
I'm using blockchain api to receive payment using my web app.  When user makes payment I got response on callback url but I received the value in satoshi and if I divided it with 10000000.. then it converts it to btc.
The question is how to convert that btc to usd.?  Is there any api for that or any calculations?
Please help
1715403389
Hero Member
*
Offline Offline

Posts: 1715403389

View Profile Personal Message (Offline)

Ignore
1715403389
Reply with quote  #2

1715403389
Report to moderator
1715403389
Hero Member
*
Offline Offline

Posts: 1715403389

View Profile Personal Message (Offline)

Ignore
1715403389
Reply with quote  #2

1715403389
Report to moderator
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715403389
Hero Member
*
Offline Offline

Posts: 1715403389

View Profile Personal Message (Offline)

Ignore
1715403389
Reply with quote  #2

1715403389
Report to moderator
1715403389
Hero Member
*
Offline Offline

Posts: 1715403389

View Profile Personal Message (Offline)

Ignore
1715403389
Reply with quote  #2

1715403389
Report to moderator
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3472
Merit: 6131



View Profile
September 22, 2016, 09:43:13 AM
 #2

Hello,
I'm using blockchain api to receive payment using my web app.  When user makes payment I got response on callback url but I received the value in satoshi and if I divided it with 10000000.. then it converts it to btc.
The question is how to convert that btc to usd.?  Is there any api for that or any calculations?
Please help


Bitcoin price is based on supply-demand so there is no calculation for it . It's possible to use Blockchain.info API to get the price , though : https://blockchain.info/api/exchange_rates_api

BTC to USD : https://blockchain.info/ticker
USD to BTC : https://blockchain.info/tobtc?currency=USD&value=500 (where 500 is the USD value)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ravininave (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
September 22, 2016, 09:58:58 AM
 #3

Brother, thanking you for your quick reply, I already seen those APIs
But tell me if I received 0.0012 BTC then how could I come to know that I received $???.
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3472
Merit: 6131



View Profile
September 22, 2016, 10:37:47 AM
 #4

Brother, thanking you for your quick reply, I already seen those APIs
But tell me if I received 0.0012 BTC then how could I come to know that I received $???.


The first link should give you the price of 1 BTC and return it on JSON , once you get that you do the math. If 1 BTC = 600$ for example then you simply do 600*0.0012 = 0.72$ (72 cents) , as simple as that.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
smho_16
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
September 23, 2016, 03:17:30 PM
 #5

Or when you go to blockchain.info and check the transaction there. As a beginning it shows the value in BTC ,if you single click on that value it shows it's value in USD then.

Here is an example

https://blockchain.info/address/1F6KPtop1urnrxpwuZvskDrc9RE9aP648

This will show all of the transactions of this btc address 1F6KPtop1urnrxpwuZvskDrc9RE9aP648 and it will show their value in BTC, single click on any of them to see their value in USD.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!