> ## 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.

# Lineage Record

> Fetch canonical records directly by tracing identifier.

## Overview

Retrieves the canonical BlockDB representation of a single record, keyed by its lineage identifier. This is the lightweight entry point before requesting heavier parent expansions.

## Parameters

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

<ParamField body="tracing_id" type="string" required>
  Lineage identifier for the target record (hex string, no `0x` prefix). The legacy `_tracing_id` key is still accepted.
</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.tracing_id" type="string">
  Tracing identifier for the record whose artifacts are returned.
</ResponseField>

#### Data

<ResponseField name="data" type="object">
  Envelope containing the record payload.
</ResponseField>

<ResponseField name="data.dataset" type="string">
  Dataset namespace that owns the record (e.g., `0201_tokens-erc20`).
</ResponseField>

<ResponseField name="data.record" type="object">
  Snapshot of the dataset-specific fields for this record. Common metadata includes:
</ResponseField>

<ResponseField name="data.record.chain_id" type="number">
  Network identifier copied from the envelope.
</ResponseField>

<ResponseField name="data.record.address" type="string">
  Dataset-specific primary key (illustrated here with a token contract address).
</ResponseField>

<ResponseField name="data.record.block_number" type="number">
  Canonical block height where the record last changed.
</ResponseField>

<ResponseField name="data.record.block_time" type="string">
  ISO-8601 timestamp for the block that produced the record state.
</ResponseField>

<ResponseField name="data.record.tx_index" type="number">
  Transaction position for provenance auditing when applicable.
</ResponseField>

<ResponseField name="data.record.log_index" type="number">
  Log position for provenance auditing when applicable.
</ResponseField>

<ResponseField name="data.record._tracing_id" type="string">
  Internal variant of `tracing_id`.
</ResponseField>

<ResponseField name="data.record._parent_tracing_ids" type="string[]">
  Internal variant mirrored for completeness.
</ResponseField>

<ResponseField name="data.record._created_at" type="string">
  Internal created-at timestamp.
</ResponseField>

<ResponseField name="data.record._updated_at" type="string">
  Internal updated-at timestamp.
</ResponseField>

* **`name`**, **`symbol`**, **`decimals`**\
  Dataset fields shown for the ERC-20 example. Actual shape varies per dataset—consult the dataset's schema docs.

### Next Steps

* Chain into [`/evm/lineage/parents`](/api-reference/evm/lineage/parents) to traverse upstream derived records.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.blockdb.io/v1/evm/lineage/record" \
    -H "Authorization: Bearer $BLOCKDB_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "chain_id": 1,
    "tracing_id": "0201000000000000000000000000000000000001"
  }'
  ```

  ```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,\"tracing_id\":\"0201000000000000000000000000000000000001\"}";

      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/lineage/record");
      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,\"tracing_id\":\"0201000000000000000000000000000000000001\"}",
              Encoding.UTF8,
              "application/json"
          );

          var response = await client.PostAsync("https://api.blockdb.io/v1/evm/lineage/record", 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/lineage/record",
      headers={
          "Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
          "Content-Type": "application/json"
      },
      json={'chain_id': 1, 'tracing_id': '0201000000000000000000000000000000000001'}
  )

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.blockdb.io/v1/evm/lineage/record", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
    "chain_id": 1,
    "tracing_id": "0201000000000000000000000000000000000001"
  })
  });

  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,
    "tracing_id": "0201000000000000000000000000000000000001"
  }`)

      req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/lineage/record", 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,
      "tracing_id": "0201000000000000000000000000000000000001"
    },
    "data": {
      "dataset": "blockdb_evm.b0201_erc20_tokens_v1",
      "record": {
        "chain_id": 1,
        "address": "0000000000000000000000000000000000000001",
        "name": "Token Name",
        "symbol": "TOKEN",
        "decimals": 18,
        "block_number": 567890,
        "block_time": "2018-07-07T12:34:56Z",
        "tx_index": 4,
        "log_index": 2,
        "_tracing_id": "0201000000000000000000000000000000000001",
        "_parent_tracing_ids": [
          "0103000000000000000000000000000000000001",
          "0103000000000000000000000000000000000002"
        ],
        "_created_at": "2025-11-11T18:42:15.123Z",
        "_updated_at": "2025-11-11T18:42:15.123Z"
      }
    }
  }
  ```

  ```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": "query",
            "reason": "missing",
            "expected": "positive integer, e.g. 1"
          },
          {
            "name": "from_timestamp",
            "location": "query",
            "reason": "invalid_format",
            "expected": "ISO-8601 UTC timestamp, e.g. 2025-11-11T00:00:00Z"
          }
        ]
      },
      "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 fewer pools or exchanges"
        ]
      },
      "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, # configured rate limit
        "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>
