Skip to main content

langchain-dexpaprika

PyPI version License: MIT

DexPaprika tools for LangChain agents. No API key and no signup to start: the DexPaprika API free tier is keyless, so your agent gets DEX market data across every supported blockchain (36 chains, 33M+ tokens, 36M+ pools) as soon as you install the package.

We built these tools for LLM consumption: descriptions tell the model exactly which parameters exist and where to get their values, error messages quote the API's own allowed-value lists so the model can self-correct, and outputs are compact JSON with multi-kilobyte token descriptions trimmed.

Installation

pip install -U langchain-dexpaprika

No credentials to configure. This package calls the keyless free tier and sends no API key, so there is no environment variable to set. The free tier is keyless, with data delayed up to 15 seconds; see https://docs.dexpaprika.com/knowledge-base/rate-limits for the current rates and quotas, and https://dexpaprika.com/api/pricing for the paid tiers.

Quickstart

from langchain_dexpaprika import DexPaprikaSearch

search = DexPaprikaSearch()
print(search.invoke({"query": "WETH"}))

This returns compact JSON with matching tokens (contract address, chain, USD price, liquidity), pools, and DEXes.

Tools

Tool name Class What it returns
dexpaprika_search DexPaprikaSearch Tokens, pools, and DEXes matching a name, symbol, or address. The entry point when you only have a ticker.
dexpaprika_token_details DexPaprikaTokenDetails Price, FDV, liquidity, pool count, and 24h/6h/1h volume with buy/sell breakdown for one token on one network.
dexpaprika_token_pools DexPaprikaTokenPools Pools where a token trades, sortable by volume, liquidity, transactions, age, price, or 24h price change.
dexpaprika_pool_ohlcv DexPaprikaPoolOHLCV Historical OHLCV candles for one pool, intervals from 1m to 24h, up to 1000 candles per call. History depth depends on your plan.
dexpaprika_networks DexPaprikaNetworks Every supported network with its exact id, 24h volume, transactions, and pool counts.

Use the toolkit in an agent

DexPaprikaToolkit bundles all five tools over one shared HTTP client. The example below drives them with an Anthropic model, so install the provider and set its key first (swap in any chat model you prefer):

pip install -U "langchain[anthropic]"
export ANTHROPIC_API_KEY=...
from langchain.agents import create_agent
from langchain_dexpaprika import DexPaprikaToolkit

toolkit = DexPaprikaToolkit()
agent = create_agent("claude-sonnet-4-5", toolkit.get_tools())
result = agent.invoke(
    {"messages": [("user", "Find the most liquid WETH pool on ethereum")]}
)

The tool descriptions chain naturally: an agent starts with dexpaprika_search to resolve a ticker into a contract address and network id, then feeds those into the other tools.

Individual tools

Every tool works standalone, sync and async:

from langchain_dexpaprika import DexPaprikaPoolOHLCV

ohlcv = DexPaprikaPoolOHLCV()
candles = ohlcv.invoke(
    {
        "network": "ethereum",
        "pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
        "start": "-24h",  # the last 24 hours, which works without a key
        "interval": "1h",
        "limit": 24,
    }
)

start and end take an offset back from now (-24h, -7d, -90m) as well as YYYY-MM-DD, RFC3339 and Unix seconds. How far back you can go and how fine the candles can be depends on your plan: without a key, the last 24 hours at 1h and longer; a free key opens 7 days at 10m and longer; Dev 30 days at every interval; Pro unlimited. A request outside your plan fails with the API's message, which names the plan that allows it. Full table: OHLCV limits by plan.

Using an API key (optional)

The toolkit works without a key. No signup, no card.

A free key raises the monthly credit allowance and the per-minute request limit, and opens 7 days of OHLCV history. Current figures are on the rate limits page.

from langchain_dexpaprika import DexPaprikaToolkit
from langchain_dexpaprika._client import DexPaprikaAPIWrapper

toolkit = DexPaprikaToolkit(api_wrapper=DexPaprikaAPIWrapper(api_key="api_your_key"))

# Or leave it out and set DEXPAPRIKA_API_KEY in the environment
toolkit = DexPaprikaToolkit()

An explicit api_key beats the environment variable, and no key at all keeps the previous keyless behaviour unchanged.

The key is excluded from repr() and model_dump(), because these wrappers end up inside agent traces and serialized chains, and a key in a trace is a credential in somebody's logs.

There is no Bearer prefix. The key is sent as the entire Authorization value, which is what the API expects; ApiKey or Token in front of it returns 401.

Pro customers also set base_url to https://api-pro.dexpaprika.com. The host never changes on its own, because a free key sent to the Pro host returns 403.

Error handling

We surface API errors as messages the agent can act on:

  • 400 responses quote the API's message verbatim, including the exact list of allowed values for the offending parameter.
  • 404 responses arrive with an empty body, so we synthesize a message that names the missing identifier and points at the tool that lists valid values.
  • 429 responses are retried automatically, honoring the Retry-After header, before we tell the agent to slow down.
  • 410 responses (removed endpoints) surface the replacement endpoint the API reports, with a hint to upgrade the package.

Development

uv venv
uv pip install -e '.[test]'
make lint                # ruff + mypy
make test                # unit tests, sockets blocked
make integration_tests   # live API, keyless, run serially

License

MIT

Metadata

Release files for langchain-dexpaprika 0.3.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-dexpaprika 0.3.0
File Size Uploaded Provenance
langchain_dexpaprika-0.3.0.tar.gz 158.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-dexpaprika 0.3.0
File Interpreter ABI Platform
langchain_dexpaprika-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 178.3 kB

Release files / langchain_dexpaprika-0.3.0.tar.gz

Download URL langchain_dexpaprika-0.3.0.tar.gz
Size 158.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7683f4a37b38fb9e5fd2751d39dfe3a279d917bd614c8268ddad20cc0e717b17
BLAKE2b-256 checksum
How to use checksums
fa83b6713a68c683d85421e81e4e823148a092b4c9d09a1017a163caf04d7ca8
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 28, 2026.

Transparency log

Release files / langchain_dexpaprika-0.3.0-py3-none-any.whl

Download URL langchain_dexpaprika-0.3.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c26bec35ff367cdd9da419608444aae1836b615af0c4401a40968363a1010303
BLAKE2b-256 checksum
How to use checksums
65c8f02602efb87dfc9b96ad95f2fbc5b1126f28586119e812d67d327adf5c94
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 28, 2026.

Transparency log

Security for langchain-dexpaprika 0.3.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_dexpaprika-0.3.0.tar.gz

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 28, 2026.

Transparency log

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.

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