Transactions

Get transaction info

Returns transaction info of a given transaction hash.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=gettxinfo
   &txhash=0x4a92f997fa11357e7dbd07161844d3518bb1bdc980ba6cbc571fe0bf69dc07e3
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

txhash*

hash of contents of the transaction

Sample response

{
    "status":"1",
    "message":"OK",
    "result": {
        "baseFeePerGas":"32235322240",
        "blockHash":"0x7d81377abfa115565cd537df1a5873fca616f531292ff000d24083265590aa06",
        "blockNumber":"18541319",
        "burntFee":"1431957484545280",
        "confirmations":"1349776",
        "contractAddress":null,
        "cumulativeGasUsed":"6769329",
        "decoded":{
            "method_call":"transfer(address _to, uint256 _value)",
            "method_id":"0xa9059cbb",
            "parameters":[
                { 
                    "name":"_to",
                    "type":"address",
                    "value":"0xdc58e6ad03fa3c21c2f68105af3954411d17ad8e"
                },
                {
                    "name":"_value",
                    "type":"uint256",
                    "value":"109246000000000000000"
                }
            ]
        },
        "fee":"1520801484545280",
        "from":"0x28c6c06298d514db089934071355e5743bf21d60",
        "functionName":"transfer(address _to, uint256 _value)",
        "gas":"207128",
        "gasPrice":"34235322240",
        "gasUsed":"44422",
        "hash":"0x4a92f997fa11357e7dbd07161844d3518bb1bdc980ba6cbc571fe0bf69dc07e3",
        "input":"0xa9059cbb000000000000000000000000dc58e6ad03fa3c21c2f68105af3954411d17ad8e000000000000000000000000000000000000000000000005ec17c2309c530000",
        "isError":"0",
        "maxFeePerGas":"102000000000",
        "maxPriorityFeePerGas":"2000000000",
        "methodId":"0xa9059cbb",
        "nonce":"8181556",
        "priorityFee":"88844000000000",
        "receiptStatus":"1",
        "revertReason":null,
        "savingsFee":"3010242515454720",
        "timeStamp":"1699616555",
        "to":"0x767fe9edc9e0df98e07454847909b5e959d7ca0e",
        "transactionIndex":"48",
        "type":"2",
        "value":"0"
    }
}

Get info for multiple transactions in a single call

Returns transaction info from a list of transaction hashes (maximum of 20 transactions per call).

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=gettxinfomulti
   &txhash=0x4a92f997fa11357e7dbd07161844d3518bb1bdc980ba6cbc571fe0bf69dc07e3,0x5dec7ada7783358a086fa6dc5558730aabc0ef9ae7d101d8bee0b305f14acf4f
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

txhash*

the strings representing the hash to check for balance, separated by ,

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        {
            "blockHash":"0x7d81377abfa115565cd537df1a5873fca616f531292ff000d24083265590aa06",
            "blockNumber":"18541319",
            "confirmations":"0",
            "contractAddress":null,
            "cumulativeGasUsed":"6769329",
            "decoded":{
                "method_call":"transfer(address _to, uint256 _value)",
                "method_id":"0xa9059cbb",
                "parameters":[
                    {
                        "name":"_to",
                        "type":"address",
                        "value":"0xdc58e6ad03fa3c21c2f68105af3954411d17ad8e"
                    },
                    {
                        "name":"_value",
                        "type":"uint256",
                        "value":"109246000000000000000"
                    }
                ]
            },
            "from":"0x28c6c06298d514db089934071355e5743bf21d60",
            "functionName":"transfer(address _to, uint256 _value)",
            "gas":"207128",
            "gasPrice":"34235322240",
            "gasUsed":"44422",
            "hash":"0x4a92f997fa11357e7dbd07161844d3518bb1bdc980ba6cbc571fe0bf69dc07e3",
            "input":"0xa9059cbb000000000000000000000000dc58e6ad03fa3c21c2f68105af3954411d17ad8e000000000000000000000000000000000000000000000005ec17c2309c530000",
            "isError":"0",
            "methodId":"0xa9059cbb",
            "nonce":"8181556",
            "receiptStatus":"1",
            "revertReason":null,
            "timeStamp":"1699616555",
            "to":"0x767fe9edc9e0df98e07454847909b5e959d7ca0e",
            "transactionIndex":"48",
            "type":"2",
            "value":"0"
        },
        {
            "blockHash":"0xf32703a186311b0b3cd6d86d84ef40fd786b56b047809852dbd0f39ff4791413",
            "blockNumber":"18541318",
            "confirmations":"1",
            "contractAddress":null,
            "cumulativeGasUsed":"10756744",
            "decoded":{
                "method_call":"transfer(address _to, uint256 _value)",
                "method_id":"0xa9059cbb",
                "parameters":[
                    {
                        "name":"_to",
                        "type":"address",
                        "value":"0x4204da9f1a730c117120b8fdc54819ad5133e075"
                    },
                    {
                        "name":"_value",
                        "type":"uint256",
                        "value":"213436115000000000000"
                    }
                ]
            },
            "from":"0xc7c4fb19346430e3abba193c3da13c44d5742afe",
            "functionName":"transfer(address _to, uint256 _value)",
            "gas":"66651",
            "gasPrice":"33201333958",
            "gasUsed":"39634",
            "hash":"0x5dec7ada7783358a086fa6dc5558730aabc0ef9ae7d101d8bee0b305f14acf4f",
            "input":"0xa9059cbb0000000000000000000000004204da9f1a730c117120b8fdc54819ad5133e07500000000000000000000000000000000000000000000000b920567c26e6c3000",
            "isError":"0",
            "methodId":"0xa9059cbb",
            "nonce":"16",
            "receiptStatus":"1",
            "revertReason":null,
            "timeStamp":"1699616543",
            "to":"0x767fe9edc9e0df98e07454847909b5e959d7ca0e",
            "transactionIndex":"116",
            "type":"2",
            "value":"0"
        }
    ]
}

Get the total number of confirmed transactions

Returns the total number of confirmed transactions.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=gettotaltxcount
   &apikey=YourApiKeyToken

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "308227"
}

Get pending transactions

Returns a list of pending transactions.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=pendingtxlist
   &offset=0
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
   "status": "1",
   "message": "OK",
   "result": [
        {
            "blockHash": null,
            "blockNumber": null,
            "confirmations": "0",
            "contractAddress": null,
            "cumulativeGasUsed": null,
            "from": "0x7d30eb9ce37f8218a56c1ec51a917ce5b52b4ae9",
            "gas": "26000",
            "gasPrice": "50000000000",
            "gasUsed": null,
            "hash": "0x31711cbd640d4036f91d1f2c9e78914fc159d21514e8a8b9d6ae19d73ed9f2ce",
            "input": "0x",
            "isError": "0",
            "methodId": null,
            "functionName": null,
            "nonce": "41686",
            "receiptStatus": "2",
            "revertReason": null,
            "timeStamp": null,
            "to": "0x0000000000000000000000000000000000000000",
            "transactionIndex": null,
            "type": "0",
            "value": "1693473528430625"
        }
    ]
}

Get the number of pending transactions

Returns the number of pending transactions.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=pendingtxcount
   &apikey=YourApiKeyToken

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "1"
}

Get a list of 'normal' transactions

Returns the list of 'normal' transactions.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=txlist
   &startblock=18541318
   &endblock=18541319
   &offset=10
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

startblock

the integer block number to start searching for transactions, default value is 0

endblock

the integer block number to stop searching for transactions, default value is 1'000'000'000

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        {
            "blockHash":"0x7d81377abfa115565cd537df1a5873fca616f531292ff000d24083265590aa06",
            "blockNumber":"18541319",
            "confirmations":"0",
            "contractAddress":null,
            "cumulativeGasUsed":"6769329",
            "decoded":{
                "method_call":"transfer(address _to, uint256 _value)",
                "method_id":"0xa9059cbb",
                "parameters":[
                    {
                        "name":"_to",
                        "type":"address",
                        "value":"0xdc58e6ad03fa3c21c2f68105af3954411d17ad8e"
                    },
                    {
                        "name":"_value",
                        "type":"uint256",
                        "value":"109246000000000000000"
                    }
                ]
            },
            "from":"0x28c6c06298d514db089934071355e5743bf21d60",
            "functionName":"transfer(address _to, uint256 _value)",
            "gas":"207128",
            "gasPrice":"34235322240",
            "gasUsed":"44422",
            "hash":"0x4a92f997fa11357e7dbd07161844d3518bb1bdc980ba6cbc571fe0bf69dc07e3",
            "input":"0xa9059cbb000000000000000000000000dc58e6ad03fa3c21c2f68105af3954411d17ad8e000000000000000000000000000000000000000000000005ec17c2309c530000",
            "isError":"0",
            "methodId":"0xa9059cbb",
            "nonce":"8181556",
            "receiptStatus":"1",
            "revertReason":null,
            "timeStamp":"1699616555",
            "to":"0x767fe9edc9e0df98e07454847909b5e959d7ca0e",
            "transactionIndex":"48",
            "type":"2",
            "value":"0"
        },
        {
            "blockHash":"0xf32703a186311b0b3cd6d86d84ef40fd786b56b047809852dbd0f39ff4791413",
            "blockNumber":"18541318",
            "confirmations":"1",
            "contractAddress":null,
            "cumulativeGasUsed":"10756744",
            "decoded":{
                "method_call":"transfer(address _to, uint256 _value)",
                "method_id":"0xa9059cbb",
                "parameters":[
                    {
                        "name":"_to",
                        "type":"address",
                        "value":"0x4204da9f1a730c117120b8fdc54819ad5133e075"
                    },
                    {
                        "name":"_value",
                        "type":"uint256",
                        "value":"213436115000000000000"
                    }
                ]
            },
            "from":"0xc7c4fb19346430e3abba193c3da13c44d5742afe",
            "functionName":"transfer(address _to, uint256 _value)",
            "gas":"66651",
            "gasPrice":"33201333958",
            "gasUsed":"39634",
            "hash":"0x5dec7ada7783358a086fa6dc5558730aabc0ef9ae7d101d8bee0b305f14acf4f",
            "input":"0xa9059cbb0000000000000000000000004204da9f1a730c117120b8fdc54819ad5133e07500000000000000000000000000000000000000000000000b920567c26e6c3000",
            "isError":"0",
            "methodId":"0xa9059cbb",
            "nonce":"16",
            "receiptStatus":"1",
            "revertReason":null,
            "timeStamp":"1699616543",
            "to":"0x767fe9edc9e0df98e07454847909b5e959d7ca0e",
            "transactionIndex":"116",
            "type":"2",
            "value":"0"
        }
    ]
}

Get a list of 'internal' transactions by transaction hash

Returns the list of internal transactions performed within a transaction.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=txlistinternal
   &txhash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170
   &includezero=true
   &offset=10
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

txhash*

the string representing the transaction hash to check for internal transactions

includezero

the boolean flag (true or false) for including zero value internal transactions, default value is true

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status":"1",
    "message":"OK",
    "result": [
        {
            "blockNumber": "1743059",
            "timeStamp": "1466489498",
            "hash": "0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170",
            "index": "0",
            "transactionIndex": "0",
            "from": "0x2cac6e4b11d6b58f6d3c1c9d5fe8faa89f60e5a2",
            "to": "0x66a1c3eaf0f1ffc28d209c0763ed0ca614f3b002",
            "value": "7106740000000000",
            "contractAddress": "",
            "input": "",
            "type": "call",
            "callType": "call",
            "gas": "2300",
            "gasUsed": "0",
            "isError": "0",
            "errCode": null
        }
    ]
}

Get a list of 'internal' transactions by block range

Returns the list of internal transactions performed within block range.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=txlistinternal
   &startblock=1743059
   &endblock=1743059
   &offset=10
   &limit=10
   &sort=desc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

startblock*

the integer block number to start searching for transactions

endblock*

the integer block number to stop searching for transactions

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status":"1",
    "message":"OK",
    "result": [
        {
            "blockNumber": "1743059",
            "timeStamp": "1466489498",
            "hash": "0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170",
            "index": "0",
            "transactionIndex": "0",
            "from": "0x2cac6e4b11d6b58f6d3c1c9d5fe8faa89f60e5a2",
            "to": "0x66a1c3eaf0f1ffc28d209c0763ed0ca614f3b002",
            "value": "7106740000000000",
            "contractAddress": "",
            "input": "",
            "type": "call",
            "callType": "call",
            "gas": "2300",
            "gasUsed": "0",
            "isError": "0",
            "errCode": null
        }
    ]
}

Get a number of internal transaction for a transaction

Returns the number of internal transaction for a transaction by its hash.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=getinternaltxcount
   &txhash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170
   &includezero=true
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

txhash*

the string representing the transaction hash to check for internal transactions

includezero

the boolean flag (true or false) for including zero value internal transactions, default value is true

Sample response

{
   "status": "1",
   "message": "OK",
   "result": "1" 
}

Get a list of 'ERC20 - Token Transfer Events' by hash

Returns the list of ERC-20 tokens transferred by hash.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=tokentx
   &hash=0xe8c208398bd5ae8e4c237658580db56a2a94dfa0ca382c99b776fa6e7d31d5b4
   &offset=0
   &limit=10
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

hash*

the string representing the transaction hash

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        {
            "blockNumber":"4730207",
            "timeStamp":"1513240363",
            "hash":"0xe8c208398bd5ae8e4c237658580db56a2a94dfa0ca382c99b776fa6e7d31d5b4",
            "nonce":"406",
            "blockHash":"0x022c5e6a3d2487a8ccf8946a2ffb74938bf8e5c8a3f6d91b41c56378a96b5c37",
            "from":"0x642ae78fafbb8032da552d619ad43f1d81e4dd7c",
            "contractAddress":"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
            "to":"0x4e83362442b8d1bec281594cea3050c8eb01311c",
            "value":"5901522149285533025181",
            "tokenName":"Maker",
            "tokenSymbol":"MKR",
            "tokenDecimal":"18",
            "tokenPriceUSD": "1123.78",
            "transactionIndex":"81",
            "gas":"940000",
            "gasPrice":"32010000000",
            "gasUsed":"77759",
            "cumulativeGasUsed":"2523379",
            "input":"deprecated",
            "confirmations":"7968350"
        }
    ]
}

Get a number of 'ERC20 - Token Transfer Events' by hash

Returns the number of ERC-20 tokens transferred by hash.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=tokentxcount
   &hash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

hash*

the string representing the transaction hash

Sample response

{
   "status": "1",
   "message": "OK",
   "result": "1" 
}

Get a list of transactions by called contract method

Returns the list of transaction hashes by called contract method identifier, always sorted by block number in descending order.

Sample request

https://api.thespectre.io/api
   ?module=transaction
   &action=gettxsbymethod
   &methodid=0x3593564c
   &offset=0
   &limit=10
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

methodid*

the hex string representing the method id (4 bytes)

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        "0x0b7013c7a305e90677a15e5a79602089be8678161755ec4cbbe06c1790b5de26",
        "0x82de1d6dbe4455913b0db244fcc9f034cf3c274815bae702e95306cec8eda9a5",
        "0x4df490df16eecada33b569ec7854dee66f958ba4d5fe6d544d96df4ebe656eff",
        "0xe4013cd898ff4fb286c1411284d74ecf186bd536ccc146c4e820b134275c2fb9",
        "0xb92d782847ea2bbae288a2fef1ad2282c9b1798f57208a948d2d00ceeef02bfa",
        "0xf6f4af414177d08d21ea137dd54f89681b895d3c70ce7a7c8d4e6f73f58e8ad4",
        "0x2f20eea05eb73ba1fe732bc3cecf4ac612b212fd243d7268e3d25603f64367a3",
        "0xda1017688f28edb6bf31cdbd54730b31d5234c437cba2bbf093fa124e1c0d130",
        "0x5a1fd7a1d0bdc99e64ee1527bc42f4b525317568f29e7819a65ec4e30d02fda6",
        "0x56f9943b06851bb79bd2970367866d03ada9a6b99d17e0d285132e4666561bbe"
   ]
}

Last updated