Address nonce (ETH)

Get the latest and pending nonce of an Ethereum address.

# Address nonce (ETH)

`GET https://api.rarebl.com/open/address/nonce`

The latest and pending transaction count of an Ethereum address, to set the nonce of the next transaction.

**Rate class:** read (5 requests per second, burst 20, per IP). **Available since:** Open API v2.

## Request

Send the parameters as query parameters (GET) or as a JSON object (POST with `Content-Type: application/json`). They are identical either way. No API key is needed: `X-API-KEY` is reserved and ignored.

Example: `curl "https://api.rarebl.com/open/address/nonce?chain=eth&address=0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"`

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `chain` | string | Yes | Ethereum only. One of: eth. |
| `address` | string | Yes | The ETH address. |

## Responses

### API200 (HTTP 200): OK

Latest and pending nonce.

```json
{
  "status": 1,
  "code": "API200",
  "message": "success",
  "data": {
    "latest": 42,
    "pending": 42
  },
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `data.latest / pending` | integer | Confirmed and pending transaction counts. Use `pending` for the next transaction. |

### API400 (HTTP 400): Bad Request

A parameter is missing or malformed. `data.param` names it (here `address`).

```json
{
  "status": 0,
  "code": "API400",
  "message": "Invalid ETH address.",
  "data": {
    "param": "address"
  },
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

### API429 (HTTP 429): Too Many Requests

Rate limited (read class: 5 requests per second, burst 20, per IP). A `Retry-After` header says how long to wait, in seconds.

```json
{
  "status": 0,
  "code": "API429",
  "message": "Too many requests. Please retry shortly.",
  "data": null,
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

### API502 (HTTP 502): Bad Gateway

The node is unavailable, still syncing or timed out. Retry later with a short back-off.

```json
{
  "status": 0,
  "code": "API502",
  "message": "The node is unavailable or timed out. Please try again.",
  "data": null,
  "go": null,
  "meta": {
    "requestid": "0123456789abcdef",
    "notices": []
  }
}
```

## Notes

- ETH depends on the Ethereum node, which is still syncing: expect `API502` until it has finished.
- [Build a transaction](https://docs.rarebl.com/api/tx/build) fills the nonce for you.

Back to the Rarebl AI documentation index