Overview
In this how to guide, we will show you how simple it is to use Intrinio to efficiently query realtime stock price data. In this example we will be using Python however, you can use any one of our client SDKs or query our REST API directly using your programming language of choice.
Prerequisites
- Create an account to get an API key
- Sign up for a free trial (of IEX)
- Contact sales if you wish to trial Nasdaq Basic or Delayed SIP
- Choose which SDK you wish to use Python, Javascript/Node, C#, Java, Ruby, or R.
- Use pip to install the intrinio sdk. (This how to assumes you already have python installed)
Procedure
Using the Realtime Stock Price for Security API we can get a stock price for any active security. Create new file named example.py and add the following code updating your api key.
You'll receive the latest stock price ask and bid for a single stock. This is perfect if you only need to track a small handful of stocks. What if you need more? Or all of them? (Let's be real, you probably need all of them). The best thing to do use our Realtime Stock Price for Exchange API
"What's USCOMP you ask?" USCOMP is just a composite of all of the US Stock Exchanges (including NYSE, Nasdaq, etc) and is the typically way to query for US stock prices on our API's.
Now, if you are still reading this and not integrating the above API's into your app right now that your use case is probably different. You might be thinking "that is great and all but I need the data faster than I could poll from a REST api. Many stocks trade multiple times a second!" For this scenario, take a look at our guide for streaming stock price data.
Alternatively, you might be thinking, "well yeah, I will need realtime data eventually, but for now I just need to prove my brilliant idea using EOD stock price data." For this historical end of data stock price scenario, check out our Stock Prices by Security and Stock Prices by Exchange APIs.
Conclusion
Hopefully this helped. Seriously, our love language is acts of service.
Questions? Comments? Ready to buy? Contact sales@intrinio.com.