Mapping a Ticker Symbol to ISIN using OpenFIGI & lemon.markets

Joanne Snel
lemon.markets
Published in
5 min readOct 20, 2021

When you start trading on different exchanges, you’ll notice that sometimes they have unique ways of identifying financial instruments. For example, US exchanges often use tickers, whereas German exchanges reference an ISIN. And sometimes, moving between these symbologies isn’t as smooth as you’d expect.

Using more than one source of information for trading a stock might mean that you need to build your own mapping system to line up incompatible instrument identifiers. Of course, a quick Google search can easily lead you to the appropriate identifier. But this needs to be performed manually. Instead, automate the process by writing (less than 10 lines of) code to make this ‘translation’ for you. Keep reading to learn how you can use the OpenFIGI and lemon.markets APIs to map tickers to ISINs.

What’s a ticker?

A ticker, or stock symbol, is a series of one to five alphanumeric characters (in other words, letters & numbers) that uniquely represents a financial instrument listed on an exchange. For example, you might have seen someone tweeting about $TSLA (also referred to as a ‘cashtag’) or read a headline referencing AAPL — both are stock symbols (for Tesla and Apple, respectively). Very often, they’re used as a way to refer to a particular security without having to reference the name in full (that would be Tesla, Inc. and Apple Inc.) However, a different exchange might list a security under a different stock symbol, for example, the Munich Stock Exchange lists Apple as APC.

If you are building an automated trading strategy, this might cause problems if you are collecting market data from international sources. Your trading decisions/rules might not refer to the correct instrument or, even worse, no instrument at all (if your provider does not recognise the symbol you feed it).

Ticker to ISIN

Most European brokerage providers use the ISIN (International Securities Identification Number) as a means to uniquely identify financial instruments. lemon.markets, a start-up powering automated trading, is much the same: trades are placed by referencing an instrument’s ISIN. However, if you attempt to query for Apple Inc. by searching ‘AAPL’, the endpoint will not return the instrument you are looking for (because it’s listed as ‘APC’). To arrive at the correct ISIN, you’d need to search for the latter. So, how do we go from ‘AAPL’ to ‘APC’? And how do we find out what ticker Tesla is listed under on the Munich Stock Exchange?

Using the OpenFIGI API to find a ticker

The OpenFIGI API can be used to map any kind of securities identification, or ‘symbology’, to a FIGI (or a Financial Instrument Global Identifier). The FIGI of a particular financial instrument is consistent across providers, making research, trading and mapping more seamless. The platform can also be used to obtain other characteristics, such as the exchange code, market sector or ticker.

In this article, we’re interested in going from a US ticker to a German ticker. For that, we access the search endpoint, which allows us to search for FIGIs (and their corresponding tickers) using keywords and other filters. To ensure that we obtain the ticker as listed on the desired German exchange, we specify our search query, ‘TSLA’ and filter using the exchange code ‘GM’, which stands for the Munich Stock Exchange. The POST request looks as follows:

Note: you can only make place 5 requests per minute without an API key, signing up to OpenFIGI will increase this number to 20 requests per minute

This piece of code will return several entries, but for demonstration purposes I’ve listed only the first one, which is also the entry that we’re interested in.

{'data': [{'compositeFIGI': 'BBG000WGWT81',
'exchCode': 'GM',
'figi': 'BBG000WGWVP7',
'marketSector': 'Equity',
'name': 'TESLA INC',
'securityDescription': 'TL0',
'securityType': 'Common Stock',
'securityType2': 'Common Stock',
'shareClassFIGI': 'BBG001SQKGD7',
'ticker': 'TL0'}]
}

Despite searching for the US ticker (the ‘query’ in line 6), the OpenFIGI response returns the German ticker. That’s because we specified that we want results only corresponding to the exchange code GM. We see that the GM ticker is indeed different from the US ticker as Tesla is listed as ‘TL0’ rather than ‘TSLA’. You can change this code to whichever exchange is relevant for your use-case, see a list of all exchange codes here.

Using the lemon.markets API to find an ISIN

Now, we can use the lemon.markets Instrument endpoint to obtain the ISIN that corresponds to this ticker. We do that as follows:

Note that you need to fill in your own API key to run this code snippet.

As you can see, we are using ‘TL0’ as our search query. This returns the following JSON output:

{'results': [{'isin': 'US88160R1014',
'name': 'TESLA INC. DL -,001',
'symbol': 'TL0',
'title': 'TESLA INC.',
'type': 'stock',
'venues': [{'currency': 'EUR',
'is_open': False,
'mic': 'XMUN',
'name': 'Börse München - Gettex',
'title': 'Gettex',
'tradable': True}],
'wkn': 'A1CX3T'}]}

We can now access this ISIN (by the way, this is done like this: request.json().get('results')[0].get('isin')) to place any subsequent trades. If you’d like to place trades on lemon.markets too, join us to get experience the trading API you’ve been waiting for.

And there we have it, we have successfully mapped a US ticker to an ISIN (by means of the GM ticker). From here on out, the possibilities are endless. For example, you might want to create a trading strategy based on the sentiment expressed in tweets. Cashtags are usually US tickers, but to trade on lemon.markets, you need the ISIN or GM ticker. OpenFIGI to the rescue! Read our article on beginner-friendly trading strategies to learn how you can use lemon.markets to trade based on sentiment analysis. Or, you might quickly want to determine whether a certain Australian stock is also traded on the Munich Stock Exchange: a simple POST request to the OpenFIGI API will answer this query. Thus, when your mean reversion strategy suggests purchasing shares of WOW, you’ll know that it’s tradable on lemon.markets, albeit under the ticker symbol WWR.

What if I need something else?

In this article, we used the Munich Stock Exchange and the ISIN as the desired exchange and instrument identification form. But, using OpenFIGI (and especially accessing the FIGI) opens many possibilities. Check out the documentation to learn more.

For more articles on helpful tips surrounding automated trading, check out our blog. Leave us a comment if you have any questions or requests regarding what you’d like to read next!

Until then,

Joanne 🍋

--

--