NOTICE: A better block explorer with more information is now available at XChain.io.
All traffic to this website will be redirected to xchain.io starting January 1st, 2018.
API Introduction

The CounterpartyChain API supports requesting Counterparty information via requests to https://counterpartychain.io/api.

Address APIs

https://counterpartychain.io/api/address/{address}
https://counterpartychain.io/api/balances/{address}
https://counterpartychain.io/api/burns/{address}
https://counterpartychain.io/api/broadcasts/{address}
https://counterpartychain.io/api/issuances/{address}
https://counterpartychain.io/api/sends/{address}

Asset APIs

https://counterpartychain.io/api/assets
https://counterpartychain.io/api/asset/{asset}
https://counterpartychain.io/api/holders/{asset}
https://counterpartychain.io/api/issuances/{asset}
https://counterpartychain.io/api/sends/{asset}

Block APIs

https://counterpartychain.io/api/block/{block_number}
https://counterpartychain.io/api/burns/{block_number}
https://counterpartychain.io/api/broadcasts/{block_number}
https://counterpartychain.io/api/issuances/{block_number}
https://counterpartychain.io/api/sends/{block_number}

Broadcast APIs

https://counterpartychain.io/api/broadcasts

Send APIs

https://counterpartychain.io/api/sends

Transaction APIs

https://counterpartychain.io/api/transaction/{transaction_hash}     
Additional Features / Limits

Data is returned in the JSON format

By default the number of records returned is limited to 100, or to 500 where appropriate in order to keep transactions small and fast.

The API supports paging and by default returns 1 page worth of data. Users can request additional pages of data, and customize how many records are returned via 'page' and 'count' variables.

The API also supports wrapping results in a custom envelope by appending ?wrapper=results to any API request.

The API also supports returning JSONP requests by appending ?callback=callback_function to any API request.

Examples

To handle assets with more than 100 sends, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/sends/{asset}/{page}

To get sends 101-200 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/2

To get sends 201-300 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/sends/{asset}/{page}/{count}

To get transactions 1-20 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/1/20

To get transactions 21-40 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/2/20

To return results wrapped in a custom "results" envelope :

URL: https://counterpartychain.io/api/sends/{asset}/2/20?wrapper=results

To return JSONP results contained in a custom function :

URL: https://counterpartychain.io/api/sends/{asset}/2/20?callback=callback_function

Get address info

Returns summary information for an address

URL: https://counterpartychain.io/api/address/{address}

Response on success

{
  "success": 1,
  "assets_held": 12,
  "assets_owned": 3,
  "btc_burned": "0.00000000",
  "xcp_earned": "0.00000000",
  "xcp_balance": "1.57553628"
}

Response on failure

{
    "success": 0,
    "error": "Invalid address"
}
Get address balances

Returns asset balance information for an address (alphabetically by asset)

URL: https://counterpartychain.io/api/balances/{address}

Response on success

{
    "success": 1,
    "total": 4,
    "data": [
        {
            "asset": "LENTERACOIN",
            "amount": "25000.00000000"
        },
        {
            "asset": "LTBCOIN",
            "amount": "492.96674468"
        },
        {
            "asset": "ONESATOSHI",
            "amount": "0.00000009"
        },
        {
            "asset": "SPONSORLTB",
            "amount": "16"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid address"
}
Additional Features / Limits

The maximum number of asset balances returned in any single request is 500.

To handle addresses with more than 500 assets, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/balances/{address}/{page}

To get assets 501-1000 you would request :

URL: https://counterpartychain.io/api/balances/{address}/2

To get assets 1001-1500 you would request :

URL: https://counterpartychain.io/api/balances/{address}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/balances/{address}/{page}/{count}

To get assets 1-20 you would request :

URL: https://counterpartychain.io/api/balances/{address}/1/20

To get assets 21-40 you would request :

URL: https://counterpartychain.io/api/balances/{address}/2/20

Get address broadcasts

Returns broadcast information for an address

URL: https://counterpartychain.io/api/broadcasts/{address}

Response on success

{
    "success": 1,
    "total": "2",
    "data": [
        {
            "block": 338512,
            "fee": "0.00000000",
            "locked": 0,
            "source": "1FYNF2KZCH7HhhedRb9dXUf4cMG5PGgePQ",
            "status": "valid",
            "text": "http://www.opidoki.com/broadcasts/10",
            "time": "1420992280",
            "tx_hash": "78a9275fd1657c92dc2192a8dbb734d1aedf404f17b9c3944b3ea3d9b1151d9b",
            "value": "123.45"
        },
        {
            "block": 338512,
            "fee": "0.00000000",
            "locked": 0,
            "source": "1FYNF2KZCH7HhhedRb9dXUf4cMG5PGgePQ",
            "status": "valid",
            "text": "http://www.opidoki.com/broadcasts/10",
            "time": "1420992280",
            "tx_hash": "61a1759d94e661cac6b9c6f43e4d00e0202daf52f2754e7caa90f4685d64d286",
            "value": "0"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Additional Features / Limits

The maximum number of broadcasts returned in any single request is 100.

To handle blocks with more than 100 broadcasts, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/broadcasts/{address}/{page}

To get broadcasts 101-200 you would request :

URL: https://counterpartychain.io/api/broadcasts/{address}/2

To get broadcasts 201-300 you would request :

URL: https://counterpartychain.io/api/broadcasts/{address}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/broadcasts/{address}/{page}/{count}

To get broadcasts 1-20 you would request :

URL: https://counterpartychain.io/api/broadcasts/{address}/1/20

To get broadcasts 21-40 you would request :

URL: https://counterpartychain.io/api/broadcasts/{address}/2/20

Get address burns

Returns burn information for an address (newest first)

URL: https://counterpartychain.io/api/burns/{address}

Response on success

{
    "success": 1,
    "total": "3",
    "data": [
        {
            "block": "278435",
            "burned": "0.79950000",
            "earned": "1190.16477273",
            "status": "valid",
            "time": "1388759225",
            "tx_hash": "bbc429b74c78a5bd550e21c57a4c88cd8f6e85875b7ac6eb99e1a805684dca0b"
        },
        {
            "block": "278344",
            "burned": "0.20000000",
            "earned": "299.38181818",
            "status": "valid",
            "time": "1388713387",
            "tx_hash": "7c2b1ca03cfaf07139c7264745665baa4bc14641fb32277e305f8fe6556d1cd7"
        },
        {
            "block": "278319",
            "burned": "0.00050000",
            "earned": "0.74959091",
            "status": "valid",
            "time": "1388701177",
            "tx_hash": "685623401c3f5e9d2eaaf0657a50454e56a270ee7630d409e98d3bc257560098"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid address"
}
Additional Features / Limits

The maximum number of burns returned in any single request is 100.

To handle addresses with more than 100 burns, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/burns/{address}/{page}

To get burns 101-200 you would request :

URL: https://counterpartychain.io/api/burns/{address}/2

To get burns 201-300 you would request :

URL: https://counterpartychain.io/api/burns/{address}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/burns/{address}/{page}/{count}

To get burns 1-20 you would request :

URL: https://counterpartychain.io/api/burns/{address}/1/20

To get burns 21-40 you would request :

URL: https://counterpartychain.io/api/burns/{address}/2/20

Get address issuances

Returns issuance information for an address (newest first)

URL: https://counterpartychain.io/api/issuances/{address}

Response on success

{
    "success": 1,
    "total": "2",
    "data": [
        {
            "block": "332680",
            "description": "The GEMS Mobile App",
            "divisible": 1,
            "fee": "0.00000000",
            "issuer": "1FUWt93FcNtWv2sqhGVK81QVgaGgPUaYis",
            "locked": 1,
            "quantity": "0.00000000",
            "source": "1FUWt93FcNtWv2sqhGVK81QVgaGgPUaYis",
            "time": "1417598356",
            "transfer": 0,
            "tx_id": "db95e537de22cb70e59dcbbedcc844f293336d238b35787842894ff53c8a83db"
        },
        {
            "block": "329992",
            "description": "The GEMS Mobile App",
            "divisible": 1,
            "fee": "0.00000000",
            "issuer": "1FUWt93FcNtWv2sqhGVK81QVgaGgPUaYis",
            "locked": 1,
            "quantity": "0.00000000",
            "source": "1FUWt93FcNtWv2sqhGVK81QVgaGgPUaYis",
            "time": "1415978962",
            "transfer": 0,
            "tx_id": "443554c5c69d139f27d91df383af7ae62831128b2ade83f776c7b915aaec6395"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid asset"
}
Additional Features / Limits

The maximum number of asset issuances returned in any single request is 100.

To handle assets with more than 100 issuances, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/issuances/{address}/{page}

To get asset issuances 101-200 you would request :

URL: https://counterpartychain.io/api/issuances/{address}/2

To get asset issuances 201-300 you would request :

URL: https://counterpartychain.io/api/issuances/{address}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/issuances/{address}/{page}/{count}

To get asset issuances 1-20 you would request :

URL: https://counterpartychain.io/api/issuances/{address}/1/20

To get asset issuances 21-40 you would request :

URL: https://counterpartychain.io/api/issuances/{address}/2/20

Get address sends

Returns send information for an address (newest first)

URL: https://counterpartychain.io/api/sends/{address}

Response on success

{
    "success": 1,
    "total": 2,
    "data": [
        {
            "address": "1Po1oXMCWobE6kxWr8rJEP1SRq71JSD3t4",
            "asset": "GEMZ",
            "block": 338420,
            "quantity": "-4498.27499999",
            "status": "valid",
            "time": 1420939079,
            "tx_hash": "7feebc294206fdc75607a5452fdaf48c9a4846844f2fbd201c44aec9adef4243"
        },
        {
            "address": "1PrCDMYtt7RSLfhMjRogA9iuASKk17z7nZ",
            "asset": "GEMZ",
            "block": 338416,
            "quantity": "+4498.27500000",
            "status": "valid",
            "time": 1420937075,
            "tx_hash": "69452a507dbed6ff2fe03f3fbfe2ffdd4d2c6e38664f894bee1529535dc7e5b1"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid address",
}
Additional Features / Limits

The maximum number of sends returned in any single request is 100.

To handle addresses with more than 100 sends, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/sends/{address}/{page}

To get sends 101-200 you would request :

URL: https://counterpartychain.io/api/sends/{address}/2

To get sends 201-300 you would request :

URL: https://counterpartychain.io/api/sends/{address}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/sends/{address}/{page}/{count}

To get sends 1-20 you would request :

URL: https://counterpartychain.io/api/sends/{address}/1/20

To get sends 21-40 you would request :

URL: https://counterpartychain.io/api/sends/{address}/2/20

Get latest assets

Returns list of the most recently created assets (newest first)

URL: https://counterpartychain.io/api/assets

Response on success

{
    "success": 1,
    "total": "7309",
    "data": [
        {
            "asset": "GREENSTOX",
            "block": 339101,
            "description": "Green Stox Investment fund",
            "divisible": 0,
            "fee": "0.50000000",
            "issuer": "18kXbKUPQVmy73dnNJNhttYcELVJX14gGs",
            "locked": 0,
            "owner": "18kXbKUPQVmy73dnNJNhttYcELVJX14gGs",
            "supply": "200000000",
            "time": 1421352628,
            "tx_hash": "2c07a696cd837be4c950cc28b67494fce377556fdccd8c1ac5b4a1a08595dc9f"
        },
        {
            "asset": "A18249590011831691000",
            "block": 339072,
            "description": "Green Stox",
            "divisible": 0,
            "fee": "0.00000000",
            "issuer": "18kXbKUPQVmy73dnNJNhttYcELVJX14gGs",
            "locked": 0,
            "owner": "18kXbKUPQVmy73dnNJNhttYcELVJX14gGs",
            "supply": "100000000",
            "time": 1421337829,
            "tx_hash": "2afd957135608fc210e3af1a5c07692a28d6d87663ea99dc7c3a64dac738dfe8"
        }
    ]
}

Response on failure

{
    "success": 0
}
Additional Features / Limits

The maximum number of assets returned in any single request is 100.

To handle more than 100 assets, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/assets/{page}

To get assets 101-200 you would request :

URL: https://counterpartychain.io/api/assets/2

To get assets 201-300 you would request :

URL: https://counterpartychain.io/api/assets/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/assets/{page}/{count}

To get assets 1-20 you would request :

URL: https://counterpartychain.io/api/assets/{address}/1/20

To get assets 21-40 you would request :

URL: https://counterpartychain.io/api/assets/{address}/2/20

Get asset info

Returns summary information for an asset

URL: https://counterpartychain.io/api/asset/{asset}

Response on success

{
    "success": 1,
    "asset": "LTBCOIN",
    "description": "Crypto-Rewards Program http://ltbcoin.com",
    "divisible": 1,
    "holders": "3723",
    "issuances": "32",
    "issuer": "1Hso4cqKAyx9bsan8b5nbPqMTNNce8ZDto",
    "locked": 0,
    "owner": "1Hso4cqKAyx9bsan8b5nbPqMTNNce8ZDto",
    "supply": "220572656.84990001",
    "transactions": "40620"
}

Response on failure

{
    "success": 0,
    "error": "Invalid asset"
}
Get asset holders

Returns holder information for an asset (largest holders first)

URL: https://counterpartychain.io/api/holders/{asset}

Response on success

{
    "success": 1,
    "total": "3723",
    "data": [
        {
            "address": "1MCEtBB5X4ercRsvq2GmgysZ9ZDsqj8Xh7",
            "amount": "30755215.74834045",
            "percent": "13.94334918"
        },
        {
            "address": "1CyR361naf4voYfkb8J3Pv8CbgUFhUHqJW",
            "amount": "15045901.32388009",
            "percent": "6.82129034"
        },
        {
            "address": "1Po1oXMCWobE6kxWr8rJEP1SRq71JSD3t4",
            "amount": "12674314.05415588",
            "percent": "5.74609484"
        },
        {
            "address": "195mgT1wj3QotjSbEJDFoSehqNJFSBTGE7",
            "amount": "8499812.68969645",
            "percent": "3.85352056"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid asset"
}
Additional Features / Limits

The maximum number of asset holders returned in any single request is 100.

To handle assets with more than 100 holders, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/holders/{asset}/{page}

To get asset holders 101-200 you would request :

URL: https://counterpartychain.io/api/holders/{asset}/2

To get asset holders 201-300 you would request :

URL: https://counterpartychain.io/api/holders/{asset}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/holders/{asset}/{page}/{count}

To get asset holders 1-20 you would request :

URL: https://counterpartychain.io/api/holders/{asset}/1/20

To get asset holders 21-40 you would request :

URL: https://counterpartychain.io/api/holders/{asset}/2/20

Get asset issuances

Returns issuance information for an asset (newest first)

URL: https://counterpartychain.io/api/issuances/{asset}

Response on success

{
    "success": 1,
    "total": 6,
    "data": [
        {
            "block": 354710,
            "callable": 0,
            "call_date": 0,
            "call_price": 0,
            "description": ""
            "divisible": 1,
            "fee": "0.00000000",
            "issuer": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "locked": 0,
            "quantity": "10.00000000",
            "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "time": 1409635240,
            "transfer": 0,
            "tx_hash": "e86d14bb32dfcb9fa4dc58f358b82520d842c12e020fd96cd0c029100e8b276c"
        },{
            "block": 354707,
            "callable": 1,
            "call_date": 1410543259,
            "call_price": "0.00000013",
            "description": "flying reptiles!"
            "divisible": 0,
            "fee": "0.50000000",
            "issuer": "D9VoRkcDgDkZdaiz9mjH1e33nHcKoExSdG",
            "locked": 0,
            "quantity": "970000.00000000",
            "source": "D9VoRkcDgDkZdaiz9mjH1e33nHcKoExSdG",
            "time": 1409635240,
            "transfer": 0,
            "tx_hash": "4c94b9e0f4700f486f93c3dfab3c03e170c9754ef2efa1777ff275b4d8769cb0"
        } 
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid asset"
}
Additional Features / Limits

The maximum number of asset issuances returned in any single request is 100.

To handle assets with more than 100 issuances, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/issuances/{asset}/{page}

To get asset issuances 101-200 you would request :

URL: https://counterpartychain.io/api/issuances/{asset}/2

To get asset issuances 201-300 you would request :

URL: https://counterpartychain.io/api/issuances/{asset}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/issuances/{asset}/{page}/{count}

To get asset issuances 1-20 you would request :

URL: https://counterpartychain.io/api/issuances/{asset}/1/20

To get asset issuances 21-40 you would request :

URL: https://counterpartychain.io/api/issuances/{asset}/2/20

Get asset sends

Returns sends information for an asset (newest first)

URL: https://counterpartychain.io/api/sends/{asset}

Response on success

{
    "success": 1,
    "total": 222,
    "data": [
        {
            "block": 359777,
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "2000.00000000",
            "source": "DMcnc3vEDjQVahjL2eHKKYRpFr4u1vXBzB"
            "status": "valid",
            "time": 1409635240,
            "tx_hash": "6fff0e65cc9a919a94bfc351e5640aa7997f0a410956c7596ce405fd1e7df25b"
        },{
            "block": 359773,
            "time": 1409635258,
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "1.00000000",
            "address": "DSCpCZi3mbArZ4r6dz4BtbekfwB475hJGb"
            "status": "valid",
            "tx_hash": "51d131fe088e7b19537ad3c845fe0cafc18c10968b1f201e9ef003771bb6af29"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid address"
}
Additional Features / Limits

The maximum number of sends returned in any single request is 100.

To handle assets with more than 100 sends, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/sends/{asset}/{page}

To get sends 101-200 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/2

To get sends 201-300 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/sends/{asset}/{page}/{count}

To get sends 1-20 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/1/20

To get sends 21-40 you would request :

URL: https://counterpartychain.io/api/sends/{asset}/2/20

Get latest transactions

Returns latest mempool information

URL: https://counterpartychain.io/api/mempool

Response on success

{
    "success": 1,
    "total": 1,
    "data": [
        {
            "type": "send",
            "asset": "SJCX",
            "quantity": "1000.00000000",
            "source": "1HpnQApHeungLx8Kj5bR2XwBtA3By26CRQ",
            "destination": "1N3TURzXbiWWinS593oUJHFXgB4HiDPqZT",
            "tx_hash": "ed9a03b79d5a21b1c31c81bb3c875141c1b67a29359bc301ae8f32f43c8a67a5"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Error looking up mempool"
}
Additional Features / Limits

The maximum number of mempool transactions returned in any single request is 100.

To handle more than 100 transactions, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/mempool/{page}

To get mempool transactions 101-200 you would request :

URL: https://counterpartychain.io/api/mempool/2

To get mempool transactions 201-300 you would request :

URL: https://counterpartychain.io/api/mempool/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/mempool/{page}/{count}

To get mempool transactions 1-20 you would request :

URL: https://counterpartychain.io/api/mempool/1/20

To get mempool transactions 21-40 you would request :

URL: https://counterpartychain.io/api/mempool/2/20

Get block info

Returns summary information for a block

URL: https://counterpartychain.io/api/block/{block_number}

Response on success

{
    "success": 1,
    "broadcasts": 0,
    "burns": 0,
    "chainwork": "000000000000000000000000000000000000000000000000124deeb4ddd97cb8",
    "hash": "374abe2ef4262f644f3e960318fefa890bd264386502a59037ae3a1e4d64fae6"
    "issuances": 2,
    "merkleroot": "f5a078b2bf4a6713813f1018fa25eef45bb772e42b99481aee9bebe300c2b812",
    "size": 15440,
    "time": 1409635240,
    "transactions": 0,
    "txs": [
        "483a6d80a12d6127c4c75db34428472f4e2abcf32c9c695cd6dc7e880e2cb7ca",
        "c886a2f871282416d91244324554b659816f28d409e62abc7bd76012ac981fca"]
    ]

}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Get block burns

Returns burn information for a block

URL: https://counterpartychain.io/api/burns/{block_number}

Response on success

{
    "success": 1,
    "total": 2,
    "data": [
        {
            "address": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "burned": "145000.00000000",
            "earned": "180.94791667",
            "status": "Valid",
            "time": 1409467774,
            "tx_hash": "87bcfc9f07dbe35d495e48c8fdb16c615cc435b5671136e9f7fc7b5b9872bb12"
        },{
            "address": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "burned": "119000.00000000",
            "earned": "161.33865741",
            "status": "Valid",
            "time": 1408822388,
            "tx_hash": "e149206fe9205b4bafe72fd1c6c5944c8ae291d05cc04a0034c5e055c277bd0a"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Additional Features / Limits

The maximum number of burns returned in any single request is 100.

To handle blocks with more than 100 burns, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/burns/{block_number}/{page}

To get burns 101-200 you would request :

URL: https://counterpartychain.io/api/burns/{block_number}/2

To get burns 201-300 you would request :

URL: https://counterpartychain.io/api/burns/{block_number}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/burns/{block_number}/{page}/{count}

To get burns 1-20 you would request :

URL: https://counterpartychain.io/api/burns/{block_number}/1/20

To get burns 21-40 you would request :

URL: https://counterpartychain.io/api/burns/{block_number}/2/20

Get block broadcasts

Returns broadcast information for a block

URL: https://counterpartychain.io/api/broadcasts/{block_number}

Response on success

{
    "success": 1,
    "total": 2,
    "data": [
        {
            "fee": "0.01000000",
            "locked": 0,
            "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "status": "valid",
            "text": "Testing stuff",
            "time": 1409467774,
            "tx_hash": "87bcfc9f07dbe35d495e48c8fdb16c615cc435b5671136e9f7fc7b5b9872bb12",
            "value": "123.45"
        },{
            "fee": "0.00001000",
            "locked": 0,
            "source": "DHLTxVS1XZ3KeVhLocRWYd9E9WAmosUsrb",
            "status": "valid",
            "text": "Bitcoin hits 1000$ on Bitstamp in 2014",
            "time": 1409454293,
            "tx_hash": "0ed5230b4c9f63ae6291974499df2110481bb4fe8f8d648aac4964767c502950",
            "value": "0"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Additional Features / Limits

The maximum number of broadcasts returned in any single request is 100.

To handle blocks with more than 100 broadcasts, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/broadcasts/{block_number}/{page}

To get broadcasts 101-200 you would request :

URL: https://counterpartychain.io/api/broadcasts/{block_number}/2

To get broadcasts 201-300 you would request :

URL: https://counterpartychain.io/api/broadcasts/{block_number}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/broadcasts/{block_number}/{page}/{count}

To get broadcasts 1-20 you would request :

URL: https://counterpartychain.io/api/broadcasts/{block_number}/1/20

To get broadcasts 21-40 you would request :

URL: https://counterpartychain.io/api/broadcasts/{block_number}/2/20

Get block issuances

Returns issuance information for a block

URL: https://counterpartychain.io/api/issuances/{block_number}

Response on success

{
    "success": 1,
    "total": 6,
    "data": [
        {
            "asset": "BACON",
            "callable": 0,
            "call_date": 0,
            "call_price": 0,
            "description": "Buy bacon with your tokens!"
            "divisible": 1,
            "fee": "0.00000000",
            "issuer": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "locked": 0,
            "quantity": "500000.00000000",
            "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "time": 1409631235,
            "transfer": 0,
            "tx_hash": "e86d14bb32dfcb9fa4dc58f358b82520d842c12e020fd96cd0c029100e8b276c"
        },{
            "asset": "PTERODACTYL",
            "callable": 1,
            "call_date": 1410543259,
            "call_price": "0.00000013",
            "description": "flying reptiles!"
            "divisible": 0,
            "fee": "0.50000000",
            "issuer": "D9VoRkcDgDkZdaiz9mjH1e33nHcKoExSdG",
            "locked": 0,
            "quantity": "970000.00000000",
            "source": "D9VoRkcDgDkZdaiz9mjH1e33nHcKoExSdG",
            "time": 1409635240,
            "transfer": 0,
            "tx_hash": "4c94b9e0f4700f486f93c3dfab3c03e170c9754ef2efa1777ff275b4d8769cb0"
        } 
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Additional Features / Limits

The maximum number of block issuances returned in any single request is 100.

To handle blocks with more than 100 issuances, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/issuances/{block_number}/{page}

To get asset issuances 101-200 you would request :

URL: https://counterpartychain.io/api/issuances/{block_number}/2

To get asset issuances 201-300 you would request :

URL: https://counterpartychain.io/api/issuances/{block_number}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/issuances/{block_number}/{page}/{count}

To get asset issuances 1-20 you would request :

URL: https://counterpartychain.io/api/issuances/{block_number}/1/20

To get asset issuances 21-40 you would request :

URL: https://counterpartychain.io/api/issuances/{block_number}/2/20

Get block sends

Returns sends information for a block

URL: https://counterpartychain.io/api/sends/{block_number}

Response on success

{
    "success": 1,
    "total": 222,
    "data": [
        {
            "asset": "BACON",
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "2000.00000000",
            "source": "DMcnc3vEDjQVahjL2eHKKYRpFr4u1vXBzB"
            "status": "valid",
            "time": 1409635240,
            "tx_hash": "6fff0e65cc9a919a94bfc351e5640aa7997f0a410956c7596ce405fd1e7df25b"
        },{
            "asset": "PTERODACTYL",
            "time": 1409635258,
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "1.00000000",
            "address": "DSCpCZi3mbArZ4r6dz4BtbekfwB475hJGb"
            "status": "valid",
            "tx_hash": "51d131fe088e7b19537ad3c845fe0cafc18c10968b1f201e9ef003771bb6af29"
        }
    ]
}

Response on failure

{
    "success": 0,
    "error": "Invalid block"
}
Additional Features / Limits

The maximum number of sends returned in any single request is 100.

To handle blocks with more than 100 sends, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/sends/{block_number}/{page}

To get sends 101-200 you would request :

URL: https://counterpartychain.io/api/sends/{block_number}/2

To get sends 201-300 you would request :

URL: https://counterpartychain.io/api/sends/{block_number}/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/sends/{block_number}/{page}/{count}

To get sends 1-20 you would request :

URL: https://counterpartychain.io/api/sends/{block_number}/1/20

To get sends 21-40 you would request :

URL: https://counterpartychain.io/api/sends/{block_number}/2/20

Get latest broadcasts

Returns latest broadcast information (newest first)

URL: https://counterpartychain.io/api/broadcasts

Response on success

{
    "success": 1,
    "total": 100,
    "data": [
        {
            "block": 354710,
            "fee": "0.01000000",
            "locked": 0,
            "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
            "status": "valid",
            "text": "Testing stuff",
            "time": 1409467774,
            "tx_hash": "87bcfc9f07dbe35d495e48c8fdb16c615cc435b5671136e9f7fc7b5b9872bb12",
            "value": "123.45"
        },{
            "block": 354707,
            "fee": "0.00001000",
            "locked": 0,
            "source": "DHLTxVS1XZ3KeVhLocRWYd9E9WAmosUsrb",
            "status": "valid",
            "text": "Bitcoin hits 1000$ on Bitstamp in 2014",
            "time": 1409454293,
            "tx_hash": "0ed5230b4c9f63ae6291974499df2110481bb4fe8f8d648aac4964767c502950",
            "value": "0"
        }
    ]
}

Response on failure

{
    "success": 0
}
Additional Features / Limits

The maximum number of broadcasts returned in any single request is 100.

To handle more than 100 broadcasts, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/broadcasts/{page}

To get broadcasts 101-200 you would request :

URL: https://counterpartychain.io/api/broadcasts/2

To get broadcasts 201-300 you would request :

URL: https://counterpartychain.io/api/broadcasts/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/broadcasts/{page}/{count}

To get broadcasts 1-20 you would request :

URL: https://counterpartychain.io/api/broadcasts/1/20

To get broadcasts 21-40 you would request :

URL: https://counterpartychain.io/api/broadcasts/2/20

Get latest sends

Returns latest sends information

URL: https://counterpartychain.io/api/sends

Response on success

{
    "success": 1,
    "total": 222,
    "data": [
        {
            "asset": "BACON",
            "block": 354710,
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "2000.00000000",
            "source": "DMcnc3vEDjQVahjL2eHKKYRpFr4u1vXBzB"
            "status": "valid",
            "time": 1409635240,
            "tx_hash": "6fff0e65cc9a919a94bfc351e5640aa7997f0a410956c7596ce405fd1e7df25b"
        },{
            "asset": "PTERODACTYL",
            "block": 354707,
            "time": 1409635258,
            "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
            "quantity": "1.00000000",
            "address": "DSCpCZi3mbArZ4r6dz4BtbekfwB475hJGb"
            "status": "valid",
            "tx_hash": "51d131fe088e7b19537ad3c845fe0cafc18c10968b1f201e9ef003771bb6af29"
        }
    ]
}

Response on failure

{
    "success": 0
}
Additional Features / Limits

The maximum number of sends returned in any single request is 100.

To handle more than 100 sends, additional data can be requested in the following format.

URL: https://counterpartychain.io/api/sends/{page}

To get sends 101-200 you would request :

URL: https://counterpartychain.io/api/sends/2

To get sends 201-300 you would request :

URL: https://counterpartychain.io/api/sends/3

Additionally, you can specify a count of how many records to return to the request in the following format.

URL: https://counterpartychain.io/api/sends/{page}/{count}

To get sends 1-20 you would request :

URL: https://counterpartychain.io/api/sends/1/20

To get sends 21-40 you would request :

URL: https://counterpartychain.io/api/sends/2/20

Get transaction info

Returns transaction information

URL: https://counterpartychain.io/api/transaction/{transaction_hash}

The response returned will depend on what type of transaction it is.

Response on success - Broadcast Transaction

{
    "success": 1,
    "block": 354710,
    "fee": "0.01000000",
    "locked": 0,
    "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
    "status": "valid",
    "text": "Testing stuff",
    "time": 1409467774,
    "type": "Broadcast"
}

Response on success - Burn Transaction

{
    "success": 1,
    "address": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
    "block": 354710,
    "burned": "145000.00000000",
    "earned": "180.94791667",
    "status": "valid",
    "time": 1409635240,
    "type": "Burn"
}

Response on success - Issuance Transaction

{
    "asset": "BACON",
    "block": 354710,
    "callable": 0,
    "call_date": 0,
    "call_price": 0,
    "description": "Buy bacon with your tokens!"
    "divisible": 1,
    "fee": "0.00000000",
    "issuer": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
    "locked": 0,
    "quantity": "500000.00000000",
    "source": "DNxSmbRW5zgKcxPwJi5NrAwSS7LVr2U3dp",
    "status": "valid",
    "time": 1409631235,
    "transfer": 0,
    "type": "Issuance"
}

Response on success - Send Transaction

{
    "success": 1,    
    "asset": "BACON",
    "block": 354710,
    "destination": "DPBQpyBSYAzuV7zJFnx9ZZgja37uxD1jvq"
    "quantity": "2000.00000000",
    "source": "DMcnc3vEDjQVahjL2eHKKYRpFr4u1vXBzB"
    "status": "valid",
    "time": 1409635240,
    "type": "Send"
}

Response on failure

{
    "success": 0,
    "error": "Invalid transaction"
}
Javascript Example
Results
Asset Balance
HTML Code
<div class="row" id="jsBalancesExample">
    <div class="col-xs-6">
        <form class="form-inline" role="form">
            <div class="form-group">
                <input type="text" class="form-control" id="jsBalancesExampleAddress" placeholder="Enter Counterparty Address" style="width:250px;">
            </div>
            <button type="button" class="btn btn-default" onClick="getBalances();">Fetch</button>
            <button type="button" class="btn btn-default" onClick="clearBalances();">Clear</button>
        </form>
    </div>
    <div class="col-xs-6">
        <table class="table table-bordered table-hover" id="jsBalancesExampleTable">
        <thead>
        <tr>
            <th>Asset</th>
            <th>Balance</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
        </table>
    </div>
</div>
Javascript Code
<script>
<!--
// Handle taking a Counterparty address and returning a list of assets
function getBalances(){
    var addr  = $('#jsBalancesExampleAddress').val()
        url   = "https://counterpartychain.io/api/balances/" + addr;
    // Get first page of results
    $.get( url, function( response ){ 
        if(response.data){
            // Update table with list of balances here
            // Addresses with more than 500 balances will require a bit more work... 
            // like a loop until you get all assets
            for(var i = 0; i<response.data.length; i++){
                var rec = response.data[i];
                $('#jsBalancesExampleTable tr:last').after('' + rec.asset + '' + rec.amount + '');
            }
          }
    }, "json" );
}
// Handle clearing asset balances
function clearBalances(){
    $("#jsBalancesExampleTable tr:gt(0)").remove();                  
}
-->
</script>