Title: Time travel
Source: https://nodely.io/docs/access/time-travel/

# Time travel

Time travel answers node (algod) API questions **as of a past round**: an account’s balance and holdings, an app’s global state or a box at any round since genesis, the rounds at which they changed, and a transaction group simulated against past state. A stock node only knows the latest state; Nodely routes these requests to time-travel nodes that keep the history of every ledger object.

<a id="who-gets-it"></a>

## Who gets it

| Plan | Time travel |
| --- | --- |
| Free | Testnet time travel |
| Boost | Basic time travel (mainnet and testnet) |
| Unlimited | Full time travel (mainnet and testnet) |
| Enterprise | Full time travel (mainnet and testnet) |

-   **Testnet** history is open to everyone, on the free hosts as well, under the usual free-tier limits.
-   **Mainnet** history needs a paid plan: send a token, or call from a whitelisted site (or IP, on Unlimited and Enterprise). Boost uses the public `nodely.dev` hosts, Unlimited and Enterprise the [commercial hosts](https://nodely.io/docs/access/#paid-plans-token-site-or-ip). Public goods projects on Unlimited get it too. Without a plan, mainnet history requests are rejected with an error; an organization admin can upgrade on the [Billing page](https://portal.nodely.io/billing).
-   History requests count toward your daily quota and rate limits like any other request.

<a id="what-counts-as-a-history-request"></a>

## What counts as a history request

The edge sends these requests to the time-travel nodes and everything else to the regular nodes:

| Request | Answers |
| --- | --- |
| `GET /v2/accounts/{address}?round=R`, and its `/assets`, `/applications`, `/assets/{id}`, `/applications/{id}` | The account, its holdings and local states at the end of round R |
| `GET /v2/assets/{id}?round=R`, `GET /v2/applications/{id}?round=R` | Asset parameters, app parameters and global state at R |
| `GET /v2/applications/{id}/box?name=…&round=R`, `/boxes?round=R` | A box value, or the app’s boxes, at R |
| `GET /v2/ledger/supply?round=R` | Totals at R |
| `GET …/versions`, for example `/v2/accounts/{address}/versions` | The rounds at which an object changed, paginated, with the new values on `include=values` |
| `POST /v2/transactions/simulate` with `"round": R` | The group evaluated as if it were in block R+1 |

Simulate requests that use the fork’s other extensions (`rounds`, `parallel-groups`, `protocol`) count as history requests too. The full list of endpoints, parameters and known limitations is in the [dt-algorand time travel docs](https://github.com/d13co/dt-algorand/blob/dtalgorand/ledger/timetravel/README.md), and the versions API in [VERSIONS.md](https://github.com/d13co/dt-algorand/blob/dtalgorand/ledger/timetravel/VERSIONS.md).

<a id="examples"></a>

## Examples

```bash
# Mainnet, paid plan: an account as it was at the end of round 50,000,000
curl -H "X-API-Key: $NODELY_TOKEN" \
  "https://mainnet-api.4160.nodely.io/v2/accounts/$ADDRESS?round=50000000"

# The rounds at which the account changed between two rounds, newest first
curl -H "X-API-Key: $NODELY_TOKEN" \
  "https://mainnet-api.4160.nodely.io/v2/accounts/$ADDRESS/versions?min-round=49000000&max-round=50000000&order=desc&limit=10"

# Testnet, free host, no key: an app's global state at a past round
curl "https://testnet-api.4160.nodely.dev/v2/applications/$APP_ID?round=40000000"
```

To simulate at a past round, add `round` to the usual simulate request body:

```json
{
  "txn-groups": [{ "txns": ["…signed or unsigned transactions…"] }],
  "allow-empty-signatures": true,
  "round": 50000000
}
```

<a id="errors"></a>

## Errors

| Response | Meaning |
| --- | --- |
| An error on a mainnet history request without a plan | Mainnet history needs a paid plan: send your token, or call from a whitelisted site or IP. |
| `503 {"message":"historical state (time travel) service unavailable"}` | The time-travel nodes cannot be reached. The edge does not fall back to a regular node, because it would answer with the latest state instead. Retry with backoff. |
| `404` on `/v2/ledger/supply?round=` | The online stake for that round was not recorded. |

Indexer APIs are not affected: they keep their own `round` and `min-round` / `max-round` parameters.
