> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/bscscan.md).

# bscscan

[BSCScan](https://bscscan.com/) is a block explorer and API platform for BNB Smart Chain. It provides access to transaction details, account histories, token transfers, verified contract source code, and contract ABIs.

In Agent Forge, the BSCScan integration allows your agents and workflows to retrieve BNB Chain data directly from BSCScan APIs. This is useful for wallet monitoring, transaction analysis, token transfer tracking, contract inspection, and blockchain reporting workflows.

### Usage Instructions

Use BSCScan when your workflow needs BNB Chain data. Provide a BSCScan API key, choose an operation, and pass the required transaction hash, wallet address, or contract address.

Advanced fields allow you to set the chain ID, block range, pagination, result size, and sort direction.

### Tools

#### `bscscan_get_tx`

Fetch transaction details by transaction hash.

#### `bscscan_get_address_txs`

Retrieve normal transactions for a wallet address.

#### `bscscan_get_token_txs`

Retrieve token transfer events for an address, optionally filtered by token contract.

#### `bscscan_get_contract_source`

Fetch verified contract source code and metadata for a contract address.

#### `bscscan_get_contract_abi`

Fetch the verified ABI for a contract address.

### Common Inputs

| Parameter         | Type   | Required           | Description                                 |
| ----------------- | ------ | ------------------ | ------------------------------------------- |
| `apiKey`          | string | Yes                | BSCScan API key                             |
| `txHash`          | string | Operation-specific | Transaction hash                            |
| `address`         | string | Operation-specific | Wallet address                              |
| `contractAddress` | string | Operation-specific | Contract address                            |
| `chainId`         | number | No                 | EVM chain ID, defaulting to BNB Smart Chain |
| `startBlock`      | number | No                 | Starting block number                       |
| `endBlock`        | number | No                 | Ending block number                         |
| `page`            | number | No                 | Page number                                 |
| `offset`          | number | No                 | Results per page                            |
| `sort`            | string | No                 | Sort direction, `asc` or `desc`             |

### Output

| Parameter | Type   | Description                |
| --------- | ------ | -------------------------- |
| `data`    | json   | Full BSCScan response data |
| `status`  | string | BSCScan status value       |
| `message` | string | BSCScan response message   |
| `result`  | json   | BSCScan result payload     |

### Notes

* Category: `tools`
* Type: `bscscan`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/bscscan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
