# Calls per function of a contract

[Open the contract's Code tab →](https://tracefast.xyz/entity/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48?tab=code)

How often each function of an address was called: the transactions sent to it
per 4-byte selector, most called first, with the block of the last one and the
function's name where a known signature has the selector — plus the first and
the last block in which the address received any call at all.

```
GET https://tracefast.xyz/api/v1/chains/1/contracts/{address}/function-calls
```

| Parameter | In | Type | Notes |
|---|---|---|---|
| `address` | path | string | `0x`-prefixed, 40 hex characters, any case |

**Access** — an [API key](/api/authentication) on the **Intelligence** plan or higher ([plans](/api/authentication#plans)). Not sold over [x402](/api/x402) yet. As a tool for AI agents: `get_contract_function_calls` on the [MCP server](/api/mcp-server). **Stable** — see [stability](/api/conventions#stability).

`chains/1` is a literal: other chain ids answer `404 chain_not_supported`. The
method takes no query parameters — an unknown one is refused rather than ignored.

## What it counts, and what it does not

* **Top-level calls only.** A count is the transactions sent **to** the
  address with that selector (`coverage: top_level_only`). A call made from
  inside another contract — a router calling a token, a multisig executing —
  is not counted. A token that is mostly moved by other contracts can look
  rarely called here.
* **A proxy's calls are counted at the proxy**, not at its implementation: ask
  about the address users call.
* **An empty list is not "never called" by contracts.** An address nobody sent a
  transaction to answers `functions: []`; `callSpan` still says whether it
  received any call, internal ones included.
* **`no_selector`** is one entry for every transaction received with fewer than
  4 bytes of input — plain value transfers and short inputs alike.
* **Names are best matches**, as on [selectors](/api/contract-selectors):
  `decodeStatus` and `candidateCount` say how confident.

## Response

`200 application/json`, the USDC proxy, cut to three of its 230 entries and the
`no_selector` entry:

```json
{
  "data": {
    "chainId": 1,
    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "coverage": "top_level_only",
    "functions": [
      {
        "kind": "function",
        "selector": "0xa9059cbb",
        "name": "transfer",
        "signature": "transfer(address,uint256)",
        "decodeStatus": "ambiguous",
        "candidateCount": 4,
        "topLevelCalls": 112426674,
        "lastTopLevelCallBlock": 26390236
      },
      {
        "kind": "function",
        "selector": "0x095ea7b3",
        "name": "approve",
        "signature": "approve(address,uint256)",
        "decodeStatus": "ambiguous",
        "candidateCount": 3,
        "topLevelCalls": 14640043,
        "lastTopLevelCallBlock": 26390236
      },
      {
        "kind": "function",
        "selector": "0x23b872dd",
        "name": "transferFrom",
        "signature": "transferFrom(address,address,uint256)",
        "decodeStatus": "ambiguous",
        "candidateCount": 4,
        "topLevelCalls": 5807714,
        "lastTopLevelCallBlock": 26390236
      },
      {
        "kind": "no_selector",
        "topLevelCalls": 4619,
        "lastTopLevelCallBlock": 26389306
      }
    ],
    "entryCount": 230,
    "callSpan": { "firstBlock": 6082473, "lastBlock": 26390236 },
    "callSpanAsOfBlock": 26390236
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1794384198914,
    "cached": true,
    "docs": "https://docs.tracefast.xyz/api/contract-function-calls"
  }
}
```

The answer states no `meta.asOfBlock`: each entry carries its own
`lastTopLevelCallBlock`, and `callSpanAsOfBlock` says how far the span is read.

### `data`

| Field | Meaning |
|---|---|
| `chainId` | `1` — Ethereum mainnet |
| `address` | the address, lowercase |
| `coverage` | `top_level_only` — the counts cover transactions sent to the address; calls from inside other contracts are not counted |
| `functions[]` | one entry per selector, by `topLevelCalls`, most called first |
| `entryCount` | entries in this answer, the `no_selector` entry included |
| `truncated` | present (`true`) only when the address received more selectors than one answer lists (1,000); the least called are left out |
| `callSpan` | `firstBlock` and `lastBlock` in which the address received **any** call, calls from inside other contracts included. Absent with `callSpanAsOfBlock` present: no call up to that block |
| `callSpanAsOfBlock` | the block `callSpan` is stated up to. Absent when it cannot be read right now — then nothing is said about the span either way |

### An entry

| Field | Meaning |
|---|---|
| `kind` | `function` for a selector; `no_selector` for transactions with fewer than 4 bytes of input |
| `selector` | the 4-byte selector; absent for `no_selector` |
| `name`, `signature` | present when a known signature has the selector and its text is served — see [text from the chain](/api/conventions#text-from-the-chain) |
| `nameState` | `withheld` — a known signature has the selector, but its text is not served: no `name` or `signature`, and it is still counted in `decodeStatus` and `candidateCount`. Absent otherwise |
| `decodeStatus`, `candidateCount` | how confident the name is — `partial`, `ambiguous`, `abi_missing` — and how many known signatures share the selector |
| `topLevelCalls` | transactions the address received with this selector |
| `lastTopLevelCallBlock` | the block of the last of them |

## Errors

The method has no refusals of its own beyond a malformed address. Malformed
input, unknown parameters and the key check's `401`/`403`/`429` are the same
for every method — see [conventions](/api/conventions#errors) and
[API keys](/api/authentication#when-a-key-is-refused).

## Related pages

* [Function selectors of a contract](/api/contract-selectors) — every selector in the code, called or not
* [Decompiled code of a contract](/api/contract-decompilation) — what the called functions do
* [Activity of an address](/api/address-activity) — the address's transactions over time
* [Contracts on the entity page](/explorer/entity/contracts) — the Code tab, the same counts in the app
