> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/contract/contract.chain_id.md).

# Contract.chain\_id()

Returns the ChainID of the blockchain where the Contract was deployed.

`chain_id() → int`

## Example query

```python
from glider import *

def query():
  contracts = Contracts().exec(5)

  for contract in contracts:
    print(contract.chain_id())

  return contracts
```

## Example output

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2FzrGuRfndiFZ0y97XUChG%2Fimage.png?alt=media&amp;token=3c0668e3-7e9f-4bbb-a27f-b97765b275d5" alt=""><figcaption></figcaption></figure>
