# Call view

> A view of a contract, at the index's head or at a named block.

Source: https://docs.tapehouse.xyz/api/call-view

`GET /v1/contracts/{contract}/views/{function}`

The view's inputs are query parameters named as in the contract's ABI (`arg<i>` for an unnamed one), arrays separated by commas. A view that reverts answers with its revert, named where the SDKs' bindings know it. Answers at a block are cached, since they never change.

## Path parameters

- `contract` (required): 
- `function` (required): 

## Query parameters

- `block`: 

## Response

- `block` (integer)
- `outputs` (object | null)
- `revert` (null | Revert)

## Example

```bash
curl "https://indexer-production-f5dc.up.railway.app/v1/contracts/tapehouse.SupplyVault/views/totalAssets"
```

## Errors

- 400: Why the request was not served.
- 401: An X-API-Key the operator did not issue.
- 402: Over the public tier's rate, where the operator sells the requests beyond it. The `PAYMENT-REQUIRED` header is the base64 of a JSON document of x402's version 2: what a request costs in USDG, and to whom, on which chain. Repeat the request with `PAYMENT-SIGNATURE`, the base64 of the payment signed for it; it is served once the payment settles, and its `PAYMENT-RESPONSE` header is the settlement.
- 404: Why the request was not served.
- 429: Over the tier's rate.
- 502: Why the request was not served.
- 503: Why the request was not served.
