As with most great ideas (not saying this one is great, but just follow me here), they are generally thought up and developed out of necessity. Ruby on Rails was developed by 37signals for internal use, but was released to the general public and has caused a massive “Happy Coder” movement.
With that said, my idea probably won’t start a movement, but it will allow more web services to take advantage of real-time stock quotes by providing a simple xml api (+ JSON very soon). For now, the beta API only includes access to the actual stock prices + monetary and percentage change. My private API, I guess it would be the beta’s beta, includes access to more analytical data. These features should be released within the coming weeks [2, max].
The API is one of my first attempts at RESTful API design, and, although simple, this realtime stock quote API is technically RESTful. As it begins to incorporate more features, the RESTful design will become more evident, as in GET, POST, DELETE, and UPDATE http requests. As of now, the API simply includes one URL:
http://judstephenson.com/api/Quotes/Realtime/Symbol
Examples of which include:
http://judstephenson.com/api/Quotes/Realtime/aapl
http://judstephenson.com/api/Quotes/Realtime/amagx
http://judstephenson.com/api/Quotes/Realtime/xoho
I am working on offering a JSON option for the data output (with a callback of course), but as of right now, only XML output is supported, but it isn’t that complicated to parse. Since this API is a simple one-liner, the documentation for it is sparse [read: non-existant], but you should be able to get the hang of it.
Now for the disclaimer: This API is released to the public without any warranty, expressed or implied. I am not responsible for any damage you do with it (if thats possible) and I can not guarantee its 100% uptime (although it shouldn’t ever go down). You are free to use this API in an suitable manner, although, if the traffic to the API becomes too much of a strain on the server, I may limit the number of requests/hr. Other than that, have fun hacking away.
Update: The realtime stock quotes api has been updated! New features include json output with the ability to have a user-definable callback function.
Hello Jud:
I think the REST api is a great idea. Simple & fast way of getting real-time quotes. I will be using this in a web application that I am working on.
If you don’t mind, could you please tell me where you are able get the real-time stock data from ? Are you using some sort of api or “screen scraping” ?
Thanks
Sai
Hey Sai,
I am using an unofficial API from google finance. A lot better than “screen scraping” and keeps the data payloads small, so the response times are really fast.
-Jud
Thanks for the info Jud. I agree that srceen scraping is not efficient.
Thanks
Sai
Jud:
I was looking at Google Finance API and they only allow accessing stock information for portfolios. Is there some other API that Google offers ?
Thanks
Sai
Hello Jud,
Do you know when/if the google api will be public?
Thanks,
David
Hey David, the google api will probably be left private if I had to guess. Although, I am not on the “inside track” when it comes to release times.
-Jud
Hi Sai,
Where did you get your api from? Im trying to create a similar service as you but with multiple sources, yahoo provdes easy access but google is quite restrictive apart from screen scraping which id rather not do.
Thanks
rhys
It’s a great RESTful service.
Do you support batch operation? How to request multiple quotes in one http request?
Thanks,
Sean