← Back to Home

FMP Node API Documentation

Core API Wrapper

List Endpoints

The List Endpoints provide access to comprehensive lists of various financial instruments including stocks, ETFs, cryptocurrencies, forex pairs, and available indexes. These endpoints are useful for discovering available symbols and building comprehensive financial applications.

Available Methods

MethodEndpointDescription
GET/stock/listGet list of all stocks
GET/etf/listGet list of all ETFs
GET/symbol/available-cryptocurrenciesGet list of all cryptocurrencies
GET/symbol/available-forex-currency-pairsGet list of all forex pairs
GET/symbol/available-indexesGet list of all available indexes

Get Stock List

Retrieve a comprehensive list of all available stocks with their basic information.

1const stockList = await fmp.list.getStockList();

Example Response

1{
2  success: true,
3  data: [
4    {
5      symbol: 'AAPL',
6      name: 'Apple Inc.',
7      exchange: 'NASDAQ',
8      exchangeShortName: 'NASDAQ',
9      price: '150.25'
10    },
11    {
12      symbol: 'MSFT',
13      name: 'Microsoft Corporation',
14      exchange: 'NASDAQ',
15      exchangeShortName: 'NASDAQ',
16      price: '320.50'
17    },
18    {
19      symbol: 'GOOGL',
20      name: 'Alphabet Inc.',
21      exchange: 'NASDAQ',
22      exchangeShortName: 'NASDAQ',
23      price: '2750.00'
24    },
25    {
26      symbol: 'TSLA',
27      name: 'Tesla, Inc.',
28      exchange: 'NASDAQ',
29      exchangeShortName: 'NASDAQ',
30      price: '850.75'
31    }
32  ]
33}

Get ETF List

Retrieve a list of all available Exchange-Traded Funds (ETFs).

1const etfList = await fmp.list.getETFList();

Example Response

1{
2  success: true,
3  data: [
4    {
5      symbol: 'SPY',
6      name: 'SPDR S&P 500 ETF Trust',
7      exchange: 'NYSE ARCA',
8      exchangeShortName: 'ARCA',
9      price: 450.25
10    },
11    {
12      symbol: 'QQQ',
13      name: 'Invesco QQQ Trust',
14      exchange: 'NASDAQ',
15      exchangeShortName: 'NASDAQ',
16      price: 380.50
17    },
18    {
19      symbol: 'IWM',
20      name: 'iShares Russell 2000 ETF',
21      exchange: 'NYSE ARCA',
22      exchangeShortName: 'ARCA',
23      price: 185.75
24    },
25    {
26      symbol: 'VTI',
27      name: 'Vanguard Total Stock Market ETF',
28      exchange: 'NYSE ARCA',
29      exchangeShortName: 'ARCA',
30      price: 225.00
31    }
32  ]
33}

Get Cryptocurrency List

Retrieve a list of all available cryptocurrencies.

1const cryptoList = await fmp.list.getCryptoList();

Example Response

1{
2  success: true,
3  data: [
4    {
5      symbol: 'BTCUSD',
6      name: 'Bitcoin',
7      currency: 'USD',
8      stockExchange: 'CRYPTO',
9      exchangeShortName: 'CRYPTO'
10    },
11    {
12      symbol: 'ETHUSD',
13      name: 'Ethereum',
14      currency: 'USD',
15      stockExchange: 'CRYPTO',
16      exchangeShortName: 'CRYPTO'
17    },
18    {
19      symbol: 'ADAUSD',
20      name: 'Cardano',
21      currency: 'USD',
22      stockExchange: 'CRYPTO',
23      exchangeShortName: 'CRYPTO'
24    },
25    {
26      symbol: 'DOTUSD',
27      name: 'Polkadot',
28      currency: 'USD',
29      stockExchange: 'CRYPTO',
30      exchangeShortName: 'CRYPTO'
31    }
32  ]
33}

Get Forex List

Retrieve a list of all available forex currency pairs.

1const forexList = await fmp.list.getForexList();

Example Response

1{
2  success: true,
3  data: [
4    {
5      symbol: 'EURUSD',
6      name: 'Euro / US Dollar',
7      currency: 'USD',
8      stockExchange: 'FOREX',
9      exchangeShortName: 'FOREX'
10    },
11    {
12      symbol: 'GBPUSD',
13      name: 'British Pound / US Dollar',
14      currency: 'USD',
15      stockExchange: 'FOREX',
16      exchangeShortName: 'FOREX'
17    },
18    {
19      symbol: 'USDJPY',
20      name: 'US Dollar / Japanese Yen',
21      currency: 'JPY',
22      stockExchange: 'FOREX',
23      exchangeShortName: 'FOREX'
24    },
25    {
26      symbol: 'AUDUSD',
27      name: 'Australian Dollar / US Dollar',
28      currency: 'USD',
29      stockExchange: 'FOREX',
30      exchangeShortName: 'FOREX'
31    }
32  ]
33}

Get Available Indexes

Retrieve a list of all available market indexes.

1const indexesList = await fmp.list.getAvailableIndexes();

Example Response

1{
2  success: true,
3  data: [
4    {
5      symbol: '^GSPC',
6      name: 'S&P 500',
7      currency: 'USD',
8      stockExchange: 'INDEX',
9      exchangeShortName: 'INDEX'
10    },
11    {
12      symbol: '^DJI',
13      name: 'Dow Jones Industrial Average',
14      currency: 'USD',
15      stockExchange: 'INDEX',
16      exchangeShortName: 'INDEX'
17    },
18    {
19      symbol: '^IXIC',
20      name: 'NASDAQ Composite',
21      currency: 'USD',
22      stockExchange: 'INDEX',
23      exchangeShortName: 'INDEX'
24    },
25    {
26      symbol: '^RUT',
27      name: 'Russell 2000',
28      currency: 'USD',
29      stockExchange: 'INDEX',
30      exchangeShortName: 'INDEX'
31    }
32  ]
33}

Working with List Data

Filtering and Searching

List endpoints return comprehensive data that you can filter and search through:

1// Get all lists
2const [stocks, etfs, cryptos, forex, indexes] = await Promise.all([
3  fmp.list.getStockList(),
4  fmp.list.getETFList(),
5  fmp.list.getCryptoList(),
6  fmp.list.getForexList(),
7  fmp.list.getAvailableIndexes()
8]);
9
10// Filter stocks by exchange
11const nasdaqStocks = stocks.data.filter(stock =>
12stock.exchangeShortName === 'NASDAQ'
13);
14
15// Search for specific symbols
16const searchSymbol = (lists: any[], symbol: string) => {
17return lists.flatMap(list =>
18list.data.filter((item: any) =>
19item.symbol.toLowerCase().includes(symbol.toLowerCase())
20)
21);
22};
23
24const appleResults = searchSymbol([stocks, etfs], 'AAPL');
25console.log('Apple-related symbols:', appleResults);

Building Symbol Lookups

Create efficient symbol lookups for your applications:

1// Create a comprehensive symbol lookup
2const createSymbolLookup = async () => {
3  const [stocks, etfs, cryptos, forex, indexes] = await Promise.all([
4      fmp.list.getStockList(),
5      fmp.list.getETFList(),
6      fmp.list.getCryptoList(),
7      fmp.list.getForexList(),
8      fmp.list.getAvailableIndexes()
9  ]);
10
11  const symbolLookup = new Map();
12
13  // Add stocks
14  stocks.data.forEach(stock => {
15      symbolLookup.set(stock.symbol, {
16      ...stock,
17      type: 'stock'
18      });
19  });
20
21  // Add ETFs
22  etfs.data.forEach(etf => {
23      symbolLookup.set(etf.symbol, {
24      ...etf,
25      type: 'etf'
26      });
27  });
28
29  // Add cryptocurrencies
30  cryptos.data.forEach(crypto => {
31      symbolLookup.set(crypto.symbol, {
32      ...crypto,
33      type: 'crypto'
34      });
35  });
36
37  // Add forex pairs
38  forex.data.forEach(pair => {
39      symbolLookup.set(pair.symbol, {
40      ...pair,
41      type: 'forex'
42      });
43  });
44
45  // Add indexes
46  indexes.data.forEach(index => {
47      symbolLookup.set(index.symbol, {
48      ...index,
49      type: 'index'
50      });
51  });
52
53  return symbolLookup;
54
55};
56
57// Usage
58const lookup = await createSymbolLookup();
59const aaplInfo = lookup.get('AAPL');
60console.log('AAPL info:', aaplInfo); // { symbol: 'AAPL', name: 'Apple Inc.', type: 'stock', ... }

Exchange-Based Filtering

Filter instruments by specific exchanges:

1// Get all instruments by exchange
2const getInstrumentsByExchange = async (exchange: string) => {
3  const [stocks, etfs, cryptos, forex, indexes] = await Promise.all([
4      fmp.list.getStockList(),
5      fmp.list.getETFList(),
6      fmp.list.getCryptoList(),
7      fmp.list.getForexList(),
8      fmp.list.getAvailableIndexes()
9  ]);
10
11  const allInstruments = [
12      ...stocks.data.map(item => ({ ...item, type: 'stock' })),
13      ...etfs.data.map(item => ({ ...item, type: 'etf' })),
14      ...cryptos.data.map(item => ({ ...item, type: 'crypto' })),
15      ...forex.data.map(item => ({ ...item, type: 'forex' })),
16      ...indexes.data.map(item => ({ ...item, type: 'index' }))
17  ];
18
19  return allInstruments.filter(instrument =>
20      instrument.exchangeShortName === exchange
21  );
22
23};
24
25// Get all NASDAQ instruments
26const nasdaqInstruments = await getInstrumentsByExchange('NASDAQ');
27console.log('NASDAQ instruments:', nasdaqInstruments.length);

Error Handling

Always check the success property before accessing data:

1const stockList = await fmp.list.getStockList();
2
3if (stockList.success) {
4console.log('Total stocks:', stockList.data.length);
5
6  // Process the data
7  stockList.data.forEach(stock => {
8      console.log(`${stock.symbol}: ${stock.name}`);
9  });
10
11} else {
12console.error('Error fetching stock list:', stockList.error);
13console.error('Status:', stockList.status);
14}

Performance Considerations

Caching List Data

Since list data doesn't change frequently, consider caching the results:

1class CachedListManager {
2  private cache = new Map();
3  private cacheExpiry = new Map();
4  private readonly CACHE_DURATION = 24 * 60 * 60 * 1000; // 24 hours
5
6  private isCacheValid(key: string): boolean {
7      const expiry = this.cacheExpiry.get(key);
8      return expiry && Date.now() < expiry;
9  }
10
11  async getStockList() {
12      const cacheKey = 'stockList';
13
14      if (this.isCacheValid(cacheKey)) {
15      return this.cache.get(cacheKey);
16      }
17
18      const result = await fmp.list.getStockList();
19
20      if (result.success) {
21      this.cache.set(cacheKey, result);
22      this.cacheExpiry.set(cacheKey, Date.now() + this.CACHE_DURATION);
23      }
24
25      return result;
26  }
27
28  // Similar methods for other list types...
29
30}
31
32// Usage
33const listManager = new CachedListManager();
34const stocks = await listManager.getStockList(); // Cached after first call

Rate Limiting

List endpoints are subject to FMP's rate limits. For production applications:

  • Cache list data when possible
  • Implement appropriate rate limiting
  • Consider pagination for large datasets
  • Use bulk operations when available

Next Steps

Explore other endpoint categories:


Ready to explore market data? Check out the Market Endpoints for indices, sector performance, and market statistics.