> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# getTokenEvents

> Returns transactions for a pair (or a token's top pair). Codex-compatible event history with optional quoteToken, maker, timestamp, eventType / eventDisplayType, and price filters.

### Returns

<ResponseField name="getTokenEvents" type="EventConnection">
  Paginated list of events for the pair. See [EventConnection](/api-reference/graphql/types/EventConnection).
</ResponseField>

### Arguments

<ResponseField name="query" type="EventsQueryInput!" required>
  Filter and pair selection. See [EventsQueryInput](/api-reference/graphql/types/EventsQueryInput).
</ResponseField>

<ResponseField name="limit" type="Int">Max events per page. Clamped to `[1, 100]`. Default `50`.</ResponseField>
<ResponseField name="cursor" type="String">Pagination cursor from previous response. Source-tagged: a cursor minted by one query is rejected by another (silently treated as "no cursor").</ResponseField>
<ResponseField name="direction" type="RankingDirection">`DESC` (default — most recent first) or `ASC`. See [RankingDirection](/api-reference/graphql/types/RankingDirection).</ResponseField>

### Example

```graphql theme={null}
query GetTokenEvents {
  getTokenEvents(
    query: {
      address: "0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae"
      networkId: 56
      quoteToken: token0
      eventDisplayType: [Buy]
      priceUsdTotal: { gte: 100 }
    }
    limit: 20
    direction: DESC
  ) {
    cursor
    items {
      id
      eventType
      eventDisplayType
      timestamp
      transactionHash
      maker
      data {
        __typename
        ... on SwapEventData {
          priceUsd
          priceUsdTotal
          amountNonLiquidityToken
        }
      }
    }
  }
}
```

### Playground

<iframe src={`https://graphql.mobula.io/graphql?query=${encodeURIComponent('query GetTokenEvents($query: EventsQueryInput!, $limit: Int, $direction: RankingDirection) { getTokenEvents(query: $query, limit: $limit, direction: $direction) { cursor items { id eventType eventDisplayType timestamp transactionHash maker data { __typename ... on SwapEventData { priceUsd priceUsdTotal amountNonLiquidityToken } } } } }')}&variables=${encodeURIComponent('{"query": {"address": "0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae", "networkId": 56, "quoteToken": "token0"}, "limit": 20, "direction": "DESC"}')}`} title="GraphQL Playground" style={{ width: '100%', minHeight: '600px', border: '1px solid var(--color-border)', borderRadius: '8px' }} />
