Best Stock APIs and Industry Landscape in 2021

The stock API industry, and financial data in general, have nuances that explain quality, evolution, and how knowing this can benefit your algorithms.

Table of Contents:

Stock API landscape
Stock API landscape
Original Photo by NASA on Unsplash

Executive Summary

Stock API “Gotchas” — Common Pitfalls to Avoid

*Anxiety Increases*

An unreliable stock market data source will throw a wrench into your trading application.
An unreliable stock market data source will throw a wrench into your trading application.
Photo by Christian Erfurt on Unsplash

Adjusted vs Unadjusted historical prices

What happens when your stock API gives you unadjusted prices
What happens when your stock API gives you unadjusted prices
What a wonky graph!

Aggregation vs Exchange specific

Current Quotes vs Historical

Always look for oddities or patterns

Wait! What about Yahoo Finance API or Google Finance API?

the Yahoo Finance website still allows users to download certain stock market data, but the glorious days of Yahoo Finance AP
the Yahoo Finance website still allows users to download certain stock market data, but the glorious days of Yahoo Finance AP
Source: Yahoo Finance

Best Stock APIs to Use

Alpha Vantage

import requests
import json
key = 'XXX'
ticker = 'AAPL'
url = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol={}&apikey={}'.format(ticker, key)
response = requests.get(url)
print(response.json())

Polygon.io

import requests
import json
key = 'XXX'
ticker = 'GOOG'
url = 'https://api.polygon.io/v1/last/stocks/{}?apiKey={}'.format(ticker, key)
response = requests.get(url)
print(response.json())

Xignite

import json
import requests
token = 'XXXXX'
# Register for a token here: https://www.xignite.com/Register
url = "http://globalcurrencies.xignite.com/xGlobalCurrencies.json/ListCurrencies?_token={}".format(token) response = requests.get(url)
print(response.json())

IEXCloud

import json
import requests

token = 'XXXX'
# Register here https://iexcloud.io/cloud-login#/register/
symbol = 'IBM'
url = 'https://cloud.iexapis.com/stable/stock/{}/quote?token={}'.format(symbol, token)
response = requests.get(url)
print(response.json())

Intrinio

import json
import requests

key = 'XXXX'
# Register here at https://intrinio.com/
ticker = 'FB'
url = 'https://api-v2.intrinio.com/companies/{}?api_key={}'.format(ticker, key)
response = requests.get(url)
print(response.json())

Summary

Breathe… There is a lot to think about when it comes to stock APIs!
Breathe… There is a lot to think about when it comes to stock APIs!
Photo by Fabian Møller on Unsplash

Chainlink developer advocate, fintech data engineer, and human performance buff. https://alphachain.io/blogs. 🔵⛓🐸🥑

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store