---
updatedAt: 2025-05-22T20:27:15.000Z
agentTools:
  projectIndex: https://docs.klarda.com/llms.txt
---

# Get Token Onchain Swap Counts by Pair Address

The Get Token Onchain Swap Counts by Pair Address API allows you to easily fetch the token onchain swap counts

## Definition

This endpoint retrieves the count of onchain token swaps for a specified pair address on a particular blockchain network. It provides detailed metrics on the swap activity, helping users analyze the token pairs' trading behavior.

## Query Parameters

For guidance on how to leverage this method, check out the following tutorials:

1. **address** (string): The specific pair address (contract address) for which the swap counts are to be retrieved.
2. **chain\_id** (string): The unique identifier of the blockchain network (e.g., Ethereum, Binance Smart Chain) where the pair address is deployed.

## Response

The response will include a JSON object containing the swap counts for the specified pair address on the specified blockchain network. This data will provide insights into the number of swaps that have occurred, along with additional metadata related to the swap activities.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "klarda-token-market-api",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.klarda.com/api/v1/market"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/token/onchain/swap-counts": {
      "get": {
        "summary": "Get Token Onchain Swap Counts by Pair Address",
        "description": "The Get Token Onchain Swap Counts by Pair Address API allows you to easily fetch the token onchain swap counts",
        "operationId": "get-token-onchain-swap-counts",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chain_id",
            "in": "query",
            "description": "String - denotes the specific blockchain network from which the data has been crawled. Available values: mantle, fuse, optimism, avalanche, ethereumpow, base, oasisemerald, milkomedacardano, velas, kcc, cronos, pulechain, stepnetwork, dogechain, moonriver, moonbeam, arbitrum, fantom, bsc, iotex, harmony, ethereum, polygon. Default to \"all\"",
            "schema": {
              "type": "string",
              "default": "ethereum"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Succeed": {
                    "value": "{\n  \"success\": true,\n  \"data\": [\n    {\n      \"stored_time\": \"2023-09-29T00:00:00.000Z\",\n      \"symbol\": \"BTC\",\n      \"market_cap\": 526863333750.40405,\n      \"price\": 27020.529479757017,\n      \"volume\": 5023764922.994344\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stored_time": {
                            "type": "string",
                            "example": "2023-09-29T00:00:00.000Z"
                          },
                          "symbol": {
                            "type": "string",
                            "example": "BTC"
                          },
                          "market_cap": {
                            "type": "number",
                            "example": 526863333750.40405,
                            "default": 0
                          },
                          "price": {
                            "type": "number",
                            "example": 27020.529479757017,
                            "default": 0
                          },
                          "volume": {
                            "type": "number",
                            "example": 5023764922.994344,
                            "default": 0
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"statusCode\": 400,\n  \"message\": \"Wrong api_key, please check!\",\n  \"error\": \"Bad Request\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Wrong api_key, please check!"
                    },
                    "error": {
                      "type": "string",
                      "example": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"statusCode\": 401,\n  \"message\": \"Unauthorized\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"statusCode\": 500,\n  \"message\": \"Internal server error\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 500,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```