address-api\GetAddress.php
<?php

Get Address

The Address resource allows you to retrieve details about an Address.

API called: '/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD'

require __DIR__ . '/../bootstrap.php'; /// override default sample address with GET parameter if (isset($_GET['address'])) { $sampleAddress = filter_input(INPUT_GET, 'address', FILTER_SANITIZE_SPECIAL_CHARS); } else { $sampleAddress = '1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD'; } $addressClient = new \BlockCypher\Client\AddressClient($apiContexts['BTC.main']); try { $address = $addressClient->get($sampleAddress, array(), $apiContexts['BTC.main']); } catch (Exception $ex) { ResultPrinter::printError("Get Address", "Address", $sampleAddress, null, $ex); exit(1); } ResultPrinter::printResult("Get Address", "Address", $address->getAddress(), null, $address); return $address;