NeoScan vdev Neoscan.Api

Main API for accessing data from the explorer. All data is provided through GET requests in /api/main_net/v1. Testnet isn’t currently available.

Link to this section Summary

Functions

Returns the address model from its hash_string

Returns all working nodes and their respective heights. Information is updated each 5 minutes

Returns asset model from its hash_string

Returns registered assets in the chain

Returns the balance for an address from its hash_string

Returns the block model from its hash_string or height

Returns the AVAILABLE claimable transactions for an address, from its hash_string

Returns the claimed transactions for an address, from its hash_string

Returns the the total of spent fees in the network between a height range

Returns the blockchain current height, as determined by the majority of working nodes

Returns the highest block model in the chain

Returns the last 20 block models

Returns the last 20 transaction models in the chain for the selected type. If no type is provided, returns all types

Returns nodes with the majority of block heigh value

Returns the transaction model through its hash_string

Returns the unclaimed gas for an address from its hash_string

Link to this section Functions

Link to this function get_address(hash)

Returns the address model from its hash_string

Examples

/api/main_net/v1/get_address/{hash_string}
{
  "txids": [
    {
      "txid": "tx_id_string",
      "balance": "balance_object_snapshot"
    },
    ...
  ],
  "claimed": [
    {
      "txids": [
        "tx_id_string",
        "tx_id_string",
        "tx_id_string",
        ...
      ],
      "asset": "name_string",
      "amount": "float",
    },
    ...
  ],
  "balance": [
    {
      "asset": "name_string",
      "amount": float,
      "unspent": [
        {
          "txid": "tx_id_string",
          "value": float,
          "n": integer
        },
        ..
      ]
    }
    ...
  ],
  "address": "hash_string"
}
Link to this function get_all_nodes()

Returns all working nodes and their respective heights. Information is updated each 5 minutes.

Currrent tested nodes are:

http://seed1.cityofzion.io:8080 http://seed2.cityofzion.io:8080 http://seed3.cityofzion.io:8080 http://seed4.cityofzion.io:8080 http://seed5.cityofzion.io:8080 http://api.otcgo.cn:10332 http://seed1.neo.org:10332 http://seed2.neo.org:10332 http://seed3.neo.org:10332 http://seed4.neo.org:10332 http://seed5.neo.org:10332

Examples

/api/main_net/v1/get_all_nodes
      [
        {
          "url": "http://seed1.cityofzion.io:8080",
    "height": 1239778
  },
  ...
]
Link to this function get_asset(hash)

Returns asset model from its hash_string

Examples

/api/main_net/v1/get_asset/{hash_string}
{
  "type": "type_string",
  "txid": "tx_id_string",
  "precision": integer,
  "owner": "hash_string",
  "name": [
    {
      "name": "name_string",
      "lang": "language_code_string"
    },
    ...
  ],
  "issued": float,
  "amount": float,
  "admin": "hash_string"
}

Returns registered assets in the chain

Examples

/api/main_net/v1/get_assets
[
  {
    "type": "type_string",
    "txid": "tx_id_string",
    "precision": integer,
    "owner": "hash_string",
    "name": [
      {
        "name": "name_string",
        "lang": "language_code_string"
      },
      ...
    ],
    "issued": float,
    "amount": float,
    "admin": "hash_string"
  },
  ...
]
Link to this function get_balance(hash)

Returns the balance for an address from its hash_string

Examples

/api/main_net/v1/get_balance/{hash_string}
{
  "balance": [
    {
      "asset": "name_string",
      "amount": float,
      "unspent": [
        {
          "txid": "tx_id_string",
          "value": float,
          "n": integer
        },
        ...
      ]
    }
    ...
  ],
  "unclaimed": float,
  "address": "hash_string"
}
Link to this function get_block(hash_or_integer)

Returns the block model from its hash_string or height

Examples

/api/main_net/v1/get_block/{hash_string}
/api/main_net/v1/get_block/{height}
{
  "version": integer,
  "tx_count": integer,
  "transactions": [
    "tx_id_string",
    ...
  ],
  "time": unix_time,
  "size": integer,
  "script": {
    "verification": "hash_string",
    "invocation": "hash_string"
  },
  "previousblockhash": "hash_string",
  "nonce": "hash_string",
  "nextconsensus": "hash_string",
  "nextblockhash": "hash_string",
  "merkleroot": "hash_string",
  "index": integer,
  "hash": "hash_string",
  "confirmations": integer
}
Link to this function get_claimable(hash)

Returns the AVAILABLE claimable transactions for an address, from its hash_string.

Examples

/api/main_net/v1/get_claimable/{hash_string}
{
  "claimable": [
    {
      "txid": "tx_id_string",
      "n": integer,
      "value": float,
      "unclaimed": float,
      "start_height": integer,
      "end_height": integer
    },
    ...
  ],
  "address": "hash_string"
}
Link to this function get_claimed(hash)

Returns the claimed transactions for an address, from its hash_string.

Examples

/api/main_net/v1/get_claimed/{hash_string}
{
  "claimed": [
    {
      "txids": [
        "tx_id_string",
        "tx_id_string",
        "tx_id_string",
        ...
      ],
      "asset": "name_string",
      "amount": "float",
    },
    ...
  ],
  "address": "hash_string"
}
Link to this function get_fees_in_range(height_string)

Returns the the total of spent fees in the network between a height range

Examples

/api/main_net/v1/get_fees_in_range/500-1000
{
  "total_sys_fee": 0,
  "total_net_fee": 0
}

Returns the blockchain current height, as determined by the majority of working nodes.

Examples

/api/main_net/v1/get_height
{
  "height": 1239809
}
Link to this function get_highest_block()

Returns the highest block model in the chain

Examples

/api/main_net/v1/get_highest_block
{
  "version": integer,
  "tx_count": integer,
  "transactions": [
    "tx_id_string",
    ...
  ],
  "time": unix_time,
  "size": integer,
  "script": {
    "verification": "hash_string",
    "invocation": "hash_string"
  },
  "previousblockhash": "hash_string",
  "nonce": "hash_string",
  "nextconsensus": "hash_string",
  "nextblockhash": "hash_string",
  "merkleroot": "hash_string",
  "index": integer,
  "hash": "hash_string",
  "confirmations": integer
}
Link to this function get_last_blocks()

Returns the last 20 block models

Examples

/api/main_net/v1/get_last_blocks

[

  {
    "version": integer,
    "tx_count": integer,
    "transactions": [
      "tx_id_string",
      ...
    ],
    "time": unix_time,
    "size": integer,
    "script": {
      "verification": "hash_string",
      "invocation": "hash_string"
    },
    "previousblockhash": "hash_string",
    "nonce": "hash_string",
    "nextconsensus": "hash_string",
    "nextblockhash": "hash_string",
    "merkleroot": "hash_string",
    "index": integer,
    "hash": "hash_string",
    "confirmations": integer
  },
  ...
]
Link to this function get_last_transactions(type)

Returns the last 20 transaction models in the chain for the selected type. If no type is provided, returns all types

Examples

/api/main_net/v1/get_last_transactions/{type}
/api/main_net/v1/get_last_transactions
[{
    "vouts": [
      {
        "value": float,
        "n": integer,
        "asset": "name_string",
        "address": "hash_string"
      },
      ...
    ],
    "vin": [
      {
        "value": float,
        "txid": "tx_id_string",
        "n": integer,
        "asset": "name_string",
        "address_hash": "hash_string"
      },
      ...
    ],
    "version": integer,
    "type": "type_string",
    "txid": "tx_id_string",
    "time": unix_time,
    "sys_fee": "string",
    "size": integer,
    "scripts": [
      {
        "verification": "hash_string",
        "invocation": "hash_string"
      }
    ],
    "pubkey": hash_string,
    "nonce": integer,
    "net_fee": "string",
    "description": string,
    "contract": array,
    "claims": array,
    "block_height": integer,
    "block_hash": "hash_string",
    "attributes": array,
    "asset": array
  },
  ...
]

Returns nodes with the majority of block heigh value.

Examples

/api/main_net/v1/get_nodes
{
  "urls": [
    "http://seed1.cityofzion.io: 8080",
    ....
  ]
}
Link to this function get_transaction(hash)

Returns the transaction model through its hash_string

Examples

/api/main_net/v1/get_transaction/{hash_string}
{
  "vouts": [
    {
      "value": float,
      "n": integer,
      "asset": "name_string",
      "address": "hash_string"
    },
    ...
  ],
  "vin": [
    {
      "value": float,
      "txid": "tx_id_string",
      "n": integer,
      "asset": "name_string",
      "address_hash": "hash_string"
    },
    ...
  ],
  "version": integer,
  "type": "type_string",
  "txid": "tx_id_string",
  "time": unix_time,
  "sys_fee": "string",
  "size": integer,
  "scripts": [
    {
      "verification": "hash_string",
      "invocation": "hash_string"
    }
  ],
  "pubkey": hash_string,
  "nonce": integer,
  "net_fee": "string",
  "description": string,
  "contract": array,
  "claims": array,
  "block_height": integer,
  "block_hash": "hash_string",
  "attributes": array,
  "asset": array
}
Link to this function get_unclaimed(hash)

Returns the unclaimed gas for an address from its hash_string

Examples

/api/main_net/v1/get_unclaimed/{hash_string}
{
  "unclaimed": float,
  "address": "hash_string"
}