{
  "openapi": "3.1.0",
  "info": {
    "title": "DexPaprika MCP Server API",
    "description": "REST subset of the DexPaprika MCP server, for platforms like ChatGPT Actions. Exposes 12 of the 17 MCP tools as REST operations. The pool and token filter tools reuse the pools/search and tokens/search operations; getCapabilities and submitFeedback are MCP-protocol-only. Keyless, no API key. The full tool set and agent onboarding are available via the MCP transports at /sse, /streamable-http, and /json-rpc. These REST operations do NOT require the MCP 'rationale' field (that is an MCP-transport-only convention).",
    "version": "2.3.2",
    "contact": {
      "name": "DexPaprika Support",
      "url": "https://dexpaprika.com"
    }
  },
  "servers": [
    {
      "url": "https://mcp.dexpaprika.com",
      "description": "DexPaprika MCP Server"
    }
  ],
  "paths": {
    "/api/networks": {
      "get": {
        "summary": "Get Networks",
        "description": "REQUIRED FIRST STEP: Get all supported blockchain networks. Always call this first to see available networks before using any network-specific functions.",
        "operationId": "getNetworks",
        "responses": {
          "200": {
            "description": "List of supported blockchain networks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Network identifier"
                      },
                      "display_name": {
                        "type": "string",
                        "description": "Human-readable network name"
                      }
                    },
                    "required": [
                      "id",
                      "display_name"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/pools/search": {
      "get": {
        "summary": "Search / filter network pools",
        "description": "PRIMARY POOL FUNCTION: top liquidity pools on a network, with optional volume / liquidity / transaction / age filters and an optional token_address filter. Replaces the removed /pools and /pools/filter endpoints, and (via token_address) the removed /tokens/{token_address}/pools endpoint. Rows are returned under `results`, paginated by cursor (has_next_page + next_cursor).",
        "operationId": "getNetworkPools",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID from getNetworks (e.g., 'ethereum', 'solana')",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "description": "Restrict results to pools containing this token contract address. Network-scoped only: no cross-network equivalent exists. An unknown address returns 200 with an empty results array, not an error.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items per page (default: 10, max: 100)",
            "schema": {
              "type": "integer",
              "default": 10,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor. Pass next_cursor from a previous response to fetch the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort direction (default: 'desc')",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Field to order by (default: 'volume_usd_24h')",
            "schema": {
              "type": "string",
              "enum": [
                "volume_usd_24h",
                "volume_usd_7d",
                "volume_usd_30d",
                "liquidity_usd",
                "txns_24h",
                "created_at",
                "price_usd",
                "price_change_percentage_24h"
              ],
              "default": "volume_usd_24h"
            }
          },
          {
            "name": "volume_usd_24h_min",
            "in": "query",
            "required": false,
            "description": "Minimum 24h volume in USD",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "volume_usd_24h_max",
            "in": "query",
            "required": false,
            "description": "Maximum 24h volume in USD",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "liquidity_usd_min",
            "in": "query",
            "required": false,
            "description": "Minimum pool liquidity in USD",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "liquidity_usd_max",
            "in": "query",
            "required": false,
            "description": "Maximum pool liquidity in USD",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "txns_24h_min",
            "in": "query",
            "required": false,
            "description": "Minimum transactions in 24h",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only pools created after this UNIX timestamp",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only pools created before this UNIX timestamp",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching liquidity pools",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Pool address"
                          },
                          "dex_name": {
                            "type": "string"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "volume_usd_24h": {
                            "type": "number"
                          },
                          "liquidity_usd": {
                            "type": "number"
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "transactions_24h": {
                            "type": "integer"
                          },
                          "price_change_percentage_24h": {
                            "type": "number"
                          },
                          "tokens": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "symbol": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "has_next_page": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/dexes": {
      "get": {
        "summary": "Get Network DEXes",
        "description": "Get available DEXes on a specific network. First call getNetworks to see valid network IDs.",
        "operationId": "getNetworkDexes",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID from getNetworks (e.g., 'ethereum', 'solana')",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items per page",
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of DEXes on the network",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dexes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dex_id": {
                            "type": "string"
                          },
                          "dex_name": {
                            "type": "string"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "protocol": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/dexes/{dex}/pools": {
      "get": {
        "summary": "Get DEX Pools",
        "description": "Get pools from a specific DEX on a network. First use getNetworks, then getNetworkDexes to find valid DEX IDs. The upstream /networks/{network}/dexes/{dex}/pools endpoint was removed on 2026-08-05; this path is preserved and proxies /networks/{network}/pools/search with the DEX moved into the dex_name filter. Rows return under `results` with cursor pagination, and the 24h volume field is volume_usd_24h. There is no page_info and no bare volume_usd.",
        "operationId": "getDexPools",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID from getNetworks",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dex",
            "in": "path",
            "required": true,
            "description": "The dex_id field from getNetworkDexes (e.g., 'uniswap_v3'), matched case-insensitively. Forwarded upstream as the dex_name query parameter. Do not pass that response's dex_name field, the human display name (e.g., 'Uniswap V3'): it returns an empty results[] instead of an error, so a wrong value looks like a real but empty answer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor. Pass next_cursor from a previous response to fetch the next page. Replaces the page number the removed endpoint used.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Sort field. Canonical: volume_usd_24h, volume_usd_7d, volume_usd_30d, liquidity_usd, txns_24h, created_at, price_usd, price_change_percentage_24h. Legacy short names such as volume_usd are accepted and normalized.",
            "schema": {
              "type": "string",
              "default": "volume_usd_24h"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pools belonging to the DEX, under results, with cursor pagination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "has_next_page": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "query": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/pools/{pool_address}": {
      "get": {
        "summary": "Get Pool Details",
        "description": "Get detailed information about a specific pool. Returns comprehensive pool data including tokens, prices, volume, and transaction metrics.",
        "operationId": "getPoolDetails",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID from getNetworks",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool_address",
            "in": "path",
            "required": true,
            "description": "Pool address or identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inversed",
            "in": "query",
            "required": false,
            "description": "Whether to invert the price ratio",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed pool information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "dex_name": {
                      "type": "string"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "last_price_usd": {
                      "type": "number"
                    },
                    "volume_usd": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/pools/{pool_address}/ohlcv": {
      "get": {
        "summary": "Get Pool OHLCV",
        "description": "Get historical price data (OHLCV) for a pool - essential for price analysis, backtesting, and visualization.",
        "operationId": "getPoolOHLCV",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool_address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "Start time for historical data (Unix timestamp, RFC3339 timestamp, or yyyy-mm-dd format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "description": "End time for historical data",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of data points to retrieve",
            "schema": {
              "type": "integer",
              "default": 1,
              "maximum": 366
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "description": "Interval granularity",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "5m",
                "10m",
                "15m",
                "30m",
                "1h",
                "6h",
                "12h",
                "24h"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical OHLCV data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "string"
                      },
                      "open": {
                        "type": "number"
                      },
                      "high": {
                        "type": "number"
                      },
                      "low": {
                        "type": "number"
                      },
                      "close": {
                        "type": "number"
                      },
                      "volume": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/pools/{pool_address}/transactions": {
      "get": {
        "summary": "Get Pool Transactions",
        "description": "Get recent transactions for a specific pool. Shows swaps, adds, removes with detailed transaction data. Supports time-range filtering via from/to UNIX timestamps (results capped to last 7 days).",
        "operationId": "getPoolTransactions",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pool_address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Filter transactions starting from this UNIX timestamp (inclusive)"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Filter transactions up to this UNIX timestamp (exclusive)"
          }
        ],
        "responses": {
          "200": {
            "description": "List of pool transactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "transaction_hash": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "amount_usd": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/tokens/{token_address}": {
      "get": {
        "summary": "Get Token Details",
        "description": "Get detailed information about a specific token on a network. Returns token metadata, current price, FDV, liquidity, and trading metrics.",
        "operationId": "getTokenDetails",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token_address",
            "in": "path",
            "required": true,
            "description": "Token contract address",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed token information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "last_price_usd": {
                      "type": "number"
                    },
                    "market_cap_usd": {
                      "type": "number"
                    },
                    "volume_usd": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/tokens/search": {
      "get": {
        "summary": "Search / filter / rank network tokens",
        "description": "Top tokens on a network ranked by volume, liquidity, transactions, FDV, or 24h price change, with optional filters and an optional free-text query. Replaces the removed /tokens/top and /tokens/filter endpoints. Rows are returned under `results`, paginated by cursor. Ordering by price is not supported and falls back to volume.",
        "operationId": "getTopTokens",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID (e.g., 'ethereum', 'solana')",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page (default: 50, max: 100)",
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor. Pass next_cursor from a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Field to order by (default: 'volume_usd_24h')",
            "schema": {
              "type": "string",
              "enum": [
                "volume_usd_24h",
                "volume_usd_7d",
                "volume_usd_30d",
                "liquidity_usd",
                "txns_24h",
                "fdv_usd",
                "created_at",
                "price_change_percentage_24h"
              ],
              "default": "volume_usd_24h"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort direction (default: 'desc')",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Optional free-text token name / symbol / address filter",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "volume_usd_24h_min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "volume_usd_24h_max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "liquidity_usd_min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "liquidity_usd_max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "fdv_min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "fdv_max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "txns_24h_min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "UNIX timestamp",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "UNIX timestamp",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "volume_usd_24h": {
                            "type": "number"
                          },
                          "liquidity_usd": {
                            "type": "number"
                          },
                          "fdv_usd": {
                            "type": "number"
                          },
                          "txns_24h": {
                            "type": "integer"
                          },
                          "price_change_percentage_24h": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "has_next_page": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/networks/{network}/multi/prices": {
      "get": {
        "summary": "Get multiple token prices",
        "description": "Get current prices for multiple tokens on a network in a single batched request.",
        "operationId": "getTokenMultiPrices",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "description": "Network ID (e.g., 'ethereum', 'solana')",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tokens",
            "in": "query",
            "required": true,
            "description": "Comma-separated token contract addresses",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "summary": "Search",
        "description": "Search across ALL networks for tokens, pools, and DEXes by name, symbol, or address. Good starting point when you don't know the specific network.",
        "operationId": "search",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Search term (e.g., 'uniswap', 'bitcoin', 'ethereum', or a token address)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "chain": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "pools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "dexes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/stats": {
      "get": {
        "summary": "Get Stats",
        "description": "Get high-level statistics about the DexPaprika ecosystem: total networks, DEXes, pools, and tokens available.",
        "operationId": "getStats",
        "responses": {
          "200": {
            "description": "Platform statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "networks": {
                      "type": "number"
                    },
                    "dexes": {
                      "type": "number"
                    },
                    "pools": {
                      "type": "number"
                    },
                    "tokens": {
                      "type": "number"
                    },
                    "total_volume_usd": {
                      "type": "number"
                    },
                    "total_liquidity_usd": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  }
}