Financial Datasets API

FinancialDatasetsTools give an Agent access to stock prices, financial statements, SEC filings, and cryptocurrency data from the Financial Datasets API.

FinancialDatasetsTools provide a comprehensive API for retrieving and analyzing diverse financial datasets, including stock prices, financial statements, company information, SEC filings, and cryptocurrency data from multiple providers.

Prerequisites

The toolkit requires a Financial Datasets API key that can be obtained by creating an account at financialdatasets.ai.

uv pip install agno requests openai

Set your API key as an environment variable:

export FINANCIAL_DATASETS_API_KEY=your_api_key_here

Example

Basic usage of the Financial Datasets toolkit:

from agno.agent import Agent
from agno.tools.financial_datasets import FinancialDatasetsTools

agent = Agent(
    name="Financial Data Agent",
    tools=[FinancialDatasetsTools(include_tools=["get_income_statements", "get_balance_sheets", "get_cash_flow_statements"])],
    description="You are a financial data specialist that helps analyze financial information for stocks and cryptocurrencies.",
    instructions=[
        "When given a financial query:",
        "1. Use appropriate Financial Datasets methods based on the query type",
        "2. Format financial data clearly and highlight key metrics",
        "3. For financial statements, compare important metrics with previous periods when relevant",
        "4. Calculate growth rates and trends when appropriate",
        "5. Handle errors gracefully and provide meaningful feedback",
    ],
    markdown=True,
)

# Get the most recent income statement for Apple
agent.print_response("Get the most recent income statement for AAPL and highlight key metrics")

See the full Financial Datasets example in the cookbook.

Toolkit Params

ParameterTypeDefaultDescription
api_keyOptional[str]NoneOptional API key. If not provided, uses FINANCIAL_DATASETS_API_KEY environment variable
timeoutint30Per-request HTTP timeout in seconds

Toolkit Functions

FunctionDescription
get_income_statementsGet income statements for a company with options for annual, quarterly, or trailing twelve months (ttm) periods
get_balance_sheetsGet balance sheets for a company with period options
get_cash_flow_statementsGet cash flow statements for a company
get_company_infoGet company information including business description, sector, and industry
get_crypto_pricesGet cryptocurrency prices with configurable time intervals
get_earningsGet earnings reports with EPS estimates, actuals, and revenue data
get_financial_metricsGet key financial metrics and ratios for a company
get_insider_tradesGet data on insider buying and selling activity
get_institutional_ownershipGet information about institutional investors and their positions
get_newsGet market news, optionally filtered by company
get_stock_pricesGet historical stock prices with configurable time intervals
search_tickersSearch for stock tickers based on a query string
get_sec_filingsGet SEC filings with optional filtering by form type (10-K, 10-Q, etc.)
get_segmented_financialsGet segmented financial data by product category and geographic region

You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Rate Limits and Usage

The Financial Datasets API applies rate limits based on your subscription tier. See pricing for the request allowance and rate limits on each plan.

Current adapter compatibility

The example enables the financial-statement tools. Several other registered methods need upstream updates before they match the current provider API:

  • get_stock_prices uses the old interval/request shape. The current historical stock prices API requires dates and interval values such as day, rather than 1d.
  • get_crypto_prices uses a separate legacy crypto route. Its current provider availability and request contract need verification before use; the stock endpoint's requirements do not establish the crypto contract.
  • get_company_info uses /company; current company facts use /company/facts.
  • get_financial_metrics uses /financials/metrics; the current endpoint is /financial-metrics.

Use the current provider API directly for these operations. The function table lists the adapter's registered surface, not a guarantee that every provider endpoint remains compatible.

Developer Resources