Metadata-Version: 2.4
Name: langchain-finzdata
Version: 0.1.1
Summary: FinzData tools for LangChain and LangGraph agents: point-in-time, survivorship-free market data and server-side backtests via the FinzData MCP server.
Author-email: FinzData <info@finzdata.com>
License: MIT
Project-URL: Homepage, https://finzdata.com/agents
Project-URL: Documentation, https://finzdata.com/docs
Project-URL: Source, https://github.com/FinzData/finzdata-python/tree/main/templates/langgraph-agent
Keywords: langchain,langgraph,finzdata,mcp,market-data,backtesting,ai-agents,point-in-time,finance
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain-mcp-adapters>=0.1
Dynamic: license-file

<p align="center"><a href="https://finzdata.com"><img src="https://finzdata.com/assets/brand/finzdata-logo-full.png" alt="FinzData" width="360"></a></p>

# langchain-finzdata

FinzData tools for LangChain and LangGraph agents in one line.

## Why

Agents answering market questions need point-in-time, survivorship-free data.
FinzData includes delisted stocks, macro as known on a date, and server-side
backtests so the agent doesn't pull raw bars. The MCP server exposes 39 tools
and works with no key for the last 6 months, or with a Bearer key for more
history.

## Coverage

16,000+ US stocks that have traded on NYSE and Nasdaq since January 2000,
delisted included, point in time. 5,100+ ETFs. Tick trades for 1,100+ stocks and ETFs. 139 futures markets with every contract since 2007. Options gamma (GEX)
for 11,200+ stocks, ETFs and indexes since 2010, and end-of-day options chains.
COT since 1986. 13F, insider trades, short interest. SEC fundamentals as filed.
22,700+ macro series with every vintage kept. 74 crypto pairs, 79 FX pairs,
123 indexes, congressional trades and election spending.

## Install

pip install langchain-finzdata

## Free start

No key required for the last 6 months. Free key, email only, 12 months:
https://finzdata.com/account?ref=langchain
Set FINZDATA_API_KEY in your environment. Full history from $19 per ticker,
yours to keep: https://finzdata.com/shop?ref=langchain

## LangGraph example

from langgraph.prebuilt import create_react_agent
from langchain_finzdata import load_finzdata_tools

tools = load_finzdata_tools()
agent = create_react_agent("anthropic:claude-sonnet-4-5", tools)
agent.invoke({"messages": [("user", "Backtest 12-1 momentum on US stocks since 2010, survivorship-free")]})

Any chat model works.

## Async and filtering

In async code (FastAPI, notebooks with a running loop), await the tools directly, and pick only the tools you need:

```python
from langchain_finzdata import get_finzdata_tools

tools = await get_finzdata_tools(include=["get_bars", "run_backtest", "get_macro_vintage"])
```

Pass `api_key="..."` (or set `FINZDATA_API_KEY`) to go beyond the keyless 6-month preview.

## Main tools

| Tool | Description |
|------|-------------|
| get_bars | OHLCV bars point-in-time |
| get_futures | Futures continuous and contracts |
| get_crypto | Crypto OHLCV |
| get_gex | Gamma exposure |
| get_cot | Commitments of Traders |
| get_13f | 13F filings |
| get_fundamentals_pit | Fundamentals as filed |
| get_macro_vintage | Macro with vintage |
| run_backtest | Server-side backtest |
| survivorship_audit | Survivorship audit |
| get_bars | Price bars with survivorship handling |
| get_fundamentals_pit | Point-in-time fundamentals |
| get_macro_vintage | Macro series by vintage date |

## Other frameworks

LlamaIndex

BasicMCPClient("https://api.finzdata.com/mcp")
McpToolSpec

CrewAI

MCPServerAdapter({"url": "https://api.finzdata.com/mcp", "transport": "streamable-http"})

OpenAI Agents SDK

MCPServerStreamableHttp(params={"url": "https://api.finzdata.com/mcp"})

MIT

FinzData is not affiliated with LangChain, LlamaIndex, CrewAI or OpenAI.

Support: info@finzdata.com

FinzData: built for AI, quants, data scientists and financial analysts who backtest. Clean data. Real insights. Real alpha.
