Metadata-Version: 2.4
Name: langchain-finzdata
Version: 0.1.0
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/langchain-finzdata
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

# 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 34 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. 231 ETFs. 139 futures markets with every
contract since 2007. GEX for single stocks, ETFs and the major indexes. COT
since 1986. 13F. SEC fundamentals as filed. 18,000+ macro series with every
vintage kept. Crypto since 2015.

## 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.
