How to Match Company Names to Tradable Symbols Using a Free API

Developers often face a common challenge: mapping a company's name to its stock ticker symbol. For example, a user might input "Google," but the data you need is under Alphabet's trading symbol, GOOGL. Accurate name-to-symbol mapping is crucial for any stock or financial application. A single mismatch can lead to pulling wrong data and compromising your analysis or user experience.

This article shows how you can reliably map fuzzy company names to valid tradable symbols using Financial Modeling Prep's free Company Name Search API. We'll cover the problem, the solution, a code walkthrough (with JavaScript examples), edge cases like subsidiaries and similarly named firms.

The Problem: Company Names vs. Ticker Symbols

In financial data systems, all data retrieval relies on correct ticker symbols. Humans recognize companies by name ("Apple Inc." or "Tesla"), but data APIs typically require the stock symbol (AAPL, TSLA). This gap presents a few challenges for developers:

  • Names Can Be Fuzzy or Partial: Users might enter nicknames, acronyms, or partial names. For instance, "IBM Corp" versus the official name "International Business Machines". How do we ensure we get IBM (the symbol) from such input?
  • Multiple Companies With Similar Names: Different companies (or funds) can share similar names. A search for "Apple" might return Apple Inc. (AAPL) and other results like an Apple-themed ETF. Without a strategy, your app could grab data for the wrong entity (e.g. an Apple ETF instead of Apple Inc.).
  • Parent vs. Subsidiary Confusion: Big brands are sometimes subsidiaries of traded companies. A classic example is Google, which is owned by Alphabet Inc. A naive search for "Google" needs to point to Alphabet's symbol (GOOGL). Similarly, "Facebook" should map to Meta Platforms (META). Relying on exact name matching or a static lookup can fail as companies rebrand or restructure.
  • Global and Duplicate Tickers: Ticker symbols aren't universally unique. A given name might correspond to multiple listings across exchanges. For example, Rio Tinto is listed in both London and Australia, and both share the name "Rio Tinto" in search results. Even the ticker "RIO" appears on multiple exchanges, so context is needed. Without exchange info, you might pick the wrong one.

These issues make it clear that manual or naive approaches to name-to-symbol mapping are error-prone. We need a reliable, up-to-date system to handle fuzzy name searches and return the exact ticker symbol along with context like the exchange. This is where a free name search API can save the day.

The Solution: FMP's Free Company Name Search API

Financial Modeling Prep (FMP) provides a dedicated Name Search API that solves this problem elegantly. With this free API (available with a free account sign-up), you can send a company or asset name and get back a list of matching symbols and relevant details. Here's why this API is an ideal solution:

  • Fuzzy Name Matching: Simply provide a full or partial company name (or even a fragment of it) and the API returns all possible matches. This works for official names and common names. Example: Querying "Apple" will return Apple Inc. (AAPL) and other related listings containing "Apple".
  • Ticker, Name, and Exchange Details: The results include the ticker symbol, the official company name, and exchange identifiers. You're not just guessing the symbol - the API confirms if it's on NYSE, NASDAQ, LSE, etc., and even provides the full exchange name and currency. This way you know which Apple (or Rio Tinto, etc.) you have found.
  • Equities and More: The Name Search API covers stocks, ETFs, and other asset types. It's not limited to U.S. stocks - it spans major global exchanges. You can even search other categories by specifying an exchange or type filter (for example, search within ETFs or crypto by adding a parameter). This extends your app beyond a stock-only tool to multi-asset support, all with the same free API call.
  • Accurate & Up-to-Date: The data is real-time and maintained by FMP. As soon as a new company is listed or a name changes, the search API reflects it. This saves you from maintaining your own mapping database.
  • Quick Onboarding: The API is accessible with a free key (up to a generous daily limit). It's designed for easy integration, perfect for developers prototyping or adding a “typeahead” company lookup in their product.

Using this API, the workflow becomes: take user input (company name) → call FMP Name Search → get the correct ticker symbol → proceed to fetch any financial data with that symbol.

Now, let's walk through how to implement this step-by-step in code.

Code Walkthrough: Implementing Name-to-Symbol Mapping

To illustrate the integration, we'll use a JavaScript example. We'll build a small script that takes a company name, finds its ticker symbol via the API, and then (for demonstration) fetches that company's stock price. This shows how the name-to-symbol lookup can fit into a broader workflow.

Step 1: Construct the Search API Request

Every request starts with forming the correct URL to call. The FMP Name Search endpoint has the format:

https://financialmodelingprep.com/stable/search-name?query=AA&apikey=YOUR_API_KEY

  • query: The company name or partial name you want to search for (URL-encoded).
  • apikey: Your API key from FMP (free plan keys are available once you sign up).

For example, if we want to search for "Apple", the URL would look like:

const query = "Apple";

const apiKey = "YOUR_API_KEY"; // replace with your FMP API key

const url = `https://financialmodelingprep.com/stable/search-name?query=${encodeURIComponent(query)}&apikey=${apiKey}`;

This URL is ready to call the API, asking for matches for "Apple". (The encodeURIComponent ensures that any special characters or spaces in the query are safely encoded for the URL.)

Step 2: Fetch the Search Results

Using the constructed URL, we can call the API using fetch (or any HTTP client). The API returns data in JSON format. In JavaScript, it looks like:

fetch(url)

.then(response => response.json())

.then(data => {

console.log("Search results:", data);

})

.catch(error => {

console.error("Error fetching data:", error);

});

When this request succeeds, data will be an array of result objects. Each object in the array represents a company or asset that matches the name query. For our "Apple" example, data might look like this (truncated for brevity):

[

{

"symbol": "AAPL",

"name": "Apple Inc.",

"currency": "USD",

"stockExchange": "Nasdaq Global Select",

"exchangeShortName": "NASDAQ"

},

{

"symbol": "APLY",

"name": "YieldMax AAPL Option Income Strategy ETF",

"currency": "USD",

"stockExchange": "NYSE Arca",

"exchangeShortName": "AMEX"

},

...

]

In this hypothetical snippet, the first result is the Apple Inc. stock (NASDAQ: AAPL), and the second is an ETF related to AAPL. The object includes the ticker symbol, the official company or fund name, the trading currency, and exchange information (stockExchange full name and a shorter code).

Step 3: Extract the Right Symbol from Results

Once we have the array of matches, we need to pick the correct symbol for our use case. In many cases, you'll take the top result (index 0) if the query was specific enough. However, it's wise to implement some logic or user confirmation if multiple results are plausible.

For simplicity, let's take the first result and extract its symbol:

fetch(url)

.then(response => response.json())

.then(data => {

if (!data || data.length === 0) {

console.error("No matches found for query:", query);

return;

}

// Take the first match as the best candidate

const bestMatch = data[0];

console.log(`Best match: ${bestMatch.name} (${bestMatch.symbol}) on ${bestMatch.exchangeShortName}`);

// Continue to use bestMatch.symbol in subsequent API calls...

});

Here we check if data is empty (meaning no match found) and handle that case. Otherwise, we assume the first object is our intended company. We log the name, symbol, and exchange for verification. In a real app, you might present multiple choices to the user if there are close matches - for example, if someone types "Ma", the API might return Mastercard (MA) and Maersk A/S. But if the query is a full unique name like "Mastercard", the first result should be the correct one.

Step 4: Integrate the Symbol into Your Workflow

Now that we have a ticker symbol, we can plug it into any other API endpoints or logic that requires a symbol. This could be getting a real-time stock quote, fetching company financials, adding it to a watchlist, etc.

For demonstration, let's fetch the latest price quote for our matched symbol using FMP's Quote API:

const symbol = bestMatch.symbol;

// Construct a quote API URL

const quoteUrl =

`https://financialmodelingprep.com/stable/quote?symbol=${symbol}&apikey=${apiKey}`;

fetch(quoteUrl)

.then(res => res.json())

.then(quoteData => {

if (quoteData && quoteData[0]) {

console.log(`Latest price for ${symbol}: $${quoteData[0].price}`);

} else {

console.log("No price data for symbol:", symbol);

}

});

In a real application, instead of just logging to console, you might update the UI with this price or store it in your database. The key takeaway is that by automating the name-to-symbol lookup, you can seamlessly connect a user's input (a company name) to the data retrieval step. The user could type "Apple Inc." in a search box, and under the hood your code uses the Name Search API to find AAPL, then immediately fetches the stock's price or news, etc., without any manual mapping. This makes for a smooth user experience.

Edge Cases and Best Practices in Name Matching

Even with a powerful API, it's important to handle a few edge cases to make your solution robust:

Multiple similarly named companies

As shown earlier, a query like "Apple" returns both the stock and other entries (funds with "AAPL" in their name). Always examine the returned name and exchangeShortName. If you expect an equity and see an ETF or a foreign exchange, you may need to refine the query or filter results. For instance, you can add an exchange parameter to limit results (e.g., exchange=NASDAQ to prioritize U.S. stocks).

Subsidiaries or nicknames

When users input a brand or subsidiary (like "Google" or "Instagram"), the exact match might not be listed if the company trades under a different name. In testing, "Google" will return Alphabet Inc.'s stocks since Google is a known alias, but not all cases are covered by aliases. Be prepared to handle known exceptions (you might maintain a small mapping for very common old names to new names, such as "Facebook" -> query "Meta"). Fortunately, many well-known cases are implicitly handled by the API or by using official names.

Dual listings and share classes

Some companies have multiple symbols (e.g., GOOGL vs GOOG for Alphabet's two share classes, or RIO in London vs RIO in Australia). The Name Search API typically returns each as separate results with different exchangeShortName or slightly different name fields (plc vs Ltd, Class A vs Class C, etc.). Leverage the exchange and currency info returned to pick the right one for your needs. For example, if you only care about U.S. listings, filter out any result where exchangeShortName isn't NYSE/NASDAQ.

No results or ambiguous input

If the API returns an empty list, it means it couldn't find anything matching the query. In such cases, prompt the user to check the spelling or try a different keyword. If the input was very broad (e.g., "Press"), you might get too many unrelated results. Guide the user to enter a more specific name. The good news is the search is quite flexible - even a partial name like "Microsof" will still return Microsoft Corporation (MSFT) as a match.

By accounting for these scenarios, you ensure that your name-to-symbol feature works reliably in production. The API's comprehensive metadata (like exchange codes and types) is there to help you disambiguate cases where the name alone isn't unique. A little bit of post-processing logic on your side (such as filtering by expected exchange or security type) can go a long way in making the integration bulletproof.

Turn Company Names Into Market Data Instantly

Mapping company names to ticker symbols no longer needs to be a headache. Using FMP's free Company Name Search API, developers can extend their applications beyond a stock-only tool and support fuzzy name searches across equities, ETFs, and more.

The Name Search API provides a quick, reliable way to bridge the gap between human-friendly company names and the symbols your code needs. It handles the heavy lifting of search and disambiguation, giving you up-to-date results with exchange context. This means you can confidently build features like autocomplete search bars, portfolio import tools (where users list company names), or any workflow where the user might not know the exact ticker symbol.

Leveraging free APIs like this not only accelerates development but also improves user onboarding - new users of your app can get started with just company names, and the backend will smartly fetch the right data.

FAQ

Is the Financial Modeling Prep Company Name Search API really free?

Yes, FMP offers a free tier that includes access to the Company Name Search API with a daily request limit. It's usually sufficient for prototyping, personal projects, or low-traffic applications, with paid plans available if you need higher limits.

How accurate is the name-to-ticker matching?

The API uses fuzzy search and up-to-date market data, so it generally returns highly relevant matches even for partial or slightly incorrect names. However, you should still validate results (for example by exchange or asset type) to avoid edge-case mismatches.

Can I use this API for assets other than stocks?

Yes. The search endpoint can return ETFs, indices, and other tradable instruments depending on your query and filters. This makes it useful for multi-asset financial applications, not just equities.

What happens if multiple symbols match the same company name?

You'll receive a list of possible matches including exchange and currency details. Your app can filter results automatically or let users select the correct listing when ambiguity exists.

Does the API handle company rebrands or parent companies automatically?

Often it does, for example, searching “Google” typically returns Alphabet's listings. Still, for critical workflows you may want a small fallback mapping for major historical name changes.

How should I handle cases where no symbol is returned?

Prompt the user to refine their input or check spelling, since very vague or incorrect names may not produce results. Adding suggestions or autocomplete in your UI can help reduce these occurrences.

About the Author
Sanzhi Kobzhan

Treasury, trading, liquidity, and equity analysis for investors

Sanzhi writes for FMP with a focus on equity analysis, valuation, market data, and practical investment decision-making. He has worked across financial institutions in treasury, trading, and liquidity roles, bringing hands-on experience in investment analysis, market execution, risk, and strategy. His work focuses on helping readers interpret financial data with clarity, discipline, and an institutional market perspective.

Related

Financial data for every need

Real-time quotes and 30+ years of historical data, including prices, fundamentals, and insider transactions — all accessible via API.

Create Free Account