does anyone know how Google or Yahoo get the stock quotes as NASDAQ or NYSE is not providing any APIs? Can we actually replicate what they do? are they using the crawl method itself or rather is crawling a开发者_StackOverflow中文版ctually possible to get such data realtime?
Working @financial software company I can advice you that these services are paid for. I don't know actual figures, but I never encountered realtime quotes available free of charge.
To get those real-time feeds you are given with credentials & connection parameters which you will use to connect to provider's server (over FIX or propietary protocol). So, there's simply no 'free' source, only paid ones.
Quote providers, in turn, are paying to ultimate source of feeds -- exchanges. You can always contact NYSE to negotiate getting quotes. If you will do, please, post here negotiated price (or, at least, it's magnitude).
Check bloomberg and reuters products.
By the ways, those things cost an arm and a liver.
This is the code which can be modified with the correct Yahoo code for realtime.
http://criticalstocks.tumblr.com/post/732137771/perl-stock-quotes-from-yahoo
Last Trade (Real-time) with Time k1 Bid (Real-time) b3 Ask (Real-time) b2 Change Percent (Real-time) k2 Change (Real-time) c6 Holdings Value (Real-time) v7 Day's Value Change (Real-time) w4 Holdings Gain Pct (Real-time) g5 Holdings Gain (Real-time) g6 Day's Range (Real-time) m2 Market Cap (Real-time) j3 P/E (Real-time) r2 After Hours Change (Real-time) c8 Order Book (Real-time) i5
Both Google and Yahoo offer an API to get quotes, but they have a 20 minute delay. If you want real time, you pretty much need to pay, as far as I know.
As for the delayed ones, I find Google's API easier to use, but Yahoo provides also international indexes.
精彩评论