from quantel import Quantel
Before we can pull information, we must instantiate the
Quantel class and authenticate to the API
qt = Quantel(api_key="<quantel-api-key>")
Your API key will be validated during the Quantel class instantiation.
To retrieve data from Quantel for a single stock, create an instance of the
ticker class by passing the company's
ticker symbol as an argument:
aapl = qt.ticker('aapl')
Or, pass in multiple symbols to retrieve data for multiple companies. Symbols can be passed in as a list:
symbols = ['fb', 'aapl', 'amzn', 'nflx', 'goog'] tickers = qt.ticker(symbols)
Tickers parsed as uppercase or lowercase, it doesn't matter.
They can also be passed in as a string:
symbols = 'FB AAPL AMZN NFLX GOOG' tickers = qt.ticker(symbols)
The Quantel API supports parsing multiple tickers (up to 30) to the same endpoint e.g.
The Quantel Python library will handle this automatically. As such, the below code will only make one request to the API.
from quantel import Quantel qt = Quantel(api_key="<quantel-api-key>") symbols = 'fb aapl amzn nflx goog' tickers = qt.ticker(symbols) # Retrieve each company's profile information data = tickers.profile()