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

Before the PyPI release, install from a clone:

git clone https://github.com/MazeBraker/langchain-twelvedata.git
cd langchain-twelvedata
pip install .

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. Each tool returns a JSON string containing the Twelve Data response. For example:

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

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

pip install -e '.[test]'
pytest

License

MIT

Metadata

Release files for langchain-twelvedata 0.1.0

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.0
File Size Uploaded
langchain_twelvedata-0.1.0.tar.gz 5.2 kB Details

Built distribution (wheel)

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

Total release size: 10.6 kB

Release files / langchain_twelvedata-0.1.0.tar.gz

Download URL langchain_twelvedata-0.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3905d3eb2a022f9cf066ddf6b61a9eb0e094801968af0f57c9f9fc61441db991
BLAKE2b-256 checksum
How to use checksums
f3f6857d289c0d8ede1e6f2a480393e6a2f1f882ef6dcc00cbe2f11bcb87d36f
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.0-py3-none-any.whl

Download URL langchain_twelvedata-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa1f28c3cc807dcde1f2515bcfa05d9a5f7200bbb592894dd0ed44f67dc47a8
BLAKE2b-256 checksum
How to use checksums
f26bdb4f7f9157d0e496bacefe6f72a24cb753c4ce93f193a6f80508e928feb7
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

0.1.1

2 release files

This release

0.1.0 This release

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