Comprehensive documentation for Claude, ChatGPT, GitHub Copilot, and other AI coding assistants
/ai-integration.html
ws://[current-domain]
or wss://[current-domain]
for HTTPSInclude your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
Get real-time quote for a single stock symbol
GET /api/quote/AAPL
{
"symbol": "AAPL",
"price": 195.83,
"change": 2.15,
"changesPercentage": 1.11,
"dayLow": 193.67,
"dayHigh": 196.38,
"yearLow": 164.08,
"yearHigh": 199.62,
"volume": 58935235,
"previousClose": 193.68,
"open": 194.50
}
Get quotes for multiple symbols in one request
POST /api/quotes/bulk
Content-Type: application/json
{
"symbols": ["AAPL", "MSFT", "GOOGL", "TSLA"]
}
[
{
"symbol": "AAPL",
"price": 195.83,
"change": 2.15,
"changesPercentage": 1.11
},
{
"symbol": "MSFT",
"price": 430.82,
"change": -1.23,
"changesPercentage": -0.28
}
// ... more symbols
]
Get quotes for all tracked symbols
GET /api/quotes
Get detailed company profile including sector, industry, and description
GET /api/company-profile/AAPL
{
"symbol": "AAPL",
"companyName": "Apple Inc.",
"sector": "Technology",
"industry": "Consumer Electronics",
"website": "https://www.apple.com",
"description": "Apple Inc. designs, manufactures, and markets smartphones...",
"ceo": "Tim Cook",
"employees": 164000,
"headquarter": "Cupertino, California",
"marketCap": 3021000000000
}
Get income statement data
GET /api/income-statement/AAPL?period=annual
Get balance sheet data
GET /api/balance-sheet/AAPL?period=quarter
Get cash flow statement data
GET /api/cash-flow/AAPL?period=annual
Get key financial metrics (P/E ratio, EPS, revenue per share, etc.)
Get trailing twelve months key metrics
Get top gaining stocks of the day
Get top losing stocks of the day
Get most actively traded stocks
Get economic data series from Federal Reserve (FRED)
GET /api/fred/series/GDP
GET /api/fred/series/UNRATE
GET /api/fred/series/CPIAUCSL
Search for FRED series by keyword
GET /api/fred/search?text=inflation
Screen stocks based on multiple criteria
GET /api/stock-screener?marketCapMoreThan=1000000000§or=Technology&limit=50
marketCapMoreThan, marketCapLowerThan, priceMoreThan, priceLowerThan,
volumeLowerThan, volumeMoreThan, sector, industry, country, exchange, limit
Search companies by CIK (Central Index Key)
GET /api/search-cik?query=0000320193
Search companies by CUSIP number
GET /api/search-cusip?cusip=037833100
Search companies by ISIN
GET /api/search-isin?isin=US0378331005
Get list of all available traded symbols
Get company key executives (CEO, CFO, etc.)
GET /api/key-executives/AAPL
Get comprehensive company outlook including all data
GET /api/company-outlook/AAPL
Get shares float data
GET /api/shares-float/AAPL
Get comprehensive financial ratios
GET /api/ratios/AAPL
Get trailing twelve months financial ratios
GET /api/ratios-ttm/AAPL
Get enterprise value calculations
GET /api/enterprise-values/AAPL
Get company rating and recommendation
GET /api/rating/AAPL
Get discounted cash flow valuation
GET /api/dcf/AAPL
Get current performance of all market sectors
GET /api/sectors-performance
Get historical sectors performance data
Get complete list of all ETFs
Get ETF sector allocation breakdown
GET /api/etf-sector-weightings/SPY
Get ETF country allocation breakdown
GET /api/etf-country-weightings/VTI
Get complete list of all mutual funds
Get upcoming initial public offerings (IPOs)
Get upcoming dividend payments
Get upcoming stock splits
Get upcoming economic events and data releases
Check if the US stock market is open
{
"isOpen": true,
"session": "regular",
"timezone": "America/New_York"
}
Get market trading hours for different exchanges
Get current US Treasury bond rates
Get Environmental, Social, and Governance (ESG) ratings
GET /api/esg-data/AAPL
Get trending social sentiment data
Get list of recently delisted companies
Get recent ticker symbol changes
Get pre-market and after-hours trading data
GET /api/pre-post-market/AAPL
Get detailed pre/post market trades
Get latest financial market news
Get cryptocurrency quotes
Get list of S&P 500 companies
Get batch end-of-day prices for multiple symbols
POST /api/batch-eod-prices
Content-Type: application/json
{
"date": "2024-01-15",
"symbols": ["AAPL", "MSFT", "GOOGL"]
}
Get all company profiles in bulk (large dataset)
Get bulk income statements
GET /api/income-statement-bulk?year=2023&period=annual
Filter stocks by market cap, price, volume, sector, and other criteria
Get companies similar to the specified stock
Get all holdings within an ETF
List companies that have been delisted from exchanges
Get analyst grades and ratings for a stock
Get analyst earnings and revenue estimates
Get analyst buy/hold/sell recommendations (grades)
Get consensus analyst grades summary
Get historical analyst grades changes
Get latest news about analyst grade changes
Get historical earnings surprises vs estimates
Get confirmed earnings announcement dates
Get all SEC filings (10-K, 10-Q, 8-K, etc.) for a company
Get RSS feed of latest SEC filings
Get insider buying and selling activity
Get RSS feed of all insider trading activity
Get fail to deliver data from SEC
Map company names to CIK identifiers
Search for CIK by company name
Convert CUSIP to company information
Convert ISIN to company information
Get list of key executives and their roles
Get detailed executive compensation data
Compare executive compensation to industry peers
Get analyst notes and commentary
Get historical employee count trends
Get current number of employees
Get ownership breakdown by number of shares held
Get institutional investor holdings
Get mutual fund holdings in the stock
Get ETF holdings in the stock
List all institutional investment firms
Get portfolio weightings for institutional holders
Get list of available SEC RSS feed endpoints
Get complete list of all CIK identifiers
Get upcoming economic events and indicators
Get historical data for economic indicators
Get upcoming IPO listings
Get IPO prospectus document links
Get confirmed IPO dates and details
Get upcoming earnings announcements
Get historical earnings dates for a company
Get upcoming stock splits
Get historical stock splits for a company
Get upcoming dividend payments
Get historical dividend payments
Get current holdings of a mutual fund or ETF
Get fund holdings for a specific date
Get portfolio holdings using CIK identifier
Get detailed ETF information and metrics
Get ETF expense ratio and fees
Get ETF holdings by sector allocation
Get ETF holdings by country allocation
Get complete list of all available ETFs
Get list of ETFs with available data
Get list of all market indices
Get indices with available data
Get all S&P 500 component stocks
Get all NASDAQ listed companies
Get all Dow Jones 30 components
Get list of tradeable commodities
Get commodities with available data
Get all Euronext listed companies
Get all Toronto Stock Exchange companies
Get list of all cryptocurrencies
Get cryptocurrencies with available data
Get list of forex currency pairs
Get forex pairs with available data
// Get WebSocket URL based on current protocol
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = wsProtocol + '//' + window.location.host;
const ws = new WebSocket(wsUrl);
ws.on('open', () => {
console.log('Connected to DataBeast WebSocket');
});
ws.on('message', (data) => {
const message = JSON.parse(data);
switch(message.type) {
case 'connected':
console.log('Connection confirmed');
break;
case 'stockUpdate':
handleStockUpdate(message.data);
break;
case 'subscribed':
console.log('Subscribed to:', message.tickers);
break;
}
});
// Subscribe to single symbol
ws.send(JSON.stringify({
type: 'subscribe',
ticker: 'AAPL'
}));
// Subscribe to multiple symbols
ws.send(JSON.stringify({
type: 'subscribe',
tickers: ['AAPL', 'MSFT', 'GOOGL', 'TSLA']
}));
{
"type": "stockUpdate",
"data": {
"s": "AAPL", // Symbol
"p": 195.83, // Current price (last trade)
"c": 2.15, // Change from previous close
"cp": 1.11, // Change percentage
"v": 58935235, // Volume
"t": 1703123456789, // Timestamp
"type": "T" // Trade message type
}
}
// React Component Example
import React, { useEffect, useState } from 'react';
function LiveStockPrices({ symbols }) {
const [prices, setPrices] = useState({});
useEffect(() => {
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = new WebSocket(wsProtocol + '//' + window.location.host);
ws.onopen = () => {
// Subscribe to symbols
ws.send(JSON.stringify({
type: 'subscribe',
tickers: symbols
}));
};
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.type === 'stockUpdate') {
const { data } = message;
setPrices(prev => ({
...prev,
[data.s]: {
price: data.p,
change: data.c,
changePercent: data.cp,
volume: data.v
}
}));
}
};
return () => ws.close();
}, [symbols]);
return (
<div>
{Object.entries(prices).map(([symbol, data]) => (
<div key={symbol}>
<h3>{symbol}</h3>
<p>Price: ${data.price.toFixed(2)}</p>
<p style={{color: data.change >= 0 ? 'green' : 'red'}}>
{data.change >= 0 ? '+' : ''}{data.change.toFixed(2)}
({data.changePercent.toFixed(2)}%)
</p>
<p>Volume: {data.volume.toLocaleString()}</p>
</div>
))}
</div>
);
}
// Note: When using relative URLs, the requests will be made to the current domain
// Fetch single quote
async function getQuote(symbol) {
const response = await fetch(`/api/quote/${symbol}`);
return response.json();
}
// Fetch multiple quotes
async function getBulkQuotes(symbols) {
const response = await fetch('/api/quotes/bulk', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ symbols })
});
return response.json();
}
// Get market movers
async function getMarketMovers() {
const [gainers, losers, actives] = await Promise.all([
fetch('/api/market-gainers').then(r => r.json()),
fetch('/api/market-losers').then(r => r.json()),
fetch('/api/market-actives').then(r => r.json())
]);
return { gainers, losers, actives };
}
// Usage examples
const appleQuote = await getQuote('AAPL');
console.log(`Apple: $${appleQuote.price} (${appleQuote.changesPercentage}%)`);
const techStocks = await getBulkQuotes(['AAPL', 'MSFT', 'GOOGL', 'AMZN']);
techStocks.forEach(stock => {
console.log(`${stock.symbol}: $${stock.price}`);
});
# Replace [domain] with your actual domain (e.g., localhost:3000, example.com)
# Get single quote
curl http://[domain]/api/quote/AAPL
# Get company profile
curl http://[domain]/api/company-profile/AAPL
# Get market gainers
curl http://[domain]/api/market-gainers
# Post bulk quotes
curl -X POST http://[domain]/api/quotes/bulk \
-H "Content-Type: application/json" \
-d '{"symbols": ["AAPL", "MSFT", "GOOGL"]}'
For Claude/ChatGPT: Copy these prompts and modify for your needs:
# Create a Real-time Stock Dashboard
"Using the DataBeast API on the current domain, create a React dashboard that:
1. Displays real-time stock prices using WebSocket connection
2. Shows price changes with green/red indicators
3. Subscribes to tech stocks: AAPL, MSFT, GOOGL, AMZN, TSLA
4. Updates automatically when new trades occur
5. Includes volume and percentage change
Use relative URLs for all API calls and determine WebSocket URL from window.location."
# Build a Market Analysis Tool
"Create a JavaScript application using DataBeast API that:
1. Fetches market gainers and losers from /api/market-gainers and /api/market-losers
2. Gets company profiles for top 5 gainers using /api/company-profile/{symbol}
3. Analyzes sector distribution of movers
4. Outputs a summary report
Use fetch() with relative URLs for all API endpoints."
# Create Stock Screener Application
"Build a stock screening tool that:
1. Uses /api/stock-screener with filters for market cap, price, volume, and sector
2. Fetches detailed ratios using /api/ratios/{symbol} for filtered results
3. Calculates DCF valuation using /api/dcf/{symbol}
4. Displays results in a sortable table with key metrics
5. Allows export of screened stocks to CSV"
# Build ESG Portfolio Analyzer
"Create an ESG-focused portfolio analyzer that:
1. Takes a list of stock symbols as input
2. Fetches ESG ratings from /api/esg-data/{symbol} for each stock
3. Gets financial ratios from /api/ratios-ttm/{symbol}
4. Calculates portfolio-weighted ESG scores
5. Identifies high ESG-rated stocks with good financial metrics
6. Uses /api/sectors-performance to show sector allocation"
# Create Calendar Event Dashboard
"Build a financial calendar dashboard that:
1. Fetches upcoming events from /api/ipo-calendar, /api/dividend-calendar, /api/splits-calendar
2. Shows economic events from /api/economic-calendar
3. Displays events in a calendar view
4. Allows filtering by event type and date range
5. Gets company details for IPOs using /api/company-profile/{symbol}"
# Market Status Monitor
"Create a market status monitoring service that:
1. Checks /api/is-market-open every minute
2. Fetches /api/treasury-rates when market opens
3. Gets pre-market data from /api/pre-post-market/{symbol} for watchlist
4. Monitors /api/social-sentiment-trending for unusual activity
5. Sends notifications for market open/close and significant events"
{
"error": "Symbol not found",
"message": "The requested symbol INVALID does not exist",
"statusCode": 404
}
GET /api/quote/{symbol}
- Real-time quotePOST /api/quotes/bulk
- Multiple quotesGET /api/quotes
- All tracked quotesGET /api/crypto-quotes
- Cryptocurrency quotesGET /api/crypto-quote/{symbol}
- Single crypto quoteGET /api/quote-short/{symbol}
- Abbreviated quoteGET /api/full-quote/{symbol}
- Extended quote dataGET /api/otc-real-time/{symbol}
- OTC real-time pricesGET /api/pre-post-market/{symbol}
- Pre/post market dataGET /api/company-profile/{symbol}
- Company profileGET /api/key-executives/{symbol}
- Executive teamGET /api/company-outlook/{symbol}
- Comprehensive outlookGET /api/shares-float/{symbol}
- Shares floatGET /api/employees/{symbol}
- Employee countGET /api/company-core-info/{symbol}
- Core informationGET /api/company-notes/{symbol}
- Company notesGET /api/income-statement/{symbol}?period={annual|quarter}
GET /api/balance-sheet/{symbol}?period={annual|quarter}
GET /api/cash-flow/{symbol}?period={annual|quarter}
GET /api/financial-growth/{symbol}
GET /api/financial-growth-quarterly/{symbol}
GET /api/key-metrics/{symbol}
- Key metricsGET /api/key-metrics-ttm/{symbol}
- TTM metricsGET /api/ratios/{symbol}
- Financial ratiosGET /api/ratios-ttm/{symbol}
- TTM ratiosGET /api/enterprise-values/{symbol}
- Enterprise valueGET /api/rating/{symbol}
- Company ratingGET /api/dcf/{symbol}
- DCF valuationGET /api/financial-score/{symbol}
- Financial scoreGET /api/market-gainers
- Top gainersGET /api/market-losers
- Top losersGET /api/market-actives
- Most activeGET /api/sectors-performance
- Sector performanceGET /api/sp500-constituents
- S&P 500 listGET /api/dowjones-constituents
- Dow Jones listGET /api/stock-screener
- Screen stocksGET /api/search-cik?query={query}
- Search by CIKGET /api/search-cusip?cusip={cusip}
- Search by CUSIPGET /api/search-isin?isin={isin}
- Search by ISINGET /api/available-traded
- All traded symbolsGET /api/ipo-calendar
- IPO calendarGET /api/dividend-calendar
- Dividend calendarGET /api/splits-calendar
- Splits calendarGET /api/earning-calendar?from={date}&to={date}
- EarningsGET /api/economic-calendar
- Economic eventsGET /api/news/{symbol}
- Company newsGET /api/market-news
- Market newsGET /api/social-sentiment/{symbol}
- Social sentimentGET /api/social-sentiment-trending
- Trending sentimentGET /api/press-releases/{symbol}
- Press releasesGET /api/analyst-estimates/{symbol}
- Analyst estimatesGET /api/analyst-recommendations/{symbol}
- Analyst buy/hold/sell recommendationsGET /api/grades-consensus/{symbol}
- Consensus analyst gradesGET /api/grades-historical/{symbol}
- Historical grade changesGET /api/grades-news/{symbol}?page=0&limit=10
- Grade change newsGET /api/price-target/{symbol}
- Price targetsGET /api/price-target-consensus/{symbol}
- Target consensusGET /api/insider-trading/{symbol}
- Insider tradesGET /api/insider-statistics/{symbol}
- Insider statsGET /api/institutional-holders/{symbol}
- InstitutionsGET /api/etf-holdings/{symbol}
- ETF holdingsGET /api/senate-trading/{symbol}
- Senate tradesGET /api/esg-data/{symbol}
- ESG ratingsGET /api/fail-to-deliver/{symbol}
- Fail to deliverGET /api/delisted-companies
- Delisted companiesGET /api/symbol-changes
- Symbol changesGET /api/is-market-open
- Market open statusGET /api/market-hours
- Trading hoursGET /api/treasury-rates
- Treasury rates