Stock Endpoints
The Stock Endpoints provide access to market capitalization, stock splits, dividend history, and real-time price data. For real-time quotes, historical prices, and intraday data, see the Quote Endpoints. For company profile information, see the Company Endpoints.
All endpoints return responses with a consistent structure: { success: boolean, data: T | null, error: string | null, status: number }
.
Available Methods
Method | Endpoint | Description |
---|---|---|
GET | /market-capitalization/{symbol} | Get market capitalization data |
GET | /historical-price-full/stock_split/{symbol} | Get stock splits history |
GET | /historical-price-full/stock_dividend/{symbol} | Get dividend history |
GET | /stock/real-time-price/{symbols} | Get real-time price for multiple stocks |
GET | /stock/full/real-time-price/{symbols} | Get full real-time price data for multiple stocks |
Get Market Capitalization
Retrieve market capitalization data for a specific stock.
1const marketCap = await fmp.stock.getMarketCap('AAPL');
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | Stock symbol |
Example Response
1{
2 success: true,
3 data: {
4 symbol: 'AAPL',
5 date: '2023-12-29',
6 marketCap: 2375000000000
7 },
8 error: null,
9 status: 200
10}
Get Stock Splits
Retrieve historical stock splits for a specific stock.
1const stockSplits = await fmp.stock.getStockSplits('AAPL');
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | Stock symbol |
Example Response
1{
2 success: true,
3 data: {
4 symbol: 'AAPL',
5 historical: [
6 {
7 date: '2020-08-31',
8 label: 'Aug 31, 20',
9 numerator: 4,
10 denominator: 1
11 },
12 {
13 date: '2014-06-09',
14 label: 'Jun 09, 14',
15 numerator: 7,
16 denominator: 1
17 }
18 ]
19 },
20 error: null,
21 status: 200
22}
Get Dividend History
Retrieve historical dividend payments for a specific stock.
1const dividendHistory = await fmp.stock.getDividendHistory('AAPL');
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | Stock symbol |
Example Response
1{
2 success: true,
3 data: {
4 symbol: 'AAPL',
5 historical: [
6 {
7 date: '2023-11-16',
8 label: 'Nov 16, 23',
9 adjDividend: 0.24,
10 dividend: 0.24,
11 recordDate: '2023-11-13',
12 paymentDate: '2023-11-16',
13 declarationDate: '2023-08-17'
14 },
15 {
16 date: '2023-08-17',
17 label: 'Aug 17, 23',
18 adjDividend: 0.24,
19 dividend: 0.24,
20 recordDate: '2023-08-14',
21 paymentDate: '2023-08-17',
22 declarationDate: '2023-05-18'
23 }
24 ]
25 },
26 error: null,
27 status: 200
28}
Get Real-Time Price
Retrieve real-time price data for multiple stocks. When the symbols array is empty, returns data for all available stocks.
1const realTimePrice = await fmp.stock.getRealTimePrice(['AAPL', 'MSFT', 'GOOGL']);
2
3// Get all stocks
4const allStocks = await fmp.stock.getRealTimePrice([]);
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbols | string[] | Yes | Array of stock symbols. Empty array returns all stocks. |
Example Response
1{
2 success: true,
3 data: [
4 {
5 symbol: 'AAPL',
6 price: 150.25
7 },
8 {
9 symbol: 'MSFT',
10 price: 375.50
11 },
12 {
13 symbol: 'GOOGL',
14 price: 142.75
15 }
16 ],
17 error: null,
18 status: 200
19}
Get Full Real-Time Price Data
Retrieve comprehensive real-time price data including bid/ask prices, volume, and trade details for multiple stocks. When the symbols array is empty, returns data for all available stocks.
1const fullRealTimeData = await fmp.stock.getRealTimePriceForMultipleStocks(['AAPL', 'MSFT', 'GOOGL']);
2
3// Get all stocks with full data
4const allStocksFull = await fmp.stock.getRealTimePriceForMultipleStocks([]);
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbols | string[] | Yes | Array of stock symbols. Empty array returns all stocks. |
Example Response
1{
2 success: true,
3 data: [
4 {
5 "bidSize": 1,
6 "askPrice": 211.3,
7 "volume": 48317144,
8 "askSize": 1,
9 "bidPrice": 211.12,
10 "lastSalePrice": 211.26,
11 "lastSaleSize": 7,
12 "lastSaleTime": 1752883199000,
13 "fmpLast": 211.26,
14 "lastUpdated": 1752883166000,
15 "symbol": "AAPL"
16 },
17 {
18 "bidSize": 1,
19 "askPrice": 515,
20 "volume": 21086806,
21 "askSize": 1,
22 "bidPrice": 488.2,
23 "lastSalePrice": 510.15,
24 "lastSaleSize": 48,
25 "lastSaleTime": 1752883175000,
26 "fmpLast": 510.15,
27 "lastUpdated": 1752868800000,
28 "symbol": "MSFT"
29 },
30 {
31 "bidSize": 1,
32 "askPrice": 185.58,
33 "volume": 33639843,
34 "askSize": 1,
35 "bidPrice": 185.51,
36 "lastSalePrice": 185.53,
37 "lastSaleSize": 22,
38 "lastSaleTime": 1752883190000,
39 "fmpLast": 185.53,
40 "lastUpdated": 1752883103000,
41 "symbol": "GOOGL"
42 }
43 ],
44 error: null,
45 status: 200
46}
Error Handling
All API responses follow a consistent structure with the following properties:
success
: Boolean indicating if the request was successfuldata
: The response data (null if unsuccessful)error
: Error message string (null if successful)status
: HTTP status code
Always check the success property before accessing data:
1const marketCap = await fmp.stock.getMarketCap('INVALID');
2
3if (marketCap.success && marketCap.data) {
4console.log('Market Cap:', marketCap.data.marketCap);
5} else {
6console.error('Error:', marketCap.error);
7console.error('Status:', marketCap.status);
8}
Common Error Scenarios
1// Invalid symbol
2const result = await fmp.stock.getMarketCap('INVALID_SYMBOL');
3// Result: { success: false, data: null, error: "No data found", status: 404 }
4
5// API key issues
6const result = await fmp.stock.getMarketCap('AAPL');
7// Result: { success: false, data: null, error: "Invalid API key", status: 401 }
8
9// Rate limiting
10const result = await fmp.stock.getMarketCap('AAPL');
11// Result: { success: false, data: null, error: "Rate limit exceeded", status: 429 }
12
13// Network errors
14const result = await fmp.stock.getMarketCap('AAPL');
15// Result: { success: false, data: null, error: "Network Error", status: 500 }
16
Rate Limiting
Stock endpoints are subject to FMP's rate limits. For production applications, implement appropriate rate limiting and caching strategies.
Next Steps
Explore other endpoint categories:
- Quote Endpoints - Real-time quotes, historical prices, and intraday data
- Company Endpoints - Company profiles, executive compensation, and employee data
- Financial Endpoints - Financial statements and ratios
- Market Endpoints - Market indices and sector data
- Calendar Endpoints - Earnings, dividends, and economic calendars
- List Endpoints - Available symbols and instruments
- Examples - Practical code samples
Ready to explore financial data? Check out the Financial Endpoints for income statements, balance sheets, and more.
Need real-time quotes? Check out the Quote Endpoints for comprehensive quote data, historical prices, and intraday charts.