Real-time precious metals feed

Fri, Nov 20, 2009

Personal, Technology

The other day I downloaded an application that provides a easy to read, auto-updating summary of the current SPOT price of precious metals.  Curiosity had me searching the internet for how this information may be available.  After looking around a while I discovered an automated feed of this information doesn’t come cheap…

So then I decided to investigate how this worked on my new found application.  A network capture revealed the secret mojo happening behind the scenes.

First came the HTTP GET command that looked like this:

GET /iphone/Xignite_GOLD.php HTTP/1.1
Host: www.goldeneaglecoin.com

In the GET request you can see how /iPhone/Xignite_GOLD.php is accepting and handling the request.  Simply replace _GOLD with _SILVER or _PLATINUM to change the desired information. 

Next came the response from the host:

HTTP/1.1 200 OK

Date: Fri, 20 Nov 2009 22:14:11 GMT

Server: Apache/2.0.63 (Unix)
        mod_ssl/2.0.63
        OpenSSL/0.9.8e-fips-rhel5
        mod_auth_passthrough/2.1
        mod_bwlimited/1.4
        FrontPage/5.0.2.2635
        PHP/5.2.8
        mod_perl/2.0.4
        Perl/v5.8.8

X-Powered-By: PHP/5.2.8

Set-Cookie: PHPSESSID=24a6b45a64117faddaebd123648f346e;

Set-Cookie: GOLD=1152.20; expires=Fri, 20-Nov-2009 ...

Set-Cookie: SILVER=18.54; expires=Fri, 20-Nov-2009 ...

Set-Cookie: PLATINUM=1451.00; expires=Fri, 20-Nov-2009 ...

Set-Cookie: PALLADIUM=365.00; expires=Fri, 20-Nov-2009 ...

The body of the content includes much more information about the requested metal:

<pre>Array
(
    [GetLastRealTimeExtendedMetalQuoteResult] => Array
        (
            [Outcome] => Success
            [Identity] => IP
            [Delay] => 0
            [Symbol] => XAUUSDO
            [Type] => XAU
            [Currency] => USD
            [Date] => 11/20/2009
            [Time] => 10:15:32 PM
            [Rate] => 1151.19995117
            [Bid] => 1150.20
            [BidTime] => 10:15:32 PM
            [Ask] => 1152.20
            [AskTime] => 10:15:32 PM
            [High] => 1151.40002441406
            [Low] => 1133.19500732422
            [OneDayDate] => 11/19/2009
            [OneDayPrice] => 1144.98
            [OneDayChange] => 6.22
            [OneDayChangePercent] => 0.54
        )
)
</pre>

This appears to be an array that would be parsed with a typical PHP routine.  Much more information is provided for the requested metal.  With this info you could build any kind of presentation you wanted.

It doesn’t appear that GoldenEagleCoin is doing any checks to see if only their application is performing the requests.  I performed this test using Internet Explorer and wFetch.  Give it a try for yourself…  Perhaps they don’t care, or maybe they will decide to lock it down to their application.

One thing worth noting… Looking at the response you can see that new cookies are being created containing info for each of the primary metals SPOT price, even though I only asked for one metal.  This means you could limit your request to only a single metal, gathering the current buy price for all, if all you wanted was the current ask price.  Pretty nifty…

Perhaps one day I will get a hankering for developing a widget or something with this information… If you decide to write something, please share!

One Response to “Real-time precious metals feed”

  1. Daniel Says:

    I’ve been looking for a good reliable precious metal feed for a while and the information you’re getting is coming from Xignite which offers feeds for 99-789 depending on how many hits you expect which leads me to believe they will clamp this down. Currently I’m using yahoo finance which may work for some people and is free but has some weird bugs which I think have to do with delays. Also it’s limited to US markets as far as I can tell.