Skip to main content

langchain-twelvedata

LangChain tools for Twelve Data market data. The toolkit makes four read-only REST endpoints available to an agent: quote, historical time series, symbol search, and Relative Strength Index (RSI).

Install

pip install langchain-twelvedata

Tools

  • twelvedata_quote — symbol
  • twelvedata_time_series — symbol, interval, outputsize
  • twelvedata_symbol_search — query (company name or partial ticker, not symbol)
  • twelvedata_rsi — symbol, interval, time_period

Each tool returns a JSON string with the Twelve Data response.

Quick start

Set a Twelve Data API key in your environment:

export TWELVE_DATA_API_KEY="your-api-key"

Invoke a tool directly:

import json

from langchain_twelvedata import TwelveDataToolkit

tools = TwelveDataToolkit().get_tools()
quote = next(tool for tool in tools if tool.name == "twelvedata_quote")
data = json.loads(quote.invoke({"symbol": "AAPL"}))
print(data["close"])

Pass the same tools list to a LangChain agent or a tool-calling model:

history = next(tool for tool in tools if tool.name == "twelvedata_time_series")
print(history.invoke({"symbol": "AAPL", "interval": "1day", "outputsize": 5}))
search = next(tool for tool in tools if tool.name == "twelvedata_symbol_search")
print(search.invoke({"query": "Apple"}))

The API key can also be passed explicitly with TwelveDataToolkit(TwelveDataClient(api_key="...")) after importing TwelveDataClient from langchain_twelvedata. Twelve Data API errors and HTTP errors are raised to the caller.

Development

git clone https://github.com/MazeBraker/langchain-twelvedata.git
cd langchain-twelvedata
pip install -e '.[test]'
pytest

License

MIT

Metadata

Release files for langchain-twelvedata 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-twelvedata 0.1.1
File Size Uploaded
langchain_twelvedata-0.1.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-twelvedata 0.1.1
File Interpreter ABI Platform
langchain_twelvedata-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / langchain_twelvedata-0.1.1.tar.gz

Download URL langchain_twelvedata-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
47481d5ada1080162d21580ab730554b56af575dfe541fc813f782ac21d41aa9
BLAKE2b-256 checksum
How to use checksums
7edf4a842185f04eb63b2b5ddd756a9f62ca2508e19be6b804935ad82ef34f5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / langchain_twelvedata-0.1.1-py3-none-any.whl

Download URL langchain_twelvedata-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c4777f72d5c4d68bbb4e82ab42b62b5ed797a5404729c0c969e8b21a3c2442c
BLAKE2b-256 checksum
How to use checksums
982df5cd62b9bf3a8c62df7fe4c08d5eb585ddb06c290c65ac1a244964268d4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page