langchain-tickerlayer
LangChain tools for the TickerLayer market data API. They give an agent quotes, trades, daily snapshots and historical bars for stocks, ETFs, indices, forex, crypto, commodities and perpetual futures, plus government bond yields and market hours. Every tool only reads data.
Installation
pip install -U langchain-tickerlayer
Create a TickerLayer account, copy your API key from the dashboard and set it as an environment variable:
export TICKERLAYER_API_KEY="your-key"
The free plan covers crypto, forex and US stocks; other asset classes need a paid plan.
Use with an agent
The agent below also needs LangChain and a model package, here
pip install -U langchain langchain-anthropic with ANTHROPIC_API_KEY set.
from langchain.agents import create_agent
from langchain_tickerlayer import TickerLayerToolkit
tools = TickerLayerToolkit().get_tools()
agent = create_agent("anthropic:claude-sonnet-5-5", tools)
result = agent.invoke({"messages": [{"role": "user", "content": "How is BTCUSD doing today?"}]})
print(result["messages"][-1].content)
Any chat model with tool calling works. Each tool can also be used on its own:
from langchain_tickerlayer import TickerLayerSnapshotTool
snapshot = TickerLayerSnapshotTool()
print(snapshot.invoke({"asset_class": "stocks", "symbol": "US:KO"}))
Tools return the API's JSON as a string. Errors (an unknown symbol, a plan that does not include the data, a rate limit) come back to the agent as text instead of raising.
Tools
| Tool | Class | Returns |
|---|---|---|
get_snapshot |
TickerLayerSnapshotTool |
Last trade, quote, previous close and daily change |
get_quote |
TickerLayerQuoteTool |
Latest bid and ask |
get_last_trade |
TickerLayerLastTradeTool |
Most recent trade: price, size, timestamp |
get_previous_close |
TickerLayerPreviousCloseTool |
Previous daily bar, or the last settled intraday bar |
get_history |
TickerLayerHistoryTool |
OHLCV bars between two UTC dates (minute, hour, day) |
list_symbols |
TickerLayerListSymbolsTool |
Symbols the key can read in an asset class, with a filter |
get_market_status |
TickerLayerMarketStatusTool |
Open, closed, pre-market or post-market by region |
get_market_sessions |
TickerLayerMarketSessionsTool |
Session windows for a market or symbol on a date |
get_market_holidays |
TickerLayerMarketHolidaysTool |
Holiday closures and early closes |
get_bond_yield |
TickerLayerBondYieldTool |
Latest government bond yield, such as US:10Y |
The names and arguments match the tools of the hosted TickerLayer MCP server, so an agent behaves the same with either.
Symbols
Stocks use a country prefix (US:KO, DE:SAP), crypto and forex use joined pairs (BTCUSD,
EURUSD), commodities use codes such as XAUUSD, indices use region codes (US500), ETFs use the
fund ticker in the etfs asset class (SPY), and perpetual futures use USDT-quoted codes
(BTCUSDT). list_symbols returns what the key can read.
Options
TickerLayerToolkit and every tool accept api_key (instead of the environment variable) and
base_url. Tools from one toolkit share a single HTTP client pair.
Links
Market data from TickerLayer is derived data, not exchange data.
License
MIT
Metadata
Release files for langchain-tickerlayer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_tickerlayer-0.1.0.tar.gz | 10.0 kB | Without provenance | Details for langchain_tickerlayer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_tickerlayer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_tickerlayer-0.1.0-py3-none-any.whl |
Total release size: 20.1 kB
Release files / langchain_tickerlayer-0.1.0.tar.gz
| Download URL | langchain_tickerlayer-0.1.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1842eaa9eaf5572a799845c3a0771d554ebeda572e7fe5a83b054dc3323f3dd
|
|
BLAKE2b-256 checksum How to use checksums |
37afeb90e4c40aa827fc34d7636ab7fcb2bf6d39871603d264eabceb2fbb523b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / langchain_tickerlayer-0.1.0-py3-none-any.whl
| Download URL | langchain_tickerlayer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55800cd88d110a5826af8ff8993fa32c39817ba1423ca4493d755aa77e829b5a
|
|
BLAKE2b-256 checksum How to use checksums |
43b314805717391e687d30594aaf647e180ef59e70a17d267b24b00cf91bd59d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for langchain-tickerlayer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.