Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

maslakoff/php-etherscan-api

Open more actions menu

Repository files navigation

EtherScan PHP API

PHP wrapper for the EtherScan API

License: MIT

Official API Documentation

Create API Key (optional)

Requirements

The minimum requirement by EtherScan API is that your Web server supports PHP 5.6.

Installation

To install EtherScan PHP API package you can run command:

composer require maslakoff/php-etherscan-api:dev-master

Usage

Mainnet

$client = new \Etherscan\Client('Y3U3GMFC8P545CFWRU4TET8MY1K79YDZ3V');
$client->api('account')->balance('0x43406D1baAE11a950DE734DAE4079A3C9Eb48DAf');

For testnet usage

Supported:

  • goerli
  • ropsten
  • kovan
  • rinkeby
$client = new \Etherscan\Client('Y3U3GMFC8P545CFWRU4TET8MY1K79YDZ3V', EtherscanAPIConf::TESTNET_RINKEBY);
$client->api('account')->balance('0x43406D1baAE11a950DE734DAE4079A3C9Eb48DAf');

For Binance Smart Chain (BSC) usage

In order to query the BSC you need a different API. You can obtain it here: https://bscscan.com/apis. Here the call:

$bsc_client = new \Etherscan\Client('Y3U3GMFC8P545CFWRU4TET8MY1K79YDZ3V', EtherscanAPIConf::NET_BSC);
$bsc_client->api('account')->balance('0x43406D1baAE11a950DE734DAE4079A3C9Eb48DAf');

About

A PHP wrapper for the etherscan.io api to fetch data and metadata from the ethereum blockchain

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.