MyEtherAPI
An API by MyEtherWallet · v0.0.1

Endpoints

Name Endpoint Type EIP-155 Chain ID
ETH https://api.myetherapi.com/eth Parity TRUE 1
Ropsten https://api.myetherapi.com/rop Parity TRUE 3

Calls

This Stuff More Info
JSON RPC Methods https://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-methods
Web3 web3.setProvider(new web3.providers.HttpProvider('PUT_ENDPOINT_URL_HERE')
Allowed Methods

    web3_clientVersion
    web3_sha3
    net_version
    net_peerCount
    eth_protocolVersion
    eth_syncing
    eth_gasPrice
    eth_blockNumber
    eth_getBalance
    eth_getStorageAt
    eth_getTransactionCount
    eth_getBlockTransactionCountByHash
    eth_getBlockTransactionCountByNumber
    eth_getUncleCountByBlockHash
    eth_getUncleCountByBlockNumber
    eth_getCode
    eth_sendRawTransaction
    eth_call
    eth_estimateGas
    eth_getBlockByHash
    eth_getBlockByNumber
    eth_getTransactionByHash
    eth_getTransactionByBlockHashAndIndex
    eth_getTransactionByBlockNumberAndIndex
    eth_getTransactionReceipt
    eth_getUncleByBlockHashAndIndex
    eth_getUncleByBlockNumberAndIndex
    eth_getCompilers
    eth_compileSolidity
    eth_newFilter
    eth_newBlockFilter
    eth_newPendingTransactionFilter
    eth_uninstallFilter
    eth_getFilterChanges
    eth_getFilterLogs
    eth_getLogs
    trace_call
    trace_rawTransaction
    trace_replayTransaction
    trace_filter
    trace_get
    trace_transaction
    trace_block
  

Examples: JSON RPC

Example 1

    // Request
    curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8", "latest"],"id":1}' https://api.myetherapi.com/eth

    // Result
    {
      "id":1,
      "jsonrpc": "2.0",
      "result": "0x231d5cd577654ceab3" // 647751843213568961203
    }
  

Examples: Web3

Example 1

    var web3 = new Web3();
    web3.setProvider(new web3.providers.HttpProvider('https://api.myetherapi.com/eth'));
    web3.eth.getBalance("0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8").toString();

    //Result
    "647751843213568961203"  
      
Example 2

    var web3 = new Web3();
    web3.setProvider(new web3.providers.HttpProvider('https://api.myetherapi.com/eth'));
    var filter = web3.eth.filter('pending');
    filter.watch(function(error, result) {
      if (!error) {
        web3.eth.getTransaction(result, function(error, data) {
          if (!error) $("#newTxs tr:first").after(''+data.from+''+data.to+' '+web3.fromWei(data.value,'ether').toString()+' ETH ');
        });
      }
    });

    //Result
    //checkout latest transactions below, it might take a second to load as it is waiting for incoming txs
      

Latest Transactions

From To Value
Example 3

    var web3 = new Web3();
    web3.setProvider(new web3.providers.HttpProvider('https://api.myetherapi.com/eth'));
    var filter = web3.eth.filter('latest');
    filter.watch(function(error, result) {
      if (!error) {
        web3.eth.Block(result, function(error, data) {
          if (!error) $("#newBlocks tr:first").after(''+data.hash.substr(0,20)+'...'+data.number+' '+data.miner+' '+data.uncles.length+'');
        });
      }
    });

    //Result
    //checkout latest Blocks below, it might take a second to load as it is waiting for new Blocks
      

Latest Blocks

Hash Block # Miner # Transactions

Support

Contact your friendly tayvano any time, she'll be super excited to help you :)