Starkscan
Getting started

Read a transaction

Fetch a transaction's full detail and its execution trace over REST or the TypeScript SDK.

Read a transaction

Resolve a transaction hash to its full detail (receipt, logs, token transfers) and, when you need execution context, its trace.

REST

# detail (includes inline tokenTransfers)
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
  "${STARKSCAN_BASE_URL:-https://api.starkscan.co}/v1/$STARKSCAN_CHAIN/tx/<tx_hash>"

# execution trace
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
  "${STARKSCAN_BASE_URL:-https://api.starkscan.co}/v1/$STARKSCAN_CHAIN/tx/<tx_hash>/trace"

Detail responses include inline tokenTransfers. Check logsTruncated before treating the logs array as exhaustive (tokenTransfersTruncated is only present on the batched txDetails response below, not on single-transaction detail).

Token amounts and prices

Each transfer carries address-keyed indexed tokenName, tokenSymbol, and tokenDecimals, independently of price-provider coverage. These fields are nullable: missing metadata is not evidence that the token is worthless or has zero decimals. Zero is a valid decimal scale; accepted scales range from 0 to 36.

Keep amount as a raw integer string. When tokenDecimals is present, render amount / 10^tokenDecimals with integer or decimal arithmetic, not JavaScript Number. For example, raw "123450000" at six decimals is 123.45 tokens. Use an indexed decimal scale even when the name or symbol is missing. These are independent facts: an unnamed token can still have a correct decimalized amount. Fall back to its canonical address for the display label, not a guessed symbol. When decimals are absent, preserve the raw amount and label it base units; never guess a scale from the symbol. Chain plus token address is the identity, while names and symbols are display metadata.

historicalUsd is separate transaction-time valuation. Inspect its coverage and reason before displaying USD; an unpriced or pending transfer can still have a correct token name and decimalized amount. Never substitute a current market quote for historical USD. Receipt/share and wrapper tokens also need a proven underlying conversion before their price can be derived; a familiar symbol does not establish a one-to-one exchange rate.

TypeScript SDK

import { createStarkscanClient } from "@starkscan/sdk";

const starkscan = createStarkscanClient({
  apiKey: process.env.STARKSCAN_API_KEY!,
  chainId: "SN_MAIN",
});

const tx = await starkscan.transaction("0x...");
const trace = await starkscan.transactionTrace("0x...");

Install the client with npm install @starkscan/sdk (see the SDK guide; resolve an exact npm version before pinning unattended use). For many hashes at once, use starkscan.txDetails([...]) (batched, up to 128 hashes; again check logsTruncated / tokenTransfersTruncated).

Other surfaces

When a call fails

See Your first error for 401 / 403 / 404 / 429 and the exact fix for each.

On this page