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_pool_indicator DexPaprikaPoolIndicator A technical indicator (rsi, ema, macd, bbands, or vwap) computed from one pool's OHLCV history. Works without an API key.
dexpaprika_token_ohlcv DexPaprikaTokenOHLCV Historical USD OHLCV candles for one token, volume-weighted across every pool it trades in on that network. Needs a Dev or Pro plan; see get OHLCV data for a token.
dexpaprika_token_indicator DexPaprikaTokenIndicator A technical indicator (rsi, ema, macd, bbands, or vwap) computed from one token's volume-weighted OHLCV history across every pool it trades in. Needs a Dev or Pro plan; see get a technical indicator for a token.
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 eight 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 with no plan limit on history. A request outside your plan fails with the API's message, which names the plan that allows it. Full table: OHLCV limits by plan.

Token OHLCV (Dev and Pro plans)

dexpaprika_token_ohlcv returns the same candle shape, but for a token instead of a single pool: open, high, low, close and volume, all in USD, computed from a volume-weighted price across every pool the token trades in on that network, with volume summed in USD across those same pools. Use it when you want one token's overall price history rather than the price in one specific pool.

from langchain_dexpaprika import DexPaprikaTokenOHLCV

token_ohlcv = DexPaprikaTokenOHLCV()
candles = token_ohlcv.invoke(
    {
        "network": "ethereum",
        "token_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "start": "-24h",
        "interval": "1h",
        "limit": 24,
    }
)

This endpoint needs a Dev or Pro plan. A keyless or free-key call fails with a 403 and a message naming the required plan; on that 403, call dexpaprika_token_pools to find the token's most liquid pool and fetch candles from dexpaprika_pool_ohlcv on that pool instead. Pool candles are priced in the pool's other token, not in USD, so pick a stablecoin pair where you can. See get OHLCV data for a token and the pricing page for which plan you need. Dev and Pro keys call https://api-pro.dexpaprika.com; see "Using an API key" below for how to point a wrapper at it.

Technical indicators

dexpaprika_pool_indicator and dexpaprika_token_indicator compute one technical indicator at a time over a pool's or a token's OHLCV history: rsi, ema, macd, bbands (Bollinger Bands), or vwap. The pool version works without an API key; the token version needs a Dev or Pro plan, the same as dexpaprika_token_ohlcv.

from langchain_dexpaprika import DexPaprikaPoolIndicator

indicator = DexPaprikaPoolIndicator()
rsi = indicator.invoke(
    {
        "network": "ethereum",
        "pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
        "indicator": "rsi",
        "interval": "1h",  # always pass interval explicitly
        "start": "-6h",
    }
)

rsi and ema and vwap responses carry one value per candle; macd carries macd, signal, and histogram; bbands carries upper, middle, and lower. Only send the parameter that matches your indicator (period for rsi, ema, bbands, and vwap; fast_period/slow_period/signal_period for macd; std_dev for bbands); sending one that belongs to a different indicator is rejected with a 400 naming it.

For a token instead of one pool, use dexpaprika_token_indicator, which needs a Dev or Pro plan and falls back the same way dexpaprika_token_ohlcv does: on a 403, call dexpaprika_token_pools to find the most liquid pool and use dexpaprika_pool_indicator on that pool instead. See technical indicators tutorial, get a technical indicator for a pool, and get a technical indicator for a token.

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.

The key is sent as the entire Authorization value, with nothing in front of it.

Dev and 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.5.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.5.0
File Size Uploaded Provenance
langchain_dexpaprika-0.5.0.tar.gz 165.1 kB With provenance Details

Built distribution (wheel)

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

Total release size: 193.7 kB

Release files / langchain_dexpaprika-0.5.0.tar.gz

Download URL langchain_dexpaprika-0.5.0.tar.gz
Size 165.1 kB
Tags Source
SHA-256 checksum
How to use checksums
139fa0e01fac6d5fee4a4df045617a236cf5cee2e2eb7791fd947f1100ac1d1a
BLAKE2b-256 checksum
How to use checksums
5b9a81269ab8ec7a4d862471abc0baaf5cd29cd5251122d2e6a2bb571803f8d5
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 Oct 14, 2026.

Transparency log

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

Download URL langchain_dexpaprika-0.5.0-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a02926ec1a67d36f90794a50765f535db119705b394e9701b8e81711b1766c8
BLAKE2b-256 checksum
How to use checksums
6d6932a5965504c9ca5930a0bdc59d041f45433b544893bbe568f95389b3cec9
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 Oct 14, 2026.

Transparency log

Security for langchain-dexpaprika 0.5.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.5.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 Oct 14, 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