<!-- source: https://secondlayer.tools/docs/api-reference#get-contract-abi -->

## Contract ABI from the local Stacks node

`GET /api/node/contracts/{contract_id}/abi` (self-hosted instances only)

Fetches the contract's interface from the Stacks node this instance follows (`/v2/contracts/interface`) and returns it unchanged. Nothing is cached. Self-hosted only; needs the instance token whenever one is set.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `contract_id` | string, required | Contract principal, `<address>.<name>`. A value without a `.` does not match the route and gets 404. |

### Returns

One `ContractAbi` object.

### Responses

- `200` The contract's ABI as the node reports it
- `401` This bind requires the instance token, and it was missing or wrong
- `404` The node has no contract with that id, or the id has no `.`
- `502` The node could not be reached or answered with an error; `error` carries its message

### Example

```bash
curl http://127.0.0.1:3800/api/node/contracts/SP3D23QJG4S1G6TBXSPFR0N3PMF53WXA50XTX9W0M.zeus-a/abi \
  -H "Authorization: Bearer $INSTANCE_TOKEN"
```

```json
{
  "functions": [
    {
      "name": "check-is-owner",
      "access": "private",
      "args": [],
      "outputs": {
        "type": {
          "response": {
            "ok": "bool",
            "error": "uint128"
          }
        }
      }
    },
    {
      "name": "start-zeus",
      "access": "public",
      "args": [
        {
          "name": "dx",
          "type": "uint128"
        },
        {
          "name": "min-dy",
          "type": "uint128"
        },
        {
          "name": "offset",
          "type": "uint128"
        }
      ],
      "outputs": {
        "type": {
          "response": {
            "ok": "bool",
            "error": "uint128"
          }
        }
      }
    }
  ],
  "variables": [
    {
      "name": "ERR-NOT-AUTHORIZED",
      "type": {
        "response": {
          "ok": "none",
          "error": "uint128"
        }
      },
      "access": "constant"
    },
    {
      "name": "contract-owner",
      "type": "principal",
      "access": "variable"
    }
  ],
  "maps": [],
  "fungible_tokens": [],
  "non_fungible_tokens": [],
  "epoch": "Epoch2_05",
  "clarity_version": "Clarity1"
}
```
