Market Endpoints

Access market-wide data including performance metrics, trading hours, sector information, and market indices.

Available Methods

MethodEndpointDescription
GET/market-performanceGet market performance data
GET/market-hoursGet market hours and status
GET/stock_market/gainersGet top gaining stocks
GET/stock_market/losersGet top losing stocks
GET/stock_market/activesGet most active stocks
GET/sector-performanceGet sector performance data
GET/quotes/indexGet market index data

Get Market Performance

Retrieve overall market performance data including major indices.

1const performance = await fmp.market.getMarketPerformance();

Example Response

1{
2success: true,
3data: [
4  {
5    symbol: '^DJI',
6    name: 'Dow Jones Industrial Average',
7    change: 125.45,
8    price: 37592.98,
9    changesPercentage: 0.34
10  },
11  {
12    symbol: '^GSPC',
13    name: 'S&P 500',
14    change: 18.76,
15    price: 4783.83,
16    changesPercentage: 0.39
17  },
18  {
19    symbol: '^IXIC',
20    name: 'NASDAQ Composite',
21    change: 78.23,
22    price: 15011.35,
23    changesPercentage: 0.52
24  }
25]
26}

Get Market Hours

Retrieve current market trading hours and status information.

1const hours = await fmp.market.getMarketHours();

Example Response

1{
2success: true,
3data: {
4  stockExchangeName: 'NASDAQ',
5  stockMarketHours: {
6    openingHour: '09:30',
7    closingHour: '16:00'
8  },
9  stockMarketHolidays: [
10    {
11      year: 2024,
12      'Martin Luther King, Jr. Day': '2024-01-15',
13      "Presidents' Day": '2024-02-19',
14      'Good Friday': '2024-03-29',
15      'Memorial Day': '2024-05-27',
16      Juneteenth: '2024-06-19',
17      'Independence Day': '2024-07-04',
18      'Labor Day': '2024-09-02',
19      'Thanksgiving Day': '2024-11-28',
20      Christmas: '2024-12-25'
21    }
22  ],
23  isTheStockMarketOpen: true,
24  isTheEuronextMarketOpen: false,
25  isTheForexMarketOpen: true,
26  isTheCryptoMarketOpen: true
27}
28}

Get Top Gainers

Retrieve the top gaining stocks for the current trading day.

1const gainers = await fmp.market.getGainers();

Example Response

1{
2success: true,
3data: [
4  {
5    symbol: 'TSLA',
6    name: 'Tesla, Inc.',
7    change: 12.45,
8    price: 248.50,
9    changesPercentage: 5.28,
10    dayLow: 235.20,
11    dayHigh: 250.10,
12    yearHigh: 299.29,
13    yearLow: 138.80,
14    marketCap: 789000000000,
15    priceAvg50: 245.67,
16    priceAvg200: 242.89,
17    volume: 45678900,
18    avgVolume: 52345600,
19    exchange: 'NASDAQ',
20    open: 236.50,
21    previousClose: 236.05,
22    eps: 3.12,
23    pe: 79.65,
24    earningsAnnouncement: '2024-01-24T21:30:00.000+00:00',
25    sharesOutstanding: 3180000000,
26    timestamp: 1703123456
27  }
28]
29}

Get Top Losers

Retrieve the top losing stocks for the current trading day.

1const losers = await fmp.market.getLosers();

Example Response

1{
2success: true,
3data: [
4  {
5    symbol: 'NFLX',
6    name: 'Netflix, Inc.',
7    change: -8.75,
8    price: 485.25,
9    changesPercentage: -1.77,
10    dayLow: 480.10,
11    dayHigh: 495.30,
12    yearHigh: 639.00,
13    yearLow: 285.33,
14    marketCap: 215000000000,
15    priceAvg50: 492.45,
16    priceAvg200: 478.12,
17    volume: 23456700,
18    avgVolume: 25678900,
19    exchange: 'NASDAQ',
20    open: 494.00,
21    previousClose: 494.00,
22    eps: 12.03,
23    pe: 40.34,
24    earningsAnnouncement: '2024-01-23T21:30:00.000+00:00',
25    sharesOutstanding: 443000000,
26    timestamp: 1703123456
27  }
28]
29}

Get Most Active

Retrieve the most actively traded stocks by volume.

1const active = await fmp.market.getMostActive();

Example Response

1{
2success: true,
3data: [
4  {
5    symbol: 'AAPL',
6    name: 'Apple Inc.',
7    change: 2.15,
8    price: 150.25,
9    changesPercentage: 1.45,
10    dayLow: 147.50,
11    dayHigh: 151.75,
12    yearHigh: 198.23,
13    yearLow: 124.17,
14    marketCap: 2375000000000,
15    priceAvg50: 145.67,
16    priceAvg200: 142.89,
17    volume: 78901200,
18    avgVolume: 52345600,
19    exchange: 'NASDAQ',
20    open: 148.50,
21    previousClose: 148.10,
22    eps: 6.16,
23    pe: 24.39,
24    earningsAnnouncement: '2024-01-25T21:30:00.000+00:00',
25    sharesOutstanding: 15800000000,
26    timestamp: 1703123456
27  }
28]
29}

Get Sector Performance

Retrieve performance data organized by market sectors.

1const sectors = await fmp.market.getSectorPerformance();

Example Response

1{
2success: true,
3data: [
4  {
5    sector: 'Technology',
6    changesPercentage: 1.25
7  },
8  {
9    sector: 'Healthcare',
10    changesPercentage: 0.87
11  },
12  {
13    sector: 'Financial Services',
14    changesPercentage: 0.45
15  },
16  {
17    sector: 'Consumer Cyclical',
18    changesPercentage: 0.32
19  },
20  {
21    sector: 'Communication Services',
22    changesPercentage: 0.18
23  }
24]
25}

Get Market Index

Retrieve detailed market index data.

1const index = await fmp.market.getMarketIndex();

Example Response

1{
2success: true,
3data: [
4  {
5    symbol: '^DJI',
6    price: 37592.98,
7    extendedPrice: null,
8    change: 125.45,
9    dayHigh: 37650.25,
10    dayLow: 37450.75,
11    previousClose: 37467.53,
12    volume: null,
13    open: 37500.00,
14    close: null,
15    lastTradeTime: '2024-01-15T21:00:00.000+00:00',
16    lastExtendedTradeTime: null,
17    updatedAt: '2024-01-15T21:00:00.000+00:00',
18    createdAt: '2024-01-15T21:00:00.000+00:00',
19    type: 'index',
20    name: 'Dow Jones Industrial Average',
21    range: '37450.75-37650.25',
22    yearHigh: 37850.00,
23    yearLow: 31429.82,
24    priceAvg50: 37250.45,
25    priceAvg200: 36890.12,
26    changesPercentage: 0.34
27  }
28]
29}

Response Types

MarketPerformance

1interface MarketPerformance {
2symbol: string;
3name: string;
4change: number;
5price: number;
6changesPercentage: number;
7}

MarketHours

1interface MarketHours {
2stockExchangeName: string;
3stockMarketHours: {
4  openingHour: string;
5  closingHour: string;
6};
7stockMarketHolidays: MarketHoliday[];
8isTheStockMarketOpen: boolean;
9isTheEuronextMarketOpen: boolean;
10isTheForexMarketOpen: boolean;
11isTheCryptoMarketOpen: boolean;
12}
13
14interface MarketHoliday {
15year: number;
16'Martin Luther King, Jr. Day': string;
17"Presidents' Day": string;
18'Good Friday': string;
19'Memorial Day': string;
20Juneteenth: string;
21'Independence Day': string;
22'Labor Day': string;
23'Thanksgiving Day': string;
24Christmas: string;
25}

MarketSectorPerformance

1interface MarketSectorPerformance {
2sector: string;
3changesPercentage: number | string; // Note: API may return this as a string
4}

MarketIndex

1interface MarketIndex {
2symbol: string;
3price: number;
4extendedPrice: number | null;
5change: number;
6dayHigh: number;
7dayLow: number;
8previousClose: number;
9volume: number | null;
10open: number;
11close: number | null;
12lastTradeTime: string;
13lastExtendedTradeTime: string | null;
14updatedAt: string;
15createdAt: string;
16type: string;
17name: string;
18range: string;
19yearHigh: number;
20yearLow: number;
21priceAvg50: number | null;
22priceAvg200: number | null;
23changesPercentage: number;
24}

Note: Some numeric fields may be returned as strings by the FMP API. Always check the type at runtime if you need strict type safety.

Error Handling

Always check the success property before accessing data:

1const performance = await fmp.market.getMarketPerformance();
2
3if (performance.success && performance.data) {
4console.log('Market Performance:', performance.data);
5} else {
6console.error('Error:', performance.error);
7console.error('Status:', performance.status);
8}

Rate Limiting

Market endpoints are subject to FMP's rate limits. For production applications, implement appropriate rate limiting and caching strategies.

Market Hours

Market data availability depends on trading hours:

  • Stock Market - Typically 9:30 AM - 4:00 PM ET (Monday-Friday)
  • Pre-Market - 4:00 AM - 9:30 AM ET
  • After-Hours - 4:00 PM - 8:00 PM ET
  • Weekends/Holidays - Limited data availability

Next Steps

Explore other endpoint categories:


Ready to explore economic data? Check out the Economic Endpoints for indicators and macroeconomic data.