Quickstart
Follow this workflow to go from symbol discovery to historical financial data in a few requests.
Overview
Most integrations start with company search, then move into quote data, price history, profile data, and statement history.
Use the examples below as a minimal starting path.
1. Search For A Company
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/search?query=apple&limit=5"
Use search when you need to find the correct ticker before requesting other datasets.
2. Fetch A Quote Snapshot
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/quote"
This returns the latest price snapshot together with valuation fields such as market cap, P/E, and related quote data.
3. Fetch Price History
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/price?start_date=2024-01-01&end_date=2024-12-31"
This returns daily rows with date, open, close, high, low, and volume for the requested range.
Typical use cases:
- charting
- backtesting
- time-series analysis
- custom price exports
4. Fetch Dividend Data
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/dividend"
This returns the latest dividend snapshot stored for the symbol, including payout, yield, and next payment fields.
5. Fetch A Company Profile
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/profile"
This returns identity and general company metadata such as company_name, exchange, market, cik, and business description fields.
6. Fetch Statement History
Quarterly income statement:
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/income-statement?period_type=quarterly&limit=4"
Annual balance sheet:
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/balance-sheet?period_type=annual&limit=3"
Quarterly cash flow statement:
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/cash-flow-statement?period_type=quarterly&limit=4"
Use statement endpoints when you need multi-period fundamentals for historical analysis.
7. Fetch SEC Filings
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/stocks/AAPL/secfiling?form_type=10-K&limit=20"
This returns filing metadata for the symbol, including filing date, accession number, CIK, and SEC URL.
Use it when you need an audit trail back to the underlying SEC filing.
8. Check Service Health
curl "https://api.apifinance.ai/health"
JavaScript Example
const response = await fetch('https://api.apifinance.ai/stocks/MSFT/quote', {
headers: {
Authorization: `Bearer ${process.env.your_api_key}`
}
})
if (!response.ok) {
throw new Error(`Request failed with ${response.status}`)
}
const data = await response.json()
console.log(data)