FinanceTools with financialdatasets.AI
Same agent as 01_market_brief.py, different data provider.
"""
FinanceTools with financialdatasets.ai
======================================
Same agent as 01_market_brief.py, different data provider.
financialdatasets.ai is a structured, real-time market data API built for
agents (statements, metrics, filings, insider trades, news). Swap it in with
`provider=FinancialDatasets()` (or the shorthand `provider="financial_datasets"`);
the tool names and JSON shapes the agent sees do not change.
The provider does not offer symbol search or analyst consensus, so those two
tools are simply not registered. Everything else is served from the API.
Setup:
export FINANCIAL_DATASETS_API_KEY=... # requests cost credits: https://financialdatasets.ai/pricing
"""
from agno.agent import Agent
from agno.tools.finance import FinanceTools
from agno.tools.finance.providers import FinancialDatasets
# ---------------------------------------------------------------------------
# Create the Agent
# ---------------------------------------------------------------------------
finance_tools = FinanceTools(provider=FinancialDatasets(), all=True)
agent = Agent(
name="Finance Agent",
model="openai:gpt-5.6",
tools=[finance_tools],
instructions="Lead with the answer, then show the evidence. Cite the reporting period for any statement figures.",
markdown=True,
)
# ---------------------------------------------------------------------------
# Run the Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
print("Provider status:", finance_tools.status())
print("Registered tools:", finance_tools.registered_tools)
agent.print_response(
"Give me a market brief on NVIDIA, including last quarter's revenue and net margin.",
stream=True,
)all=True registers only the capabilities this provider declares, so symbol search and analyst recommendations are absent. status() checks local key configuration; it does not make an authenticated API health request. The actual data calls require a valid Financial Datasets key. No yfinance installation is needed for this provider.
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openaiExport your API keys
export FINANCIAL_DATASETS_API_KEY="your_financial_datasets_api_key_here"
export OPENAI_API_KEY="your_openai_api_key_here"Run the example
Save the code above as financial_datasets.py, then run:
python financial_datasets.pyFull source: cookbook/91_tools/finance/02_financial_datasets.py