This page provides instructions and sample output for working with the SPECTRA block explorer API.
Each API response is a JSON encoded array with three fields provided to enable consistent status and error information for use in your application.
The API endpoint for this SPECTRA installation can be reached at:
The following output is an intentionally generated error. In case of error, the API will return a status of `0` and attempt to populate the message field with an informative error message.
Array
(
[status] => 0
[message] => Invalid or Unrecognized Request
[data] =>
)
The rest of this page describes the available API methods and provides samples using live calls to the local API.
The ticker API method will produce a consolidated ticker for all markets enabled by the admin.
The ticker method is a pass-through request to each enabled exchange, the data is formatted, consolidated, and returned without caching.
Sample ‘ticker’ API request:
Sample ‘ticker’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[0] => Array
(
[bid] => 0.00000012
[ask] => 0.00000013
[last] => 0.00000013
[vol] => 1585441.07300570
[exchange] => Cryptsy
[market] => SPEC / BTC
)
[3] => Array
(
[bid] => 0.00000011
[ask] => 0.00000014
[vol] => 165559.23200289
[last] => 0.00000014
[exchange] => Bleutrade
[market] => SPEC / BTC
)
)
)
The following API methods return information about the MindCoin network as provided by the block explorer node.
Response data is not cached at this time.
Sample ‘getinfo’ API request:
Sample ‘getinfo’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[version] => 1000005
[protocolversion] => 70002
[walletversion] => 60000
[balance] => 0.00000000
[blocks] => 10587
[timeoffset] => -1
[connections] => 4
[proxy] =>
[difficulty] => 62.45401651
[testnet] =>
[keypoololdest] => 1439439959
[keypoolsize] => 101
[paytxfee] => 0.00000000
[mininput] => 0.00001000
[errors] =>
)
)
Sample ‘getmininginfo’ API request:
Sample ‘getmininginfo’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[blocks] => 10587
[currentblocksize] => 0
[currentblocktx] => 0
[difficulty] => 62.45401651
[errors] =>
[generate] =>
[genproclimit] => -1
[hashespersec] => 0
[networkhashps] => 336112204
[pooledtx] => 0
[testnet] =>
)
)
Sample ‘getdifficulty’ API request:
Sample ‘getdifficulty’ API response:
Array
(
[status] => 1
[message] =>
[data] => 62.45401651
)
Sample ‘getnetworkhashps’ API request:
Sample ‘getnetworkhashps’ API response:
Array
(
[status] => 1
[message] =>
[data] => 336112204
)
Sample ‘getpeerinfo’ API request:
Sample ‘getpeerinfo’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[0] => Array
(
[addr] => 198.50.217.13:57992
[services] => 00000003
[lastsend] => 1440091304
[lastrecv] => 1440091304
[bytessent] => 3012
[bytesrecv] => 690
[blocksrequested] => 0
[conntime] => 1440091304
[version] => 70002
[subver] => /Satoshi:1.0.0.5/
[inbound] => 1
[startingheight] => 10587
[banscore] => 0
[syncnode] => 1
)
[1] => Array
(
[addr] => 109.155.79.53:4319
[services] => 00000003
[lastsend] => 1440091305
[lastrecv] => 1440091306
[bytessent] => 229
[bytesrecv] => 2425
[blocksrequested] => 0
[conntime] => 1440091305
[version] => 70002
[subver] => /Satoshi:1.0.0.5/
[inbound] =>
[startingheight] => 10587
[banscore] => 0
)
)
)
The following API methods return information about the MindCoin block chain as provided by the block explorer node.
Response data is not cached at this time.
Sample ‘getblockcount’ API request:
Sample ‘getblockcount’ API response:
Array
(
[status] => 1
[message] =>
[data] => 10587
)
Sample ‘getblockhash’ API request:
Sample ‘getblockhash’ API response:
Array
(
[status] => 1
[message] =>
[data] => 68dd2aa055ff44a977cbfeac0aee86d73dc0f81578a3a9ffb5b808d89179a5f6
)
Sample ‘getbestblockhash’ API request:
Sample ‘getbestblockhash’ API response:
Array
(
[status] => 1
[message] =>
[data] => 68dd2aa055ff44a977cbfeac0aee86d73dc0f81578a3a9ffb5b808d89179a5f6
)
Sample ‘getblock’ API request:
Sample ‘getblock’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[hash] => fae203fca989aeedf3efb85f75e8e88080b3cd9dfdd93b68d583fdabfb2c3047
[confirmations] => 1
[size] => 431
[height] => 10587
[version] => 2
[merkleroot] => 26c0e4a07ef9ffa66641f856a8a0e6b9d889cec8041b3833d4d3bf2a373bf19e
[tx] => Array
(
[0] => 919dab2189d1efd72b16b5378af39ae79c17be2f0919a0629dad3eec48388397
[1] => 9d4c4256679c09f1e983ed2f10bae07e1aa5bc520d6d03ff91104d74788295eb
)
[time] => 1440090430
[nonce] => 17024140
[bits] => 1c041955
[difficulty] => 62.45401651
[previousblockhash] => ee30b72368a1f63bc4989fd798f29f41e95b46f105e2ce37b06ec393a32229a6
)
)
Sample ‘gettransaction’ API request:
Sample ‘gettransaction’ API response:
Array
(
[status] => 1
[message] =>
[data] => Array
(
[hex] => 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff26025b29062f503253482f046009d6550877fffffecf2600000d2f6e6f64655374726174756d2f000000000100a2941a1d0000001976a9145067bf5c5f124ba4d02275ae4dbdb2fd4ea8186d88ac00000000
[txid] => 919dab2189d1efd72b16b5378af39ae79c17be2f0919a0629dad3eec48388397
[version] => 1
[locktime] => 0
[vin] => Array
(
[0] => Array
(
[coinbase] => 025b29062f503253482f046009d6550877fffffecf2600000d2f6e6f64655374726174756d2f
[sequence] => 0
)
)
[vout] => Array
(
[0] => Array
(
[value] => 1250.00000000
[n] => 0
[scriptPubKey] => Array
(
[asm] => OP_DUP OP_HASh360 5067bf5c5f124ba4d02275ae4dbdb2fd4ea8186d OP_EQUALVERIFY OP_CHECKSIG
[hex] => 76a9145067bf5c5f124ba4d02275ae4dbdb2fd4ea8186d88ac
[reqSigs] => 1
[type] => pubkeyhash
[addresses] => Array
(
[0] => 59iBBwF2p329DLU8MJiNuJFFVvff48fxT8
)
)
)
)
[blockhash] => fae203fca989aeedf3efb85f75e8e88080b3cd9dfdd93b68d583fdabfb2c3047
[confirmations] => 1
[time] => 1440090430
[blocktime] => 1440090430
)
)
The SPECTRA Address API allows users to verify addresses and balance information.
Sample ‘isaddress’ API Request:
Sample ‘isaddress’ API Response:
Array
(
[status] => 1
[message] =>
[data] => Address Exists
)
Sample ‘getbalance’ API Request:
Sample ‘getbalance’ API Response:
Array
(
[status] => 1
[message] =>
[data] => 300000000.00000000
)
Sample ‘verifymessage’ API Request:
Sample ‘verifymessage’ API Response:
Array
(
[status] => 1
[message] =>
[data] => true
)
Sample ‘moneysupply’ API Request:
Sample ‘moneysupply’ API Response:
Array
(
[status] => 1
[message] =>
[data] => 189689.67282100
)