Skip to main content

BTC Ordinals Subscription

tokenviewAbout 4 min

BTC Ordinals Subscription

Tokenview Bitcoin Ordinals subscription tracks the minting, buying and selling of inscriptions on the Bitcoin chain.

Modes of Subscription:

  • Subscribe to the Bitcoin address
    When an Inscription transaction occurs on the Bitcoin address, the transaction information is pushed as Json to the Webhook URL you set up.
  • Subscribe to the Inscription ID
    When the Inscription transaction changes, the transaction information is pushed to the Webhook URL in Json.

Format of Pushing Message:
Tokenview will post the transaction info to you webhook URL in Json format. The response code must be 200, as well as the the response body must return non-empty text information, such as "ok". If it fails to post the info, it will automatically retry 3 times.

Notifications will push with Json as follow:

{
    "address": "bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem", // Monitored objects
    "block": 804910,
    "input": "124dc8dd8b013dd29023ab0274b1bad7213d24b11e7319586a5d7489c6b40c3a:0",
    "inputAddr": "bc1p454g0l8c7ahq9qv6dspcefqm2tcm2d2l5a6sfj7m2vxf73cx8rfqwqf6rp",
    "inscriptionId": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9bi0",
    "inscriptionInfo":
    {
        "content": "{\"p\":\"brc-20\",\"op\":\"mint\",\"tick\":\"text\",\"amt\":\"1000\"}",
        "contentLength": "53 bytes",
        "contentLink": "/content/ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9bi0",
        "contentType": "text/plain;charset=utf-8",
        "createdTime": "2023-08-26 09:17:10 UTC",
        "genesisHeight": 804910,   // The height of the block when creating the inscription
        "genesisTransaction": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9b",
        "inscriptionId": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9bi0",
        "inscriptionNum": 26621314,
        "location": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9b:0:0",
        "output": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9b:0",
        "outputValue": 546,
        "ownerAddress": "bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem"
    },
    "isGenesis": 1, // 1: create, 0: transfer
    "msgType": "address-s",
    "network": "BTC",
    "output": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9b:0",
    "outputAddr": "bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem",
    "outputValue": 546,
    "satIndex": 0,
    "time": "1693041430000",
    "txHash": "ee615327bb32de543805ff3ad0768fb104c7cb995c6430ba2e8f8688d133ef9b",
    "txType": "Mint"
}

Steps of subscription:

  • Set the webhook url;
  • Add subscription objects according to the subscription method;
  • Receive push messages.

Set webhook URL

POST https://services.tokenview.io/vipapi/nftmonitor/setwebhookurl?apikey={apikey}

Parameters

Request

curl -X POST -H 'content-type:text/plain' -d '{your_webhook_url}'
'https://services.tokenview.io/vipapi/nftmonitor/setwebhookurl?apikey={apikey}'

Response

{
    "code": 1,
    "msg": "success",
    "data": null
}

Get webhook URL

GET https://services.tokenview.io/vipapi/nftmonitor/getwebhookurl?apikey={apikey}

Parameters

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/getwebhookurl?apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": "https://9aa90255-9cde-453e-83a6-2916cd2c3725.mock.pstmn.io/webhook"
}

Add A Bitcoin Address

GET https://services.tokenview.io/vipapi/nftmonitor/address/add/{lowercase-coin-abbr}/{address}?apikey={apikey}

Parameters

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/add/btc/1P8ibjHnyXsQSxV1dtLBQ2RJkhiNfFiRUM?apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": null
}

Delete A Bitcoin Address

GET https://services.tokenview.io/vipapi/nftmonitor/address/remove/{lowercase-coin-abbr}/{address}?apikey={apikey}

Parameters

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/remove/btc/1P8ibjHnyXsQSxV1dtLBQ2RJkhiNfFiRUM?apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": null
}

Check Tracked Bitcoin Address List

GET https://services.tokenview.io/vipapi/nftmonitor/address/list/{lowercase-coin-abbr}?page={page}apikey={apikey}

Parameters

Remark:

Specify the lowercase-coin-abbr and page.

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/list/btc?page=1&apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": {
        "page": 1,
        "size": 1,
        "total": 1,
        "list": [
            "1P8ibjHnyXsQSxV1dtLBQ2RJkhiNfFiRUM"
        ]
    }
}

Add Inscription ID

GET https://services.tokenview.io/vipapi/nftmonitor/address/add/{lowercase-coin-abbr}/{inscription-id}?apikey={apikey}

Parameters

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/add/btc/03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0?apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": null
}

Check Tracked Inscription ID

GET https://services.tokenview.io/vipapi/nftmonitor/address/list/{lowercase-coin-abbr}?page={page}&apikey={apikey}

Parameters

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/list/btc?page=1&apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": {
        "page": 1,
        "size": 2,
        "total": 2,
        "list": [
            "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0",
            "fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0"
        ]
    }
}

Delete Inscription ID

GET https://services.tokenview.io/vipapi/nftmonitor/address/remove/{lowercase-coin-abbr}/{inscription-id}?apikey={apikey}

Parameters

Remark:

Specify the lowercase-coin-abbr

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/address/remove/btc/fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0?apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": null
}

Webhook Historical Notification

GET https://services.tokenview.io/vipapi/nftmonitor/webhookhistory/{lowercase-coin-abbr}?page={page}apikey={apikey}

Parameters

Note:

  • Specify the currency name and page number.

  • Return all the historical notifications for all addresses of one kind currency.

  • 100 records for per page.

Request

curl --location https://services.tokenview.io/vipapi/nftmonitor/webhookhistory/btc?page=1&apikey={apikey}

Response

{
    "code": 1,
    "msg": "success",
    "data": {
        "page": 1,
        "size": 4,
        "total": 4,
        "list": [
            {
                "coin": "BTC",
                "height": 804861,
                "time": 1693015705000,
                "txid": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1",
                "address": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0",
                "tryTimes": 0,
                "url": "your webhook url",
                "statusCode": 200,
                "request": "{\"address\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"block\":804861,\"input\":\"ef6fc0136455ee77e36e90e127e9324189cb76341d1ca198ad3145b4cc64dfcb:0\",\"inputAddr\":\"bc1p9zq4yvvnk27cyrxyu704pp4sk26zrfqq0d2jtlhcpyuh65taw29ssdq5t9\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionInfo\":{\"content\":\"{\\\"p\\\":\\\"brc-20\\\",\\\"op\\\":\\\"mint\\\",\\\"tick\\\":\\\"text\\\",\\\"amt\\\":\\\"1000\\\"}\",\"contentLength\":\"53 bytes\",\"contentLink\":\"/content/03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"contentType\":\"text/plain;charset=utf-8\",\"createdTime\":\"2023-08-26 02:08:25 UTC\",\"genesisHeight\":804861,\"genesisTransaction\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionNum\":26478855,\"location\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0:0\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputValue\":546,\"ownerAddress\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\"},\"isGenesis\":1,\"msgType\":\"token\",\"network\":\"BTC\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputAddr\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\",\"outputValue\":546,\"satIndex\":0,\"time\":\"1693015705000\",\"txHash\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"txType\":\"Mint\"}",
                "response": "OK"
            },
            {
                "coin": "BTC",
                "height": 806459,
                "time": 1693998473000,
                "txid": "fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4",
                "address": "fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0",
                "tryTimes": 0,
                "url": "your webhook url",
                "statusCode": 200,
                "request": "{\"address\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0\",\"block\":806459,\"input\":\"e229bf616dcacee9055a320f2afc8cb5b72037c2646e1f27eef43a51617f7109:383\",\"inputAddr\":\"bc1pca730qw2v8k70p84kq4cp43pkxrth526xjjjrgxe28hg6dmea5zqwpps5t\",\"inscriptionId\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0\",\"inscriptionInfo\":{\"content\":\"{\\\"p\\\":\\\"brc-20\\\",\\\"op\\\":\\\"mint\\\",\\\"tick\\\":\\\"sats\\\",\\\"amt\\\":\\\"99999999\\\"}\",\"contentLength\":\"57 bytes\",\"contentLink\":\"/content/fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0\",\"contentType\":\"text/plain\",\"createdTime\":\"2023-09-06 11:07:53 UTC\",\"genesisHeight\":806459,\"genesisTransaction\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4\",\"inscriptionId\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4i0\",\"inscriptionNum\":29258991,\"location\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4:0:0\",\"output\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4:0\",\"outputValue\":294,\"ownerAddress\":\"bc1qzlgrd9pge2tlhh2m2he6cqwsr7uxczrewtml3l\"},\"isGenesis\":1,\"msgType\":\"token\",\"network\":\"BTC\",\"output\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4:0\",\"outputAddr\":\"bc1qzlgrd9pge2tlhh2m2he6cqwsr7uxczrewtml3l\",\"outputValue\":294,\"satIndex\":0,\"time\":\"1693998473000\",\"txHash\":\"fffeb85701d3230af46e86f20c7f498388af4a6a030185d4be29bea118cfbbe4\",\"txType\":\"Mint\"}",
                "response": "OK"
            },
            {
                "coin": "BTC",
                "height": 804861,
                "time": 1693015705000,
                "txid": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1",
                "address": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0",
                "tryTimes": 0,
                "url": "your webhook url",
                "statusCode": 200,
                "request": "{\"address\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"block\":804861,\"input\":\"ef6fc0136455ee77e36e90e127e9324189cb76341d1ca198ad3145b4cc64dfcb:0\",\"inputAddr\":\"bc1p9zq4yvvnk27cyrxyu704pp4sk26zrfqq0d2jtlhcpyuh65taw29ssdq5t9\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionInfo\":{\"content\":\"{\\\"p\\\":\\\"brc-20\\\",\\\"op\\\":\\\"mint\\\",\\\"tick\\\":\\\"text\\\",\\\"amt\\\":\\\"1000\\\"}\",\"contentLength\":\"53 bytes\",\"contentLink\":\"/content/03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"contentType\":\"text/plain;charset=utf-8\",\"createdTime\":\"2023-08-26 02:08:25 UTC\",\"genesisHeight\":804861,\"genesisTransaction\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionNum\":26478855,\"location\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0:0\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputValue\":546,\"ownerAddress\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\"},\"isGenesis\":1,\"msgType\":\"token\",\"network\":\"BTC\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputAddr\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\",\"outputValue\":546,\"satIndex\":0,\"time\":\"1693015705000\",\"txHash\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"txType\":\"Mint\"}",
                "response": "OK"
            },
            {
                "coin": "BTC",
                "height": 804861,
                "time": 1693015705000,
                "txid": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1",
                "address": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0",
                "tryTimes": 0,
                "url": "your webhook url",
                "statusCode": 200,
                "request": "{\"address\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"block\":804861,\"input\":\"ef6fc0136455ee77e36e90e127e9324189cb76341d1ca198ad3145b4cc64dfcb:0\",\"inputAddr\":\"bc1p9zq4yvvnk27cyrxyu704pp4sk26zrfqq0d2jtlhcpyuh65taw29ssdq5t9\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionInfo\":{\"content\":\"{\\\"p\\\":\\\"brc-20\\\",\\\"op\\\":\\\"mint\\\",\\\"tick\\\":\\\"text\\\",\\\"amt\\\":\\\"1000\\\"}\",\"contentLength\":\"53 bytes\",\"contentLink\":\"/content/03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"contentType\":\"text/plain;charset=utf-8\",\"createdTime\":\"2023-08-26 02:08:25 UTC\",\"genesisHeight\":804861,\"genesisTransaction\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionNum\":26478855,\"location\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0:0\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputValue\":546,\"ownerAddress\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\"},\"isGenesis\":1,\"msgType\":\"token\",\"network\":\"BTC\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputAddr\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\",\"outputValue\":546,\"satIndex\":0,\"time\":\"1693015705000\",\"txHash\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"txType\":\"Mint\"}",
                "response": "OK"
            }
        ]
    }
}

Response Description

{
    "coin": "BTC",
    "height": 804861, // block height
    "time": 1693015705000, // block time
    "txid": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1",
    "address": "03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0", // Monitored objects
    "tryTimes": 0,
    "url": "your webhook url",
    "statusCode": 200, // status code
    "request": "{\"address\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"block\":804861,\"input\":\"ef6fc0136455ee77e36e90e127e9324189cb76341d1ca198ad3145b4cc64dfcb:0\",\"inputAddr\":\"bc1p9zq4yvvnk27cyrxyu704pp4sk26zrfqq0d2jtlhcpyuh65taw29ssdq5t9\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionInfo\":{\"content\":\"{\\\"p\\\":\\\"brc-20\\\",\\\"op\\\":\\\"mint\\\",\\\"tick\\\":\\\"text\\\",\\\"amt\\\":\\\"1000\\\"}\",\"contentLength\":\"53 bytes\",\"contentLink\":\"/content/03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"contentType\":\"text/plain;charset=utf-8\",\"createdTime\":\"2023-08-26 02:08:25 UTC\",\"genesisHeight\":804861,\"genesisTransaction\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"inscriptionId\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1i0\",\"inscriptionNum\":26478855,\"location\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0:0\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputValue\":546,\"ownerAddress\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\"},\"isGenesis\":1,\"msgType\":\"token\",\"network\":\"BTC\",\"output\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1:0\",\"outputAddr\":\"bc1pcks69jup7te4k8h006sxv6v47qyhpkuy9cznj8avlz3yq8ssszxs5r6aem\",\"outputValue\":546,\"satIndex\":0,\"time\":\"1693015705000\",\"txHash\":\"03770a3edd7a899390aefdfd7eab69c20034c4f5619896ccef64732f33b54ce1\",\"txType\":\"Mint\"}", //发给监控对象的内容
    "response": "OK"
}

Last update: