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

# paginator

> X API SDK の paginator Python パッケージのリファレンス。 X API v2 の paginator エンドポイント向けのクライアントと Pydantic モデルをまとめています。

Cursor-based pagination utilities for the X API SDK.

This module provides a Cursor class for elegant pagination support across
all API clients. The Cursor enables easy iteration over paginated results
using both .pages() and .items() methods with proper type safety.

### `class xdk.paginator.Cursor`

\[`ResponseType`]

#### パラメーター

<ParamField path="path.method" type="PaginatableMethod" />

### `__init__`

Initialize the cursor.

#### パラメーター

<ParamField path="path.method" type="PaginatableMethod">
  The API method to call for each page (must support pagination)
</ParamField>

### `items`

Iterate over individual items from paginated responses.

#### パラメーター

<ParamField path="path.limit" type="int or None" default="None">
  Maximum number of items to return (None for unlimited)
</ParamField>

#### 戻り値

`IteratorAny`

### `pages`

Iterate over pages of responses.

#### パラメーター

<ParamField path="path.limit" type="int or None" default="None">
  Maximum number of pages to return (None for unlimited)
</ParamField>

#### 戻り値

`IteratorResponseType`

### `class xdk.paginator.PaginatableMethod`

\[`ResponseType`]

### `__init__`

### `xdk.paginator.cursor`

Create a cursor with proper type inference and validation.
This factory function helps with type inference so you get proper
type hints for the response type, and validates that the method
supports pagination at both static analysis and runtime.

#### パラメーター

<ParamField path="path.method" type="PaginatableMethod">
  The API method to wrap (must support pagination)
</ParamField>
