---
title: List Accounts
description: Query multiple accounts with filtering and pagination
url: https://docs.intuition.systems/docs/v1/graphql-api/queries/accounts/list-accounts
markdown_url: https://docs.intuition.systems/docs/v1/graphql-api/queries/accounts/list-accounts.md
version: V1
llms_index: https://docs.intuition.systems/docs/v1/llms.txt
---

Query multiple accounts with filtering, sorting, and pagination.

## List Accounts - Query Structure

```graphql
query GetAccounts(
  $where: accounts_bool_exp
  $order_by: [accounts_order_by!]
  $limit: Int
  $offset: Int
) {
  accounts(
    where: $where
    order_by: $order_by
    limit: $limit
    offset: $offset
  ) {
    id
    label
    image
    type
  }
  accounts_aggregate(where: $where) {
    aggregate {
      count
    }
  }
}
```

## Variables

```json
{
  "where": {
    "type": { "_eq": "AtomWallet" }
  },
  "order_by": [{ "label": "asc" }],
  "limit": 20,
  "offset": 0
}
```

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | `String` | Account address |
| `label` | `String` | Human-readable name |
| `image` | `String` | Profile image URL |
| `type` | `String` | Account type |

## Interactive Example

    id: 'recent-accounts',
    title: 'Recent Accounts',
    query: `query GetRecentAccounts($limit: Int!) {
  accounts(
    limit: $limit
  ) {
    id
    label
    image
    type

}`,
    variables: { limit: 10 }
  },

    id: 'atom-wallets',
    title: 'Accounts with Linked Atoms',
    query: `query GetAtomWallets($limit: Int!) {
  accounts(
    where: { type: { _eq: "AtomWallet" } }
    limit: $limit
  ) {
    id
    label
    image
    atom {
      label
      type

}`,
    variables: { limit: 10 }
  },

    id: 'search-accounts',
    title: 'Search by Label',
    query: `query SearchAccounts($search: String!, $limit: Int!) {
  accounts(
    where: { label: { _ilike: $search } }
    limit: $limit
  ) {
    id
    label
    image
    type

}`,
    variables: {
      search: '%eth%',
      limit: 10

];

## Use Cases

### Search Accounts

Search accounts by label:

```typescript
async function searchAccounts(searchTerm: string, limit: number = 20) {
  const query = `
    query SearchAccounts($search: String!, $limit: Int!) {
      accounts(
        where: { label: { _ilike: $search } }
        order_by: { label: asc }
        limit: $limit
      ) {
        id
        label
        image
        type
      }
    }
  `

  const data = await client.request(query, {
    search: `%${searchTerm}%`,
    limit
  })

  return data.accounts
}
```

### Paginated Account List

```typescript
async function getAccountsPaginated(page: number, pageSize: number = 20) {
  const query = `
    query GetAccountsPaginated($limit: Int!, $offset: Int!) {
      accounts(
        limit: $limit
        offset: $offset
      ) {
        id
        label
        image
        type
      }
      accounts_aggregate {
        aggregate {
          count
        }
      }
    }
  `

  const data = await client.request(query, {
    limit: pageSize,
    offset: (page - 1) * pageSize
  })

  return {
    accounts: data.accounts,
    total: data.accounts_aggregate.aggregate.count,
    page,
    pageSize,
    totalPages: Math.ceil(data.accounts_aggregate.aggregate.count / pageSize)
  }
}
```

## Filtering Options

### By Type

```graphql
# Only AtomWallet accounts
accounts(where: { type: { _eq: "AtomWallet" } })

# Exclude protocol vaults
accounts(where: { type: { _neq: "ProtocolVault" } })
```

### By Label

```graphql
# Case-insensitive search
accounts(where: { label: { _ilike: "%vitalik%" } })

# Exact match
accounts(where: { label: { _eq: "vitalik.eth" } })
```

## Best Practices

1. **Use pagination** - Always limit results for large datasets
2. **Include aggregate** - Get total count for pagination UI
3. **Use indexes** - Filter by indexed fields (type, label)
4. **Case-insensitive search** - Use `_ilike` for label searches

## Related

- [Single Account](https://docs.intuition.systems/docs/v1/graphql-api/queries/accounts/single-account) - Query individual accounts
- [Following](https://docs.intuition.systems/docs/v1/graphql-api/queries/accounts/following) - Social relationships
- [Aggregations](https://docs.intuition.systems/docs/v1/graphql-api/queries/advanced/aggregations) - Aggregate patterns
