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

# Token Transfers

> Query token transfer events (native ETH, ERC-20, ERC-721, ERC-1155) from transactions, internal transactions, and transfer logs.

## Overview

* **Dataset ID:** [`0304 - Token Transfers`](/data-catalog/evm/transfers/token-transfers)
* **Description:** Token transfer events (native ETH, ERC-20, ERC-721, ERC-1155) produced by TokenTransfersEngine from transactions, internal transactions, and transfer logs.
* **CSV Sample:** [Download](https://huggingface.co/datasets/BlockDB/Token-Transfers-Ethereum-And-EVM-Cryptocurrency-Data/resolve/main/data/blockdb_evm.b0304_token_transfers_v1.csv?download=true)
* **JSON Sample:** [Download](https://huggingface.co/datasets/BlockDB/Token-Transfers-Ethereum-And-EVM-Cryptocurrency-Data/resolve/main/data/blockdb_evm.b0304_token_transfers_v1.json?download=true)

## Parameters

<ParamField body="chain_id" type="number" required>
  Target EVM network. *See the [Chain](/api-reference/enumerations/chain) enumeration for supported values.*
</ParamField>

#### Range Filters (mutually exclusive)

<ParamField body="from_block" type="number">
  Starting block number (inclusive) for the query. Use with `to_block`.
</ParamField>

<ParamField body="to_block" type="number">
  Ending block number (inclusive) for the query. Use with `from_block`.
</ParamField>

<ParamField body="from_timestamp" type="string">
  Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used. Use with `to_timestamp`.
</ParamField>

<ParamField body="to_timestamp" type="string">
  Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used. Use with `from_timestamp`.
</ParamField>

<Warning>
  Validation rule:\
  You must provide **either** a block range or a time range.\
  Providing both results in HTTP 400.\
  Providing none results in HTTP 400.
</Warning>

#### Optional Filters

<ParamField body="from_address" type="string">
  Filter by sender address (hex string, 20 bytes, no `0x` prefix).
</ParamField>

<ParamField body="to_address" type="string">
  Filter by recipient address (hex string, 20 bytes, no `0x` prefix).
</ParamField>

<ParamField body="token_address" type="string">
  Filter by token contract address (hex string, 20 bytes, no `0x` prefix). Use `null` for native network token (e.g. ETH on Ethereum).
</ParamField>

<ParamField body="transfer_type" type="integer[]">
  Filter by transfer type integer code: `0`=native\_tx, `1`=native\_internal, `2`=erc20, `3`=erc721, `4`=erc1155. Omit to return all types. *See the [TransferType](/api-reference/enumerations/transfer-type) enumeration.*
</ParamField>

#### Pagination Controls

<ParamField body="limit" type="number" default="250">
  Recommended default `250`; maximum `1000` to stay under \~10 MB responses.
</ParamField>

<ParamField body="cursor" type="string">
  Pagination cursor from a prior call.
</ParamField>

## Response Fields

#### Meta

<ResponseField name="meta" type="object">
  Echo of request metadata applied to the response.
</ResponseField>

<ResponseField name="meta.chain_id" type="number">
  EVM chain ID echoed from the request.
</ResponseField>

<ResponseField name="meta.request_window" type="object">
  Pure echo of the window you sent (`from_block`/`to_block`/`from_timestamp`/`to_timestamp`); unset bounds are `null`.
</ResponseField>

<ResponseField name="meta.resolved_window" type="object | null">
  The concrete window the query actually executed against, after resolving the request. For a **block range** on a time-bucketed endpoint (OHLC/VWAP/VWAP-aggregate/fiat VWAP), `from_timestamp`/`to_timestamp` hold the resolved timestamp window (and `from_block`/`to_block` echo your request). For a **time range** on a block-keyed endpoint, `from_block`/`to_block` hold the resolved block range (and the timestamps echo your request). `null` for selector-only requests (no window). No extra database work is done — these are the values the query already computed.
</ResponseField>

<ResponseField name="meta.resolved_window.from_block" type="number | null">
  Resolved/echoed start block of the executed window.
</ResponseField>

<ResponseField name="meta.resolved_window.to_block" type="number | null">
  Resolved/echoed end block of the executed window.
</ResponseField>

<ResponseField name="meta.resolved_window.from_timestamp" type="string | null">
  Resolved/echoed start timestamp (ISO-8601) of the executed window.
</ResponseField>

<ResponseField name="meta.resolved_window.to_timestamp" type="string | null">
  Resolved/echoed end timestamp (ISO-8601) of the executed window.
</ResponseField>

<ResponseField name="meta.filters" type="object">
  Filter parameters echoed from the request (addresses, transfer\_type, pagination state, etc.).
</ResponseField>

#### Data

<ResponseField name="data" type="object[]">
  Each element mirrors the table columns (chain implied by `meta.chain_id`). Primary key in SQL is `_tracing_id`.
</ResponseField>

<ResponseField name="data.block_number" type="number">
  Block where the transfer occurred.
</ResponseField>

<ResponseField name="data.block_time" type="string">
  UTC timestamp of the block (ISO-8601).
</ResponseField>

<ResponseField name="data.tx_index" type="number">
  Transaction index within the block.
</ResponseField>

<ResponseField name="data.log_index" type="number | null">
  Log index within the transaction receipt; null for native or internal tx transfers.
</ResponseField>

<ResponseField name="data.trace_address" type="string | null">
  Trace address for internal tx transfers (e.g. `"0"`, `"0.1"`); null for log-based transfers.
</ResponseField>

<ResponseField name="data.from_address" type="string">
  Sender address (hex string, 20 bytes, no `0x` prefix).
</ResponseField>

<ResponseField name="data.to_address" type="string">
  Recipient address (hex string, 20 bytes, no `0x` prefix).
</ResponseField>

<ResponseField name="data.token_address" type="string | null">
  Token contract address (hex string, 20 bytes); null for native ETH.
</ResponseField>

<ResponseField name="data.amount_raw" type="string">
  Raw amount in smallest unit (wei for native, raw uint256 for ERC-20/1155). String to preserve precision.
</ResponseField>

<ResponseField name="data.amount_adj" type="string | null">
  Decimal-adjusted amount; null if decimals unknown or NFT (ERC-721).
</ResponseField>

<ResponseField name="data.token_id" type="string | null">
  Token ID for ERC-721 and ERC-1155; null for native/ERC-20. String to preserve precision.
</ResponseField>

<ResponseField name="data.transfer_type" type="integer">
  Transfer type as integer enum: `0`=native\_tx, `1`=native\_internal, `2`=erc20, `3`=erc721, `4`=erc1155. *See the [TransferType](/api-reference/enumerations/transfer-type) enumeration.*
</ResponseField>

<ResponseField name="data._tracing_id" type="string">
  BlockDB lineage identifier (hex string, no `0x` prefix).
</ResponseField>

<ResponseField name="data._parent_tracing_ids" type="string[]">
  BlockDB lineage identifiers of the parent records.
</ResponseField>

<ResponseField name="data._created_at" type="string">
  Record creation timestamp, e.g. `"2025-11-11T18:42:15.123Z"`.
</ResponseField>

<ResponseField name="data._updated_at" type="string">
  Last update timestamp in the same format.
</ResponseField>

#### Envelope Fields

<ResponseField name="cursor" type="string | null">
  Cursor token for pagination.
</ResponseField>

<ResponseField name="page_count" type="number">
  Number of records returned in `data`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.blockdb.io/v1/evm/transfers/token-transfers" \
    -H "Authorization: Bearer $BLOCKDB_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "chain_id": 1,
    "from_block": 12345678,
    "to_block": 12345999,
    "from_address": "0000000000000000000000000000000000000000",
    "to_address": "0000000000000000000000000000000000000001",
    "token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "transfer_type": [2, 3],
    "limit": 250,
    "cursor": null
  }'
  ```

  ```c C theme={null}
  #include <curl/curl.h>
  #include <stdio.h>
  #include <stdlib.h>

  int main(void) {
      CURL *curl = curl_easy_init();
      if (!curl) return 1;

      const char *token = getenv("BLOCKDB_API_KEY");
      char auth_header[256];
      snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", token ? token : "");
      const char *payload = "{\"chain_id\":1,\"from_block\":12345678,\"to_block\":12345999,\"limit\":250,\"cursor\":null}";

      struct curl_slist *headers = NULL;
      headers = curl_slist_append(headers, auth_header);
      headers = curl_slist_append(headers, "Content-Type: application/json");

      curl_easy_setopt(curl, CURLOPT_URL, "https://api.blockdb.io/v1/evm/transfers/token-transfers");
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);

      CURLcode res = curl_easy_perform(curl);

      curl_slist_free_all(headers);
      curl_easy_cleanup(curl);
      return res == CURLE_OK ? 0 : 1;
  }
  ```

  ```csharp .NET theme={null}
  using System;
  using System.Net.Http;
  using System.Net.Http.Headers;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main()
      {
          using var client = new HttpClient();
          client.DefaultRequestHeaders.Authorization =
              new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLOCKDB_API_KEY"));

          var payload = new StringContent(
              "{\"chain_id\":1,\"from_block\":12345678,\"to_block\":12345999,\"limit\":250,\"cursor\":null}",
              Encoding.UTF8,
              "application/json"
          );

          var response = await client.PostAsync("https://api.blockdb.io/v1/evm/transfers/token-transfers", payload);
          response.EnsureSuccessStatusCode();

          var body = await response.Content.ReadAsStringAsync();
          Console.WriteLine(body);
      }
  }
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      "https://api.blockdb.io/v1/evm/transfers/token-transfers",
      headers={
          "Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
          "Content-Type": "application/json"
      },
      json={
          "chain_id": 1,
          "from_block": 12345678,
          "to_block": 12345999,
          "from_timestamp": "2025-10-29T00:00:00Z",
          "to_timestamp": "2025-11-11T00:00:00Z",
          "transfer_type": [2, 3],
          "limit": 250,
          "cursor": None
      }
  )

  data = response.json()
  print(data)
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.blockdb.io/v1/evm/transfers/token-transfers", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      chain_id: 1,
      from_block: 12345678,
      to_block: 12345999,
      from_timestamp: "2025-10-29T00:00:00Z",
      to_timestamp: "2025-11-11T00:00:00Z",
      transfer_type: ["erc20", "erc721"],
      limit: 250,
      cursor: null
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "net/http"
      "os"
      "strings"
  )

  func main() {
      payload := strings.NewReader(`{
    "chain_id": 1,
    "from_block": 12345678,
    "to_block": 12345999,
    "limit": 250,
    "cursor": null
  }`)

      req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/transfers/token-transfers", payload)
      req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", os.Getenv("BLOCKDB_API_KEY")))
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()

      // Handle response
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "meta": {
      "chain_id": 1,
      "request_window": {
        "from_block": 12345678,
        "to_block": 12345999,
        "from_timestamp": "2025-10-29T00:00:00Z",
        "to_timestamp": "2025-11-11T00:00:00Z"
      },
      "resolved_window": {
        "from_block": 12345678,
        "to_block": 12345999,
        "from_timestamp": "2025-10-29T00:00:00Z",
        "to_timestamp": "2025-11-11T00:00:00Z"
      },
      "filters": {
        "transfer_type": [
          2,
          3
        ],
        "limit": 250,
        "cursor": null
      }
    },
    "data": [
      {
        "block_number": 12345680,
        "block_time": "2025-10-29T00:01:23Z",
        "tx_index": 5,
        "log_index": 2,
        "trace_address": null,
        "from_address": "0000000000000000000000000000000000000000",
        "to_address": "0000000000000000000000000000000000000001",
        "token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "amount_raw": "1000000000000000000",
        "amount_adj": "1.0",
        "token_id": null,
        "transfer_type": 2,
        "_tracing_id": "0304000000000000000000000000000000000001",
        "_parent_tracing_ids": [
          "0102000000000000000000000000000000000001",
          "0201000000000000000000000000000000000001"
        ],
        "_created_at": "2025-11-11T18:42:15.123Z",
        "_updated_at": "2025-11-11T18:42:15.123Z"
      },
      {
        "block_number": 12345681,
        "block_time": "2025-10-29T00:02:00Z",
        "tx_index": 12,
        "log_index": 0,
        "trace_address": null,
        "from_address": "bc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
        "to_address": "0000000000000000000000000000000000000002",
        "token_address": "bc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
        "amount_raw": "1",
        "amount_adj": null,
        "token_id": "1234",
        "transfer_type": 3,
        "_tracing_id": "0304000000000000000000000000000000000002",
        "_parent_tracing_ids": [
          "0102000000000000000000000000000000000001",
          "0201000000000000000000000000000000000001"
        ],
        "_created_at": "2025-11-11T18:42:15.123Z",
        "_updated_at": "2025-11-11T18:42:15.123Z"
      }
    ],
    "cursor": "next_page_cursor",
    "page_count": 2
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "BAD_REQUEST",
      "http_status": 400,
      "message": "The request contains invalid or missing parameters.",
      "hint": "Validate all required parameters against the endpoint specification before retrying.",
      "severity": "error",
      "retryable": false,
      "details": {
        "invalid_parameters": [
          {
            "name": "chain_id",
            "location": "body",
            "reason": "missing",
            "expected": "positive integer, e.g. 1"
          },
          {
            "name": "from_block",
            "location": "body",
            "reason": "required_with",
            "expected": "provide either block range (from_block + to_block) or time range (from_timestamp + to_timestamp)"
          }
        ]
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/home"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "http_status": 401,
      "message": "Invalid or missing API key.",
      "hint": "Ensure you send 'Authorization: Bearer <API_KEY>' in every request to this endpoint.",
      "severity": "error",
      "retryable": false,
      "details": {
        "auth_scheme": "bearer",
        "expected_header": "Authorization: Bearer <API_KEY>",
        "provided_header": "Authorization: <REDACTED_OR_MISSING>",
        "token_status": "invalid_or_missing",
        "recommendation": "Regenerate the API key if you suspect it is expired or compromised."
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/authorization"
    }
  }
  ```

  ```json 403 theme={null}
  {
    "error": {
      "code": "FORBIDDEN",
      "http_status": 403,
      "message": "Your API key does not have permission to access this endpoint.",
      "hint": "Upgrade your subscription tier or request additional access.",
      "severity": "warning",
      "retryable": false,
      "details": {
        "required_plan": "production",
        "your_plan": null,
        "contact": "support@blockdb.io",
        "recommendation": "Contact BlockDB Support Team via email support@blockdb.io."
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "NOT_FOUND",
      "http_status": 404,
      "message": "The requested resource does not exist.",
      "hint": "Verify the API endpoint",
      "severity": "warning",
      "retryable": false,
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```

  ```json 413 theme={null}
  {
    "error": {
      "code": "PAYLOAD_TOO_LARGE",
      "http_status": 413,
      "message": "The requested response exceeds the maximum allowed size of 10 MB.",
      "hint": "Reduce the limit, narrow the block or time window, or apply additional filters before retrying.",
      "details": {
        "max_allowed_bytes": 10485760,
        "estimated_response_bytes": 15360000,
        "recommended_actions": [
          "Decrease the 'limit' parameter value",
          "Shorten the block range or time window",
          "Filter by from_address, to_address, token_address, or transfer_type"
        ]
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/pagination-and-limits"
    }
  }
  ```

  ```json 422 theme={null}
  {
    "error": {
      "code": "CHAIN_NOT_SUPPORTED",
      "http_status": 422,
      "message": "chain_id=137 is not supported.",
      "hint": "Use a supported chain_id. Consult the documentation for the list of available chains.",
      "severity": "error",
      "retryable": false,
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": "RATE_LIMIT_EXCEEDED",
      "http_status": 429,
      "message": "You have exceeded the allowed request rate.",
      "hint": "Introduce client-side throttling or exponential backoff and respect the retry_after_seconds value.",
      "details": {
        "limit_rps": 1000,
        "current_estimated_rps": 73,
        "retry_after_seconds": 2,
        "limit_scope": "api_key",
        "limit_window_seconds": 1
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/rate-limiting"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": "INTERNAL_SERVER_ERROR",
      "http_status": 500,
      "message": "An unexpected server error occurred.",
      "hint": "This error is not caused by your request. You may retry after a short delay.",
      "severity": "critical",
      "retryable": true,
      "details": {
        "incident_id": "INC-2025-11-11-123456",
        "temporary_issue": true,
        "expected_recovery_seconds": 5
      },
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```

  ```json 503 theme={null}
  {
    "error": {
      "code": "SERVICE_UNAVAILABLE",
      "http_status": 503,
      "message": "The service is temporarily unable to handle the request.",
      "hint": "The database connection pool is briefly saturated. Retry after a short delay.",
      "severity": "warning",
      "retryable": true,
      "details": null,
      "docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
    }
  }
  ```
</ResponseExample>
