> For the complete documentation index, see [llms.txt](https://docs.wasabi.xyz/public-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wasabi.xyz/public-api/api-reference/nft-transactions/get-collection-stats.md).

# Get Collection Stats

Fetch the overall sale summary of the whole collection or a specific asset.

## Get Sale Summary

<mark style="color:blue;">`GET`</mark> `https://api.dkoda.xyz/v1/collection/stats`

Fetches the sales summary for the given contract address.

#### Query Parameters

| Name                                              | Type    | Description                                                                                                                                                        |
| ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| contractAddress<mark style="color:red;">\*</mark> | String  | <p>The contract address of the collection.</p><p>e.g. "0x23581767a106ae21c074b2276d25e5c3e136a68b"</p>                                                             |
| assetId                                           | String  | <p>An optional id of a specific asset to filter sales by. If not provided, the sales for all assets in the collection will be fetched.</p><p>e.g. "1749"</p>       |
| since                                             | Integer | An optional epoch timestamp to filter sales by. When provided, will fetch the sales summary **since** this timestamp. Can be used together with the `until` query. |
| until                                             | Integer | An optional epoch timestamp to filter sales by. When provided, will fetch the sales summary **until** this timestamp. Can be used together with the `since` query. |

#### Headers

| Name                                        | Type   | Description                              |
| ------------------------------------------- | ------ | ---------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | The API key to use when making requests. |

{% tabs %}
{% tab title="200: OK Success (No asset filter)" %}

```javascript
{
  "successful": 1,
  "data": {
    "contractAddress": "0x23581767a106ae21c074b2276d25e5c3e136a68b",
    "totalNumSales": 10199,
    "totalVolume": "195465029570725460000000",
    "currency": "ETH",
    "groups": [
      {
        "marketplace": "OPENSEA",
        "totalNumSales": 7654,
        "totalVolume": "139530618469638870000000",
        "currency": "ETH"
      },
      {
        "marketplace": "X2Y2",
        "totalNumSales": 311,
        "totalVolume": "7423054099999998000000",
        "currency": "ETH"
      },
      {
        "marketplace": "LOOKSRARE",
        "totalNumSales": 505,
        "totalVolume": "13794967419516608000000",
        "currency": "ETH"
      },
      {
        "marketplace": "GEM",
        "totalNumSales": 993,
        "totalVolume": "18280637039799890000000",
        "currency": "ETH"
      },
      {
        "marketplace": "OTHER",
        "totalNumSales": 736,
        "totalVolume": "16435752541771270000000",
        "currency": "ETH"
      }
    ]
  }
}

```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```javascript
{
  "successful": 0,
  "errorMessage": "Invalid contract address. Please ensure the contract address is a valid Ethereum address."
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
  "successful": 0,
  "errorMessage": "No API key is specified, please contact us at developer@dkoda.xyz to request an API key."
}
```

{% endtab %}

{% tab title="200: OK Success (With asset filter)" %}

```javascript
{
  "successful": 1,
  "data": {
    "contractAddress": "0x23581767a106ae21c074b2276d25e5c3e136a68b",
    "assetId": "5913",
    "totalNumSales": 10,
    "totalVolume": "164989000000000010000",
    "currency": "ETH",
    "groups": [
      {
        "marketplace": "OPENSEA",
        "totalNumSales": 1,
        "totalVolume": "8000000000000000000",
        "currency": "ETH"
      },
      {
        "marketplace": "X2Y2",
        "totalNumSales": 6,
        "totalVolume": "107190000000000010000",
        "currency": "ETH"
      },
      {
        "marketplace": "GEM",
        "totalNumSales": 3,
        "totalVolume": "49799000000000000000",
        "currency": "ETH"
      }
    ]
  }
}

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** These endpoints require an API key to be present in the request header. Please contact us to request one.
{% endhint %}
