Hacker News new | past | comments | ask | show | jobs | submit login
Yahoo Stock Quotes in Go (github.com/doneland)
49 points by emvein on April 14, 2015 | hide | past | favorite | 22 comments

Does anyone know of any true market data sources that are not delayed, free and open for commercial use?

> Does anyone know of any true market data sources that are not delayed, free and open for commercial use?

Short answer: No

Long answer: It depends on what you mean by "true market data". This requires understanding a lot more about how the market and bidding process actually functions, but there really isn't a single canonical price at any point, and there are many ways to define what you're looking for, depending on what you're referring to - all of which are valid according to different assumptions.

Think of it as a special kind of eventually-consistent database. Depending on the consistency model, you can't ask what the value of x is right now, because there are multiple possible values that are all valid. It's only after they converge (which takes time) that a single, canonical value emerges.

This is one of the reasons that quotes are always delayed - it's possible to talk about what the price was at some point in the past, because those ways of defining the price dynamically have all essentially converged to the same value, but it's not possible to pinpoint a single price in the present.

To get all of the various sources of real-time data that can be considered the "current price" requires a lot of low-latency connections to various market players. That's not cheap, so there's nothing that's not delayed and free and available for commercial use.

I was looking into this recently. Here's what looks to be the canonical Stack Overflow post on the subject:


Questions of this nature seem to usually end up pointing to Yahoo's API.

I saw elsewhere (can't locate source at moment) quotes ranging in the $10,000's a month range for real-time data. I'm sure someone on here could provide a more accurate figure.

It's valuable data associated with an industry that's famous for extracting value out of data so I'm not really surprised it's not free.

>quotes ranging in the $10,000's a month range for real-time data.

That sounds excessive. You basically either subscribe to individual exchanges or a consolidated feed from a 3rd party that typically incorporates multiple venues.

For applications that need something professional and reliable, but don't need direct exchange connections (i.e. can deal with ~1-200ms latency), I recommend IQfeed [1]. Depending on exchanges, cost is probably around $100/month

Source: I've been using them for fully automated trading for a couple of years

[1] http://www.iqfeed.net/

Interactive Brokers has a very robust API, and market data fees are $10/month or free if you spend more than $30 on commissions.

(I'm not affiliated, but I've used their services before and have been happy)

>Interactive Brokers has a very robust API

IB's API is anything but robust. It is inconsistent, poorly documented, and IB have a history of changing it without notice.

It also requires all communication runs through their client side Java GUI app, which is also prone to a variety of problems.

That said, IB are a very good low cost broker with amazing product breadth. But I would suggest caution if using their data API for anything remotely serious.

You can always use FIX if you don't like their API, no?

FIX is for execution, market data is still via their API and client software.

...and now you have two problems

IB doesn't have anything approaching "true market data" though. The best you can get are consolidated "snapshots" every 250ms or so.

What level are you looking for? There are a lot of ways to define that stream. Last trade, book data, etc. What degree of latency is tolerable for your application?

Bloomberg's API is real-time, but you have to pay for how much data is consumed.

> Have you seen sample code using a JSON API?

Of course.

> Yeah, but have you seen sample code using a json API.... * IN GO!?!? *



Is this just a Go Wrapper for the Yahoo Finance API?

Looks like it!

Related: I hacked Quote Stream (https://github.com/nodesocket/quote-stream) together a while ago. It pushes real-time quotes (not delayed) from Google to your browser via websockets using node.js.

Heads up, it has not been touched in 3 years.

I wrote something similar in Go about one year ago for my IRC bot.

I never thought it'd be useful for anyone, but well, I guess it can :P

If you wanted it...

I've done something similar using Haskell: https://github.com/agrafix/yahoo-finance-conduit I tried to do this using a streaming approach (conduits), but the data is delayed and there is no real streaming api.

Unrelated, but is Google Finance never going to get updated?

Doesn't look like the API side will make a comeback at least.

What sites do you all use to check up on your stocks, read news etc?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact