> For the complete documentation index, see [llms.txt](https://noodles-finance.gitbook.io/docs.noodles.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://noodles-finance.gitbook.io/docs.noodles.fi/coin/coin-buy-sell.md).

# Coin Buy Sell

## Overview

The Coin Buy/Sell API provides buy and sell transaction statistics for a given coin over a specified time duration. This includes transaction counts, volume, and unique sender information for both buy and sell activities.

## Endpoint

```
GET /api/v1/partner/coin-buy-sell
```

## Parameters

| Parameter  | Type   | Required | Description                                                                                                                                     |
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `coin_id`  | String | Yes      | The coin identifier.                                                                                                                            |
| `duration` | String | Yes      | The time duration for the statistics. Choices are: "30m" (30 mins), "1H" (1 hour), "4H" (4 hours), "6H" (6 hours), "1d" (1 day), "1w" (1 week). |

## Headers

| Header      | Required | Description                 |
| ----------- | -------- | --------------------------- |
| `x-api-key` | No       | API key for authentication. |

## Request Example

```sh
curl --location 'https://api.noodles.fi/api/v1/partner/coin-buy-sell?coin_id=0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881%3A%3Acoin%3A%3ACOIN&duration=1d' \
--header 'Accept-Encoding: application/json' \
--header 'x-api-key: YOUR_API_KEY'
```

## Response Format

```json
{
    "code": 200,
    "message": "OK",
    "data": {
        "buy": {
            "tx": 7692,
            "vol": 2956125.57,
            "sender": 5204
        },
        "sell": {
            "tx": 7316,
            "vol": 2983649.37,
            "sender": 2717
        },
        "unique_sender": 6291,
        "unique_tx": 15000
    }
}
```

## Response Fields

| Field     | Type     | Description                         |
| --------- | -------- | ----------------------------------- |
| `code`    | `number` | HTTP status code (200 for success). |
| `message` | `string` | Status message.                     |
| `data`    | `object` | Buy/sell statistics object.         |

#### Buy/Sell Statistics Object

| Field           | Type     | Description                                                                   |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `buy`           | `object` | Buy transaction statistics.                                                   |
| `sell`          | `object` | Sell transaction statistics.                                                  |
| `unique_sender` | `number` | Total number of unique senders/wallets across both buy and sell transactions. |
| `unique_tx`     | `number` | Total number of unique transactions across both buy and sell activities.      |

#### Transaction Statistics Object (Buy/Sell)

| Field    | Type     | Description               |
| -------- | -------- | ------------------------- |
| `tx`     | `number` | Number of transactions.   |
| `vol`    | `number` | Total volume.             |
| `sender` | `number` | Number of unique senders. |

***

> **See also:** [Environment Setup](/docs.noodles.fi/environment-setup/environment.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://noodles-finance.gitbook.io/docs.noodles.fi/coin/coin-buy-sell.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
