Bitcoin Forum
May 28, 2024, 09:06:18 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: API to get price of a silver (or other PM) in BTC?  (Read 4134 times)
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 01, 2013, 09:14:14 PM
Last edit: January 02, 2013, 02:54:06 AM by DeathAndTaxes
 #1

I doubt one exists for BTC but using any one of the numerous BTC spot price APIs combine with a spot price API for silver it shoudn't be too difficult.

The problem is that finding spot prices of silver or other precious metals (in any currency) has been difficult.  I found one commercial webservice but at $4,000 for per minute quotes I think I will pass.
ShireSilver
Sr. Member
****
Offline Offline

Activity: 382
Merit: 253



View Profile WWW
January 01, 2013, 10:32:21 PM
 #2

You can screen-scrape to get silver prices. Get them from several places, toss out the obviously bad ones, and average the rest; if you want redundancy.

XE.com is $540/year and you can choose XAG for silver ounces, but that's still ridiculously expensive IMHO.

Shire Silver, a better bullion that fits in your wallet. Get some, now accepting bitcoin!
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 02, 2013, 02:53:54 AM
 #3

You can screen-scrape to get silver prices. Get them from several places, toss out the obviously bad ones, and average the rest; if you want redundancy.

XE.com is $540/year and you can choose XAG for silver ounces, but that's still ridiculously expensive IMHO.

Yeah I was thinking about scraping or using a low cost brokerage account and scrapping from that.  I was kinda hoping an API existed.  I will take a look at XE.COM.  $540 is sill kinda excessive but it is a lot cheaper than $4K.
gusti
Legendary
*
Offline Offline

Activity: 1099
Merit: 1000


View Profile
January 02, 2013, 03:13:17 AM
 #4

daily prices ok ?
http://www.quandl.com/OFDP-Open-Financial-Data-Project/SILVER_5-LBMA-Silver-Price-London-Fixings

If you don't own the private keys, you don't own the coins.
Eveofwar
Sr. Member
****
Offline Offline

Activity: 406
Merit: 250


View Profile
January 02, 2013, 04:35:05 AM
 #5

I might be able to whip something up...PM inbound.
World
Hero Member
*****
Offline Offline

Activity: 743
Merit: 500



View Profile
January 02, 2013, 05:17:21 PM
 #6

here is nice website but I am not sure Ag and Au is there :-(
https://openexchangerates.org
try to share API with Gary https://bitcointalk.org/index.php?topic=43616.msg1366595#msg1366595

Supporting people with beautiful creative ideas. Bitcoin is because of the developers,exchanges,merchants,miners,investors,users,machines and blockchain technologies work together.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 02, 2013, 05:51:40 PM
 #7

here is nice website but I am not sure Ag and Au is there :-(
https://openexchangerates.org
try to share API with Gary https://bitcointalk.org/index.php?topic=43616.msg1366595#msg1366595

Nice site.  Looks like they don't support PM yet but plan to "soon".  Hell if they ended up supporting PM and BTC well that would be pure WIN.

Quote
Do you provide rates for precious metals?

Not at the moment (as of November 2012) - this is a planned addition to both the free and paid API service, which should be available by early 2013.
World
Hero Member
*****
Offline Offline

Activity: 743
Merit: 500



View Profile
January 02, 2013, 06:10:29 PM
 #8

there is already support for BTC from
Quote
10th Dec 2012: Bitcoin (BTC) volume-weighted average rate now available for all Open Exchange Rates API users!

Supporting people with beautiful creative ideas. Bitcoin is because of the developers,exchanges,merchants,miners,investors,users,machines and blockchain technologies work together.
Eveofwar
Sr. Member
****
Offline Offline

Activity: 406
Merit: 250


View Profile
January 03, 2013, 02:27:07 AM
Last edit: January 03, 2013, 03:25:41 AM by Eveofwar
 #9

I might be able to whip something up...PM inbound.

I've finished the application.  It currently pulls the last local USD trade from http://mtgox.com/api/1/BTCUSD/ticker and then grabs the Kitco chart from http://www.kitco.com/images/live/silver.gif...crops the image to only the "- Jan 02 Last 31.050" section then scales it up 10x (improved OCR detection/accuracy).  OCR functions are then performed on the image and just the price is grabbed from that line.  Once both values are available, the last MtGox USD price is divided by the last Silver USD spot price and rounded to the 4th decimal and then the result is output to file Smiley
sunnankar
Legendary
*
Offline Offline

Activity: 1031
Merit: 1000



View Profile WWW
January 03, 2013, 02:43:42 AM
 #10

daily prices ok ?

This .csv has the spot, 50dma and 200dma updated every 10 minutes.

DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 04, 2013, 01:26:01 AM
 #11


Awesome.  Just tracked it today and it was within 0.5% of so of realtime throughout the day.  We have a winner.  Hopefully https://openexchangerates.org adds PM to their lineup but this will work in the meantime.  If you have a donation address I'll throw you a tip.  It is very hard to find even 10 minute quotes on PM in text form.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 04, 2013, 01:27:20 AM
 #12

I might be able to whip something up...PM inbound.

I've finished the application.  It currently pulls the last local USD trade from http://mtgox.com/api/1/BTCUSD/ticker and then grabs the Kitco chart from http://www.kitco.com/images/live/silver.gif...crops the image to only the "- Jan 02 Last 31.050" section then scales it up 10x (improved OCR detection/accuracy).  OCR functions are then performed on the image and just the price is grabbed from that line.  Once both values are available, the last MtGox USD price is divided by the last Silver USD spot price and rounded to the 4th decimal and then the result is output to file Smiley

I hope you didn't spend too much time on it. I didn't ask anyone to write anything for me.   I am not found of screen captures because they are fragile and for the application I am looking at if it broke and reported incorrect data it could be costly.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 04, 2013, 01:28:50 AM
 #13

there is already support for BTC from
Quote
10th Dec 2012: Bitcoin (BTC) volume-weighted average rate now available for all Open Exchange Rates API users!


Good to know.  I didn't see it in their list of supported currencies but I am glad they added BTC.  Now if they add PM it would be perfect.  In the meantime the csv at runtogold will work.  Long term that site is a really nice resource.  I hope they keep expanding and improving it.  If you have a donation address I will send a tip your way.
Eveofwar
Sr. Member
****
Offline Offline

Activity: 406
Merit: 250


View Profile
January 04, 2013, 02:07:26 AM
 #14

I might be able to whip something up...PM inbound.

I've finished the application.  It currently pulls the last local USD trade from http://mtgox.com/api/1/BTCUSD/ticker and then grabs the Kitco chart from http://www.kitco.com/images/live/silver.gif...crops the image to only the "- Jan 02 Last 31.050" section then scales it up 10x (improved OCR detection/accuracy).  OCR functions are then performed on the image and just the price is grabbed from that line.  Once both values are available, the last MtGox USD price is divided by the last Silver USD spot price and rounded to the 4th decimal and then the result is output to file Smiley

I hope you didn't spend too much time on it. I didn't ask anyone to write anything for me.   I am not found of screen captures because they are fragile and for the application I am looking at if it broke and reported incorrect data it could be costly.

No worries, it was a fun and interesting project Smiley

I agree that screen captures aren't the best source for this, but having the data in realtime is a plus.  Finally tweaked the cropped image a bit to reduce variation and increase accuracy.  I'm liking it so far, may just keep it for personal use.
the founder
Sr. Member
****
Offline Offline

Activity: 448
Merit: 251


Bitcoin


View Profile WWW
March 13, 2013, 04:05:31 PM
 #15

Sorry for being late... this has existed for quite some time.

http://www.ounce.me

and the RSS feed / API for bitcoin / silver / gold / etc is here:

http://www.ounce.me/rss.xml



Bitcoin RSS App / Bitcoin Android App / Bitcoin Webapp http://www.ounce.me  Say thank you here:  1HByHZQ44LUCxxpnqtXDuJVmrSdrGK6Q2f
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 13, 2013, 04:06:39 PM
 #16


Nice one.
mintymark
Sr. Member
****
Offline Offline

Activity: 286
Merit: 251


View Profile
March 13, 2013, 04:11:37 PM
 #17

You can use the Perl module Finance::Quote::GoldMoney

This scrapes the goldmoney home page and gives prices for Gold, Silver, Platinum, and Paladium.


[[ All Tips gratefully received!!  ]]
15ta5d1N8mKkgC47SRWmnZABEFyP55RrqD
the founder
Sr. Member
****
Offline Offline

Activity: 448
Merit: 251


Bitcoin


View Profile WWW
March 13, 2013, 04:24:15 PM
 #18

You can use the Perl module Finance::Quote::GoldMoney

This scrapes the goldmoney home page and gives prices for Gold, Silver, Platinum, and Paladium.



That's why I like the ounce.me one... it's not a scraper...  uses the quotes from the ETF's , factors out the commissions and presents a very accurate figure,  for BTC it goes to several exchanges, averages them, and gives a very accurate figure.

It's most likely the most accurate number that you can get.




Bitcoin RSS App / Bitcoin Android App / Bitcoin Webapp http://www.ounce.me  Say thank you here:  1HByHZQ44LUCxxpnqtXDuJVmrSdrGK6Q2f
debianlinux
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
March 13, 2013, 04:31:01 PM
 #19

So, what this REALLY does is compare the price of PM to USD and the price of BTC to USD and make a correlation. Both values are still pegged to USD. Wake me up when we are directly pricing PM in BTC with little to no correlation to USD.
the founder
Sr. Member
****
Offline Offline

Activity: 448
Merit: 251


Bitcoin


View Profile WWW
March 13, 2013, 04:40:35 PM
 #20

So, what this REALLY does is compare the price of PM to USD and the price of BTC to USD and make a correlation. Both values are still pegged to USD. Wake me up when we are directly pricing PM in BTC with little to no correlation to USD.

Will do the second you go to the local grocery store and buy everything in BTC easily....  dude I agree with you.. .but we're a VERY long way from that... though I have to say that more options are becoming available recently.

Plus there's still a lingering argument that never went away from it's inception.   Bitcoin most likely isn't a currency, but a commodity .. like Gold, Silver or Oil ...   and I doubt most people would want it any other way... the second is becomes a "currency"  then it opens a can of worms with regulations, etc.


Bitcoin RSS App / Bitcoin Android App / Bitcoin Webapp http://www.ounce.me  Say thank you here:  1HByHZQ44LUCxxpnqtXDuJVmrSdrGK6Q2f
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!