Starkscan
Getting started

Get your first API key

Create a Starkscan API key and make your first authenticated call in under five minutes.

Get your first API key

One key works across REST, the TypeScript SDK, the CLI, and hosted MCP. This page takes you from no key to a successful call.

1. Create a key

  1. Open the API keys page.
  2. Sign in (or create an account).
  3. Create a key and copy it. You see the full value once — store it in an environment variable or secrets manager. Never paste it into chat, tickets, screenshots, PR comments, or source. Rotate it if the full value ever leaks.

2. Set your environment

export STARKSCAN_BASE_URL="https://starkscan.co/api"
export STARKSCAN_CHAIN="SN_MAIN"
export STARKSCAN_API_KEY="<your key>"

The /api suffix on the base URL matters for external calls — see Base URLs and chains.

3. Make your first call

curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
  "$STARKSCAN_BASE_URL/v1/$STARKSCAN_CHAIN/status"

Success looks like a JSON object with chainId, headBlockNumber, latestIndexedBlockNumber, and lagBlocks.

Use the same key everywhere

SurfaceHow
RESTSend the X-Starkscan-Api-Key header — see Authentication.
TypeScript SDKcreateStarkscanClient({ apiKey, baseUrl, chainId }) — see TypeScript SDK.
CLInpx -y @starkscan/cli@alpha ... — see Agent CLI.
MCPConnect the hosted MCP server — see MCP quickstart.

If your first call fails

A 401 means the key is missing or wrong, and a 403 means the key is valid but the route is not in your tier. See Authentication for the full list and fixes.

On this page