GET
/companies/{ticker}/cash-flowPro: API access to this route needs a Pro plan (a free key gets 403; on Free, use /data/metrics). Get cash flow statement data including operating, investing, and financing activities. Free cash flow is calculated automatically.
Example Request
https://api.metricduck.com/api/v1/companies/AAPL/cash-flow?period=quarterly&years=1Path Parameters
| Parameter | Type | Description |
|---|---|---|
tickerrequired | string | Stock ticker symbol (e.g., AAPL, MSFT, GOOGL) |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
period | string | Reporting period: "quarterly", "annual", or "ttm" (trailing twelve months). Foreign private issuers (20-F/40-F) file annually; quarterly income-statement and cash-flow usually return 404 for them; use period=annual. |
years | integer | Years of history to return (1–10) |
vantage_date | string | As-of date (YYYY-MM-DD): returns only periods filed on or before it and cites the filing of that era. Values are the latest filed, so a later restatement or recast is served; revised_after_vantage flags only a later amendment of the period's own filing. Omit for the latest. |
signed | boolean | When true, cash outflows (capex, dividends_paid, stock_repurch) and operating asset increases are returned negative, as on the filed statement. Default: positive magnitudes. |
Response
Returns company info and an array of cash flow statement periods. All monetary values are in USD. Cash outflows are positive magnitudes by default; pass signed=true to get them negative, as on the filed statement.
Data Fields
| Field | Type | Description |
|---|---|---|
period_end | string | End date of the reporting period (YYYY-MM-DD) |
period_type | string | Period type: "quarterly" or "annual" |
net_income | numbernullable | Net income (starting point for cash flow) |
depreciation_amortization | numbernullable | Depreciation and amortization |
stock_based_compensation | numbernullable | Stock-based compensation expense |
change_in_working_capital | numbernullable | Changes in working capital |
operating_cash_flow | numbernullable | Net cash from operating activities |
capital_expenditures | numbernullable | Capital expenditures (CapEx) |
acquisitions | numbernullable | Cash paid for acquisitions |
investment_purchases | numbernullable | Purchases of investments |
investment_sales | numbernullable | Sales/maturities of investments |
investing_cash_flow | numbernullable | Net cash from investing activities |
debt_issued | numbernullable | Proceeds from debt issuance |
debt_repaid | numbernullable | Debt repayments |
dividends_paid | numbernullable | Cash dividends paid |
stock_repurchased | numbernullable | Cash paid for share repurchases |
financing_cash_flow | numbernullable | Net cash from financing activities |
net_change_in_cash | numbernullable | Net change in cash and cash equivalents |
free_cash_flow | numbernullable | Free cash flow (operating cash flow - CapEx) |
Example Response
{
"company_name": "Apple Inc.",
"ticker": "AAPL",
"cik": "0000320193",
"data": [
{
"period_end": "2024-09-30",
"period_type": "quarterly",
"net_income": 14736000000,
"depreciation_amortization": 2910000000,
"stock_based_compensation": 2956000000,
"change_in_working_capital": 5234000000,
"operating_cash_flow": 26810000000,
"capital_expenditures": -2120000000,
"acquisitions": 0,
"investment_purchases": -18460000000,
"investment_sales": 19820000000,
"investing_cash_flow": -654000000,
"debt_issued": 0,
"debt_repaid": -1750000000,
"dividends_paid": -3850000000,
"stock_repurchased": -25670000000,
"financing_cash_flow": -31340000000,
"net_change_in_cash": -5184000000,
"free_cash_flow": 24690000000
}
],
"count": 1,
"has_more": true
}Code Examples
Python
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://api.metricduck.com/api/v1"
# Get the last year of quarterly cash flow statements
response = requests.get(
f"{BASE_URL}/companies/AAPL/cash-flow",
headers={"X-API-Key": API_KEY},
params={"period": "quarterly", "years": 1}
)
data = response.json()
print(f"Company: {data['company_name']}")
for period in data['data']:
ocf = period['operating_cash_flow']
fcf = period['free_cash_flow']
print(f"{period['period_end']}: Operating CF ${ocf:,.0f}, FCF ${fcf:,.0f}")JavaScript
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://api.metricduck.com/api/v1';
// Get the last year of quarterly cash flow statements
const response = await fetch(
`${BASE_URL}/companies/AAPL/cash-flow?` +
new URLSearchParams({ period: 'quarterly', years: '1' }),
{
headers: {
'X-API-Key': API_KEY
}
}
);
const data = await response.json();
console.log(`Company: ${data.company_name}`);
data.data.forEach(period => {
const ocf = period.operating_cash_flow?.toLocaleString() ?? 'N/A';
const fcf = period.free_cash_flow?.toLocaleString() ?? 'N/A';
console.log(`${period.period_end}: Operating CF $${ocf}, FCF $${fcf}`);
});Notes
- - Cash outflows (CapEx, dividends, repurchases) are positive magnitudes unless signed=true
- - Free cash flow = Operating cash flow - Capital expenditures
- - Some fields may be null if not reported by the company
- - Data is sourced directly from SEC XBRL filings