> For the complete documentation index, see [llms.txt](/llms.txt).

# `starknet_getNonce`

Returns the nonce associated with the specified contract address in the specified block.

## Parameters[​](#parameters "Direct link to Parameters")

- `block_id`: [_Required_] The block parameter object containing one of the following:  
  - `block_hash`: (string) Block hash.
  - `block_number`: (integer) Decimal block number.
  - One of the string tags `latest` or `pending`.
- `contract_address`: (string) [_Required_] The address of the request contract.

## Returns[​](#returns "Direct link to Returns")

The last nonce used for the requested contract.

## Example[​](#example "Direct link to Example")

Replace `<YOUR-API-KEY>` with an API key from your [Infura dashboard](https://app.infura.io/).

### Request[​](#request "Direct link to Request")

- curl

```
curl https://starknet-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "starknet_getNonce",
    "params": {
      "block_id": {
        "block_number": 470207
      },
      "contract_address": "0x0555ec3ba8aea37915c4cf850b4f9d33e4a0a1caa0ad3953d725860e38fa6e17"
    },
  "id": 0
}'

```

### Response[​](#response "Direct link to Response")

- JSON

```
{
  "jsonrpc": "2.0",
  "result": "0x1c",
  "id": 0
}

```
