The most popular and useful Python libraries and APIs for different free market-data services and sources.

yfinance

Yfinance offers a threaded and Pythonic way to download market data from Yahoo Finance.

Yfinance is an open-source tool that uses Yahoo's publicly available APIs (yfinance is not affiliated, endorsed, or vetted by Yahoo, Inc.), and is intended for research and educational purposes.

Nasdaq Data Link (ex Quandl)

Most datasets on Nasdaq Data Link are available directly in Python, using the Nasdaq Data Link Python module. The Nasdaq Data Link Python package is free to use and grants access to all free datasets. Users only pay to access Nasdaq Data Link’s premium data products.

Alpha Vantage

Alpha Vantage APIs are grouped into six categories: (1) Core Time Series Stock Data APIs, (2) Alpha Intelligence, (3) Fundamental Data, (4) Physical and Digital/Crypto Currencies (e.g., Bitcoin), (5) Economic Indicators, and (6) Technical Indicators.

pandas-datareader

Pandas Datareader is a Python package that allows us to create a pandas DataFrame object by using various data sources (AlphaVantageBank of CanadaEurostatMoscow Exchange (MOEX)NASDAQQuandlYahoo Finance, and many more).

IBApi / TWS API

The TWS API is a simple yet powerful interface to automate your trading strategies, request market data, and monitor your account balance and portfolio in real time. Build your own trading application or connect your custom application to TWS so that you can take advantage of our advanced trading tools.

Twelve Data

Data is available in pandas, json and csv formats. About 100 available and ready-for-use technical indicators. Static and interactive charts from the same source as financial data. Many subsidiary methods to build from simple applications to ML & AI projects.

Tiingo

Tiingo is a financial data platform that makes high quality financial tools available to all. They have a RESTful and Real-Time Data API. Presently, the API includes support for the following endpoints: Stock Market Ticker Closing Prices + Metadata. Data includes full distribution details and is validated using a proprietary EOD Price Engine;  Curated news from top financial news sources + curated blogs. Stories are tagged by Tiingo’s algorithms.

Polygon .io

Polygon.io has several Open Source projects that you can use to easily interact with our financial data APIs. Polygon.io also provides client libraries for Python.

Finnhub

The API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. 

Tradier

Rrealtime data for US-based stocks and options is available only to Tradier Brokerage account holder.