0
$\begingroup$

I need to compile stock price data for ADR and ORD pairs (and the currency between them) into a Pandas dataframe. I just started using the Alpha Vantage API for this, which works great for getting the US-listed stock prices (at the minute timescale) and the currency rate, but I haven't figured out how to get the foreign-listed stock prices (ORDs). I was almost positive it would've simply been a ticker.exchange type input, but that hasn't seemed to work.

The code below is what I've used in my Jupiter Notebook to get the ADR for Diageo Plc.

from alpha_vantage.timeseries import TimeSeries
from pprint import pprint
ts = TimeSeries(key='YOUR_AV_KEY', output_format='pandas')
data, meta_data = ts.get_intraday(symbol='DEO',interval='1min', outputsize='full')
pprint(data.head(20))

To find the ticker.exchange symbol for Diageo Plc. on the London exchange, I used this query: https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=Diageo&apikey=$

which gave DGE.LON as the ticker.exchange code. When switching 'DEO' in the above code with 'DGE.LON', I get the following error: Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for TIME_SERIES_INTRADAY

Is the time series intraday API only for US equity? Is there a way for me to get minute by minute pricing data for DGE.LON through Alpha Vantage?

$\endgroup$

2 Answers 2

0
$\begingroup$

Is the time series intraday API only for US equity? It only works for equities listed on US exchanges.

AlphaVantage computes intraday data directly from the market-aggregated data feed of the Securities Information Processors (SIP), which is also written in the documentation. SIP links the US markets by processing and consolidating all bid/ask quotes and trades from every trading venue into a single data feed (you can read more about it here). This implies that the intraday data feed is solely based on US exchanges and therefore symbol calls like "DGE.LON" does not work in this setup.

You can, however, get daily adjusted close values from London stock exchange using the call:

data, meta_data = ts.get_daily_adjusted(symbol='DGE.LON', outputsize='full')

If you want to use intraday data from London stock exchange, you have to find other means of obtaining the data.

$\endgroup$
1
  • 1
    $\begingroup$ As of today, SIP quotes are based on round lots (so not all quotes are consolidated into NBBO). The effective bid/ask spread is usually smaller taking odd lots into account. The difference is particularly pronounced in higher priced stocks. $\endgroup$ Feb 26, 2021 at 6:26
0
$\begingroup$

You can also use yfinance, the inofficial yahoo finance api, to download that kind of market data. I worked on a student project latetly and wrote a function which you can find underneath:

   import numpy as np
   import pandas as pd
   import yfinance as yf
    
   def get_tickers(stocks, start, end):
     stocks = pd.DataFrame()
     tickers = stocks
     for ticker in tickers:
        stockdata = yf.download(ticker, start = start, end=end, progress=False)
     stockdata.columns = stocks
     return stocks
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.