curl --request GET \
--url https://api.financialdatasets.ai/financial-metrics \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/financial-metrics"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/financial-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/financial-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/financial-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/financial-metrics")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/financial-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"report_period": "2023-12-25",
"fiscal_period": "<string>",
"period": "quarterly",
"currency": "<string>",
"accession_number": "<string>",
"form_type": "<string>",
"filing_url": "<string>",
"filing_date": "2023-12-25",
"filing_datetime": "2023-11-07T05:31:56Z",
"enterprise_value": 123,
"price_to_earnings_ratio": 123,
"price_to_book_ratio": 123,
"price_to_sales_ratio": 123,
"enterprise_value_to_ebitda_ratio": 123,
"enterprise_value_to_revenue_ratio": 123,
"free_cash_flow_yield": 123,
"peg_ratio": 123,
"gross_margin": 123,
"operating_margin": 123,
"net_margin": 123,
"return_on_equity": 123,
"return_on_assets": 123,
"return_on_invested_capital": 123,
"asset_turnover": 123,
"inventory_turnover": 123,
"receivables_turnover": 123,
"days_sales_outstanding": 123,
"operating_cycle": 123,
"working_capital_turnover": 123,
"current_ratio": 123,
"quick_ratio": 123,
"cash_ratio": 123,
"operating_cash_flow_ratio": 123,
"debt_to_equity": 123,
"debt_to_assets": 123,
"interest_coverage": 123,
"revenue_growth": 123,
"earnings_growth": 123,
"book_value_growth": 123,
"earnings_per_share_growth": 123,
"free_cash_flow_growth": 123,
"operating_income_growth": 123,
"ebitda_growth": 123,
"payout_ratio": 123,
"earnings_per_share": 123,
"book_value_per_share": 123,
"free_cash_flow_per_share": 123,
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Financial Metrics API (Historical)
Historical financial ratios for 19,000+ US tickers with 30+ years of history: P/E, EV/EBITDA, ROE, margins, growth, and other annual, quarterly, and TTM metrics.
curl --request GET \
--url https://api.financialdatasets.ai/financial-metrics \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.financialdatasets.ai/financial-metrics"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.financialdatasets.ai/financial-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.financialdatasets.ai/financial-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.financialdatasets.ai/financial-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/financial-metrics")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.financialdatasets.ai/financial-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"report_period": "2023-12-25",
"fiscal_period": "<string>",
"period": "quarterly",
"currency": "<string>",
"accession_number": "<string>",
"form_type": "<string>",
"filing_url": "<string>",
"filing_date": "2023-12-25",
"filing_datetime": "2023-11-07T05:31:56Z",
"enterprise_value": 123,
"price_to_earnings_ratio": 123,
"price_to_book_ratio": 123,
"price_to_sales_ratio": 123,
"enterprise_value_to_ebitda_ratio": 123,
"enterprise_value_to_revenue_ratio": 123,
"free_cash_flow_yield": 123,
"peg_ratio": 123,
"gross_margin": 123,
"operating_margin": 123,
"net_margin": 123,
"return_on_equity": 123,
"return_on_assets": 123,
"return_on_invested_capital": 123,
"asset_turnover": 123,
"inventory_turnover": 123,
"receivables_turnover": 123,
"days_sales_outstanding": 123,
"operating_cycle": 123,
"working_capital_turnover": 123,
"current_ratio": 123,
"quick_ratio": 123,
"cash_ratio": 123,
"operating_cash_flow_ratio": 123,
"debt_to_equity": 123,
"debt_to_assets": 123,
"interest_coverage": 123,
"revenue_growth": 123,
"earnings_growth": 123,
"book_value_growth": 123,
"earnings_per_share_growth": 123,
"free_cash_flow_growth": 123,
"operating_income_growth": 123,
"ebitda_growth": 123,
"payout_ratio": 123,
"earnings_per_share": 123,
"book_value_per_share": 123,
"free_cash_flow_per_share": 123,
"next_page_url": "<string>"
}{
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"error": "Unauthorized",
"message": "Invalid API key provided"
}{
"error": "Payment Required",
"message": "This endpoint requires a paid subscription. Please upgrade your plan."
}{
"error": "Not Found",
"message": "Ticker XXXX not found"
}Overview
The Financial Datasets financial metrics API returns historical financial ratios and metrics for a stock ticker, such as P/E, EV/EBITDA, ROE, margins, and growth rates, by year, by quarter, or trailing twelve months (TTM). It covers 19,000+ US tickers with 30+ years of history, updated within 1 second. The metrics are based on financial statements parsed directly from SEC filings (data provenance). For the latest values, use the Snapshot endpoint. You can call it as a REST endpoint with an API key, or from Claude, ChatGPT, Cursor, and other AI apps through the MCP server, or pay per request with x402. Pricing starts at $20. Financial metrics include a company’s valuation, profitability, efficiency, liquidity, leverage, growth, and per share metrics over the requested period. To get started, please create an account and grab your API key at financialdatasets.ai. You will use the API key to authenticate your API requests.Coverage
| Tickers | Years of Coverage | Updated |
|---|---|---|
| 19,000+ | 30+ years | Within 1 second |
Available Tickers
You can fetch a list of available tickers with aGET request to:
https://api.financialdatasets.ai/financial-metrics/tickers/
Getting Started
There are only 3 steps for making a successful API call:- Add your API key to the header of the request as
X-API-KEY. - Add query params like
tickerto filter the data. - Execute the API request.
Filtering the Data
You can filter the data byticker, period, limit, and report_period.
Note: ticker and period are required. By default, limit is 4 and report_period is null.
The period parameter can be set to annual, quarterly, or ttm (trailing twelve months). The limit parameter is used to specify the number of periods to return.
The report_period parameter is used to specify the date of the financial metrics. For example, you can include filters like report_period_lte=2024-09-30 and report_period_gte=2024-01-01 to get financial metrics between January 1, 2024 and September 30, 2024.
The available report_period operations are:
report_period_ltereport_period_ltreport_period_gtereport_period_gtreport_period
Example
import requests
# add your API key to the headers
headers = {
"X-API-KEY": "your_api_key_here"
}
# set your query params
ticker = 'NVDA' # stock ticker
period = 'annual' # possible values are 'annual', 'quarterly', or 'ttm'
limit = 30 # number of periods to return
# create the URL
url = (
f'https://api.financialdatasets.ai/financial-metrics'
f'?ticker={ticker}'
f'&period={period}'
f'&limit={limit}'
)
# make API request
response = requests.get(url, headers=headers)
# parse financial_metrics from the response
financial_metrics = response.json().get('financial_metrics')
Example (with report_period)
import requests
# add your API key to the headers
headers = {
"X-API-KEY": "your_api_key_here"
}
# set your query params
ticker = 'NVDA'
period = 'ttm'
report_period_lte = '2024-01-01' # end date
report_period_gte = '2020-01-01' # start date
# create the URL
url = (
f'https://api.financialdatasets.ai/financial-metrics'
f'?ticker={ticker}'
f'&period={period}'
f'&report_period_lte={report_period_lte}'
f'&report_period_gte={report_period_gte}'
)
# make API request
response = requests.get(url, headers=headers)
# parse financial_metrics from the response
financial_metrics = response.json().get('financial_metrics')
FAQ
Which metrics are included?
Valuation, profitability, efficiency, liquidity, leverage, growth, and per share metrics. Examples are P/E, P/B, EV/EBITDA, free cash flow yield, gross margin, ROE, ROIC, current ratio, debt to equity, revenue growth, and EPS.Can I get quarterly or TTM metrics?
Yes. Setperiod to annual, quarterly, or ttm.
Can I get metrics for a past date range?
Yes. Filter withreport_period_gte and report_period_lte, for example report_period_gte=2020-01-01 and report_period_lte=2024-01-01.
Can an AI agent use this data?
Yes. Claude, ChatGPT, Cursor, and other MCP clients reach it through the Financial Datasets MCP server. An agent with a wallet can also pay per request with x402, with no account.Query Parameters
The market the company is listed in: US (the default), UK or FR. Any ticker of the company, including a second share class, returns the company's metrics. Price-based values (market cap, enterprise value, valuation ratios, dividend yield) are not yet available for UK tickers.
US, UK, FR Response
The historical financial metrics and ratios for a ticker
The SEC form this row was sourced from (10-K, 10-Q/A, 20-F, S-1, ...). The exact form as filed, so amendments keep their /A suffix. Null when period is ttm: a trailing twelve month window can span multiple filings, so we don't attribute it to one. A quarterly row can carry 10-K when the fourth quarter is derived from the fiscal-year filing.