Author

Topic: API to get price of a silver (or other PM) in BTC? (Read 4153 times)

sr. member
Activity: 448
Merit: 251
Bitcoin
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.

full member
Activity: 221
Merit: 100
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.
sr. member
Activity: 448
Merit: 251
Bitcoin
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.



sr. member
Activity: 286
Merit: 251
You can use the Perl module Finance::Quote::GoldMoney

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

sr. member
Activity: 448
Merit: 251
Bitcoin
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


sr. member
Activity: 406
Merit: 250
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.
donator
Activity: 1218
Merit: 1079
Gerald Davis
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.
donator
Activity: 1218
Merit: 1079
Gerald Davis
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.
donator
Activity: 1218
Merit: 1079
Gerald Davis

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.
legendary
Activity: 1031
Merit: 1000
sr. member
Activity: 406
Merit: 250
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
hero member
Activity: 743
Merit: 500
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!
donator
Activity: 1218
Merit: 1079
Gerald Davis
here is nice website but I am not sure Ag and Au is there :-(
https://openexchangerates.org
try to share API with Gary https://bitcointalksearch.org/topic/m.1366595

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.
hero member
Activity: 743
Merit: 500
here is nice website but I am not sure Ag and Au is there :-(
https://openexchangerates.org
try to share API with Gary https://bitcointalksearch.org/topic/m.1366595
sr. member
Activity: 406
Merit: 250
I might be able to whip something up...PM inbound.
donator
Activity: 1218
Merit: 1079
Gerald Davis
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.
sr. member
Activity: 382
Merit: 253
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.
donator
Activity: 1218
Merit: 1079
Gerald Davis
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.
Jump to: