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

# Get Account History

> Query historical data for tracked sources

Retrieve historical data that has been backfilled for tracked sources. Returns the full payload including the raw JSON data. Uses cursor-based pagination for efficient sequential consumption.

<Note>
  The history endpoint is rate-limited to **30 requests per 60 seconds**.
</Note>

## Path Parameters

<ParamField path="id" type="string" required>
  The internal ID of the tracked source (e.g., a cuid).
</ParamField>

## Query Parameters

<ParamField query="messageId" type="string">
  Filter by a specific message ID (e.g. a tweet ID)
</ParamField>

<ParamField query="startDate" type="string">
  ISO-8601 date string. Only return records created on or after this date.
  Example: `2026-01-01`
</ParamField>

<ParamField query="endDate" type="string">
  ISO-8601 date string. Only return records created on or before this date.
  Example: `2026-04-21`
</ParamField>

<ParamField query="order" type="string" default="desc">
  Sort order by creation date. Valid values: `asc`, `desc`
</ParamField>

<ParamField query="limit" type="number" default="50">
  Number of records to return per page (1–100)
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor — the `id` of the last record from the previous page. Pass
  the `nextCursor` value from the previous response to fetch the next page.
</ParamField>

<ParamField query="autoBackfill" type="boolean" default="false">
  If `true` and no data exists, automatically triggers a background backfill job
  for the specified account.
</ParamField>

## Response

<ResponseField name="data" type="array">
  Array of backfill data objects. Each object contains: - `id` — Unique record
  ID - `source` — Source type (`X`, `DISCORD`, `TELEGRAM`) - `messageId` —
  External message ID (e.g. tweet ID) - `sourceId` — External source ID (e.g. X
  user ID) - `content` — Extracted text content - `rawPayload` — Full raw JSON
  payload from the source - `createdAt` — Timestamp of the original message
</ResponseField>

<ResponseField name="nextCursor" type="string | null">
  Cursor for fetching the next page. `null` when there are no more results.
</ResponseField>

<ResponseField name="limit" type="number">
  The limit that was applied
</ResponseField>

<ResponseField name="backfillTriggered" type="boolean">
  `true` if an automatic background backfill was triggered because no data
  existed.
</ResponseField>

<RequestExample>
  ```bash Basic theme={null}
  curl -X GET "https://scrape.st/account/history/clxyz123abc" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash With date range theme={null}
  curl -X GET "https://scrape.st/account/history/clxyz123abc?startDate=2026-04-01&endDate=2026-04-21&limit=25" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash Cursor pagination theme={null}
  curl -X GET "https://scrape.st/account/history/clxyz123abc?cursor=cm9fYWJjMTIz" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash Specific message theme={null}
  curl -X GET "https://scrape.st/account/history/clxyz123abc?messageId=1886493083207827456" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": [
      {
        "id": "cm9abc123def456",
        "source": "X",
        "messageId": "1886493083207827456",
        "sourceId": "12",
        "content": "Bitcoin hits new all-time high! 🚀",
        "rawPayload": {
          "id": "1886493083207827456",
          "text": "Bitcoin hits new all-time high! 🚀",
          "created_at": "2026-04-20T15:30:00.000Z",
          "favorite_count": 15000,
          "retweet_count": 3000,
          "reply_count": 800,
          "author": {
            "id": "12",
            "name": "Jack",
            "screen_name": "jack"
          }
        },
        "createdAt": "2026-04-20T15:30:00.000Z"
      }
    ],
    "nextCursor": "cm9xyz789ghi012",
    "limit": 50,
    "backfillTriggered": false
  }
  ```
</ResponseExample>
