PHPackages                             seregazhuk/etherscan-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. seregazhuk/etherscan-api

ActiveLibrary[API Development](/categories/api)

seregazhuk/etherscan-api
========================

PHP client for the Etherscan API

11PHPCI passing

Since Dec 16Pushed 5mo agoCompare

[ Source](https://github.com/seregazhuk/php-etherscan-api)[ Packagist](https://packagist.org/packages/seregazhuk/etherscan-api)[ RSS](/packages/seregazhuk-etherscan-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP wrapper for the Etherscan API (supports v2).
================================================

[](#php-wrapper-for-the-etherscan-api-supports-v2)

PHP client for [Etherscan API](https://docs.etherscan.io) (and its families like BscScan), with nearly full API bindings (accounts, transactions, tokens, contracts, blocks, stats) and full [chains](https://docs.etherscan.io/supported-chains) support.

**Table of Contents**

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Available bindings](#available-bindings)
    - [Accounts](#accounts)
    - [Contracts](#contracts)
    - [Proxy](#proxy)

Installation
------------

[](#installation)

```
composer req seregazhuk/etherscan-api:dev-main
```

Quick Start
-----------

[](#quick-start)

Register Etherscan account and create [free API key](https://etherscan.io/myapikey).

```
$etherscan = new seregazhuk\EtherscanApi\EtherscanApi('your-api-key');
$currentBlock = $etherscan->proxy->getBlockNumber();
$transactionInfo = $etherscan->proxy->getTransactionByHash('0x136f818dfe87b367eee9890c162ef343dbd65e409aef102219a6091ba7e696d7');
$isConfirmed = $currentBlock
        ->subtract($transactionInfo->blockNumber)
        ->compare(new BigInteger('12')) >= 0;

echo $isConfirmed ? 'Confirmed' : 'Not confirmed';
```

Use Binance Smart Chain (testnet):

```
$etherscanApi = new EtherscanApi('your-api-key', ChainId::BNB_SMART_CHAIN_TESTNET);
```

Available bindings
------------------

[](#available-bindings)

### Accounts

[](#accounts)

[Get Ether balance for a single address](https://docs.etherscan.io/api-endpoints/accounts#get-ether-balance-for-a-single-address):

```
$balance = $etherscan->accounts->getBalance('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');
```

Get Ether balance for multiple addresses in a single call:

```
$balances = $etherscan->accounts->getBalances(['0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a', '0x63a9975ba31b0b9626b34300f7f627147df1f526']);
```

[Get a list of 'Normal' transactions by address](https://docs.etherscan.io/api-reference/endpoint/txlist):

```
$transactions = $etherscan->accounts->getTransactions('0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC');
```

[Get a list of internal transactions by hash](https://docs.etherscan.io/api-reference/endpoint/txlistinternal-txhash):

```
$transactions = $etherscan->accounts->getInternalTransactionsByHash('0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170');
```

[Get internal transactions by block range](https://docs.etherscan.io/api-reference/endpoint/txlistinternal-blockrange):

```
$transactions = $this->accounts->getInternalTransactionsByBlockRange(13481773, 13491773);
```

[Get ERC20 token transfers by address](https://docs.etherscan.io/api-reference/endpoint/tokentx):

```
$erc20Events = $this->accounts->getErc20TokenTransferEvents('0x4e83362442b8d1bec281594cea3050c8eb01311c', '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2');
```

[Get ERC721 token transfers by address](https://docs.etherscan.io/api-reference/endpoint/tokennfttx):

```
$erc721Events = $this->accounts->getErc721TokenTransferEvents('0x6975be450864c02b4613023c2152ee0743572325', '0x06012c8cf97bead5deae237070f9587f8e7a266d');
```

[Get ERC1155 token transfers by address](https://docs.etherscan.io/api-reference/endpoint/token1155tx):

```
$erc1155Events = $this->accounts->getErc1155TokenTransferEvents('0x83f564d180b58ad9a02a449105568189ee7de8cb', '0x76be3b62873462d2142405439777e971754e8e77');
```

### Contracts

[](#contracts)

[Get Contract ABI](https://docs.etherscan.io/api-reference/endpoint/getabi#get-contract-abi-for-verified-contract-source-codes):

```
$abi = $this->contracts->getAbi('0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413');
```

[Get Contract Source Code](https://docs.etherscan.io/api-reference/endpoint/getsourcecode):

```
$sourceCode = $this->contracts->getSourceCode('0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413');
```

### Proxy

[](#proxy)

[eth\_getTransactionByHash](https://docs.etherscan.io/api-reference/endpoint/ethgettransactionbyhash):

```
$transactionInfo = $etherscan->proxy->getTransactionByHash('0x136f818dfe87b367eee9890c162ef343dbd65e409aef102219a6091ba7e696d7');
```

[eth\_blockNumber](https://docs.etherscan.io/api-reference/endpoint/ethblocknumber):

```
$currentBlock = $etherscan->proxy->getBlockNumber();
```

[eth\_getBlockByNumber](https://docs.etherscan.io/api-reference/endpoint/ethgetblockbynumber):

```
$blockInfo = $etherscan->proxy->getBlockByNumber('0x10d4f');
```

[eth\_sendRawTransaction](https://docs.etherscan.io/api-reference/endpoint/ethsendrawtransaction):

```
$result = $this->proxy->sendRawTransaction('0xf904808000831cfde080');
```

[eth\_getBlockTransactionCountByNumber](https://docs.etherscan.io/api-reference/endpoint/ethgetblocktransactioncountbynumber):

```
$result = $this->proxy->getBlockTransactionCountByNumber('0x10FB78');
```

[eth\_getTransactionCount](https://docs.etherscan.io/api-reference/endpoint/ethgettransactioncount):

```
$result = $this->proxy->getTransactionCount('0x4bd5900Cb274ef15b153066D736bf3e83A9ba44e');
```

[eth\_getTransactionReceipt](https://docs.etherscan.io/api-reference/endpoint/ethgettransactionreceipt):

```
$result = $this->proxy->getTransactionReceipt('0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c');
```

[eth\_gasPrice](https://docs.etherscan.io/api-reference/endpoint/ethgasprice):

```
$result = $this->proxy->getGasPrice();
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance50

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb0e185b75648fb1c0095795e222f210700b86ae8c575c3cd6dd28a970ae2f34?d=identicon)[seregazhuk](/maintainers/seregazhuk)

---

Top Contributors

[![seregazhuk](https://avatars.githubusercontent.com/u/9959761?v=4)](https://github.com/seregazhuk "seregazhuk (24 commits)")

### Embed Badge

![Health badge](/badges/seregazhuk-etherscan-api/health.svg)

```
[![Health](https://phpackages.com/badges/seregazhuk-etherscan-api/health.svg)](https://phpackages.com/packages/seregazhuk-etherscan-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
