# Get CoinGecko Events

Returns swap events and pool reserves in the CoinGecko event format for a block range.

_Source: https://beta.taostats.io/docs/api-reference/coingecko/get-coingecko-events_

_Last reviewed: 2026-09-18_

```http
GET https://api.taostats.io/api/coingecko/events
```

Requires an API key in the `Authorization` header.

Returns swap events and pool reserves in the CoinGecko event format for a block range. Records identify the trading pair, maker, transaction and amounts exchanged.

## Try it

Try this request in the browser on the HTML version of this page, or use the code samples below.

### Code samples

**cURL**

```bash
curl -H "Authorization: <YOUR_API_KEY>" \
  "https://api.taostats.io/api/coingecko/events"
```

**JavaScript**

```js
const response = await fetch('https://api.taostats.io/api/coingecko/events', {
  headers: {
    Authorization: '<YOUR_API_KEY>',
  },
});
const data = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    "https://api.taostats.io/api/coingecko/events",
    headers={"Authorization": "<YOUR_API_KEY>"},
)
data = response.json()
```

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `fromBlock` | query | `integer (int32)` | Yes | start block |
| `toBlock` | query | `integer (int32)` | Yes | end block |

## Responses

### `200` — Events retrieved successfully

| Field | Type | Required |
| --- | --- | --- |
| `events` | `array` | Yes |
| `events[].asset0In` | `string, nullable` |  |
| `events[].asset0Out` | `string, nullable` |  |
| `events[].asset1In` | `string, nullable` |  |
| `events[].asset1Out` | `string, nullable` |  |
| `events[].block` | `object` | Yes |
| `events[].block.blockNumber` | `integer (int32)` | Yes |
| `events[].block.blockTimestamp` | `integer (int64)` | Yes |
| `events[].eventIndex` | `integer (int32)` | Yes |
| `events[].eventType` | `string` | Yes |
| `events[].maker` | `string` | Yes |
| `events[].pairId` | `string` | Yes |
| `events[].priceNative` | `string` | Yes |
| `events[].reserves` | `object` | Yes |
| `events[].reserves.asset0` | `string` | Yes |
| `events[].reserves.asset1` | `string` | Yes |
| `events[].txnId` | `string` | Yes |
| `events[].txnIndex` | `integer (int32)` | Yes |

**Example response**

```json
{}
```

### Other responses

| Status | Meaning |
| --- | --- |
| `400` | Bad request |
| `404` | Events not found |
| `500` | Internal server error |

Every request needs an `Authorization` header holding your API key — see [Getting started with the Taostats API](https://beta.taostats.io/docs/start-here/getting-started-with-taostats-api).
