API Documentation
Authentication
The Meerkat API uses API keys to authenticate requests. We authenticate requests through the Authorization header in your HTTP request. All requests must be made over HTTPS or they will fail.
Add the following header to your request:
Authorization: ApiKey <your api token>
Example Request:
fetch(url, {
method: "POST",
headers: {
"Authorization": "ApiKey <your api token>",
}
})
Address Subscription
To create an address subscription, you need to provide a currency type, callback URL, and address. Whenever an inbound or outbound transaction occurs, the provided callback URL will be called with the transaction details.
Create Address Subscription
Body Attributes
currency
The following are accepted currencies:
BTC
,LTC
,DOGE
,ETH
,ERC20ALL
,ERC20:<contract address>
. Please noteETH
is exclusive of ERC-20 addresses.address
A checksummed address. Addresses without a valid checksum will result in an error response.
callback
A valid callback URL that accepts a
POST
request. This is the URL that our server will send push notifications to subsequent to address activity.
Response
subscription_id
A unique ID which can be used to delete the subscription.
Example Request:
fetch('meerkat.watch/api/v0/enterprise/subscribe/address', {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "ApiKey <your api token>"
},
body: JSON.stringify({
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"currency": "BTC",
"callback": "https://example.com/addressActivity/satoshi"
})
})
Curl:
curl -XPOST 'https://meerkat.watch/api/v0/enterprise/subscribe/address' \
-H 'Authorization: ApiKey <your api token>' \
-H "Content-type: application/json" \
-d '{"address":"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa","currency":"BTC","callback":"https://example.com/addressActivity/satoshi"}'
Example Response:
"<subscription id>"
Address Delete Subscription
Use the subscription_id
obtained from the Create Address Subscription request to delete the subscription.
Example Request:
fetch('meerkat.watch/api/v0/enterprise/unsubscribe/address/<subscription_id>', {
method: "DELETE",
headers: {
"Authorization": "ApiKey <your api token>",
"Content-Type": "application/json",
}
})
Curl:
curl -X DELETE 'https://meerkat.watch/api/v0/enterprise/unsubscribe/address/<subscription_id>' \
-H 'Authorization: ApiKey <subscription_id>' \
-H 'Content-type: application/json'
Response
204 - No Content
Address Webhook
A WebHook is just a push notification from our server to yours. The callback URL set up in Create Address Subscription pushes a notification to your server every time a transaction occurs that involves the provided address.
Body Attributes
timestamp
UTC time of event.
currency
One of
BTC
,LTC
,DOGE
,ETH
,ERC20:<contract address>
. Please noteETH
is exclusive of ERC-20 addresses.type
One of
sent
orreceived
.address
The subscribed address.
amount
The amount of the transaction. This has been serialized as a string to prevent javascript from using a double when deserializing.
txid
Transaction ID
event
One of
detected
,mined
,confirmed
,dropped
,uncled
, orevicted
.isGas
ETH only: if the entirety of this event is a gas payment for a contract call.
blockHeight
Height of the block that the transaction was mined in (only for
mined
orconfirmed
).risk
Not used.
error
ETH/ERC20 only: an EVM exception thrown or where event logs not produced.
confirmedBalance
Confirmed balance for address.
null
unless event is confirmed.inputs
Addresses of UTXOs used as inputs to this transactions.
outputs
Addresses of UTXOs that were outputs from this transaction.
erc20Data
ERC20 only
Example Webhook Body:
{
"timestamp": "2019-01-2019T10:13:46Z",
"currency": "ERC20:0x4156D3342D5c385a87D264F90653733592000581",
"type": "received",
"address": "0xFb71DaA0c206Bb86eDb8AF3EC6a1E6caeADC1c5B",
"amount": "0.00000000",
"txid": "0xfb71daa0c206bb86edb8af3ec6a1e6caeadc1c5b6c7f77fc0b216b80391e8e73",
"event": "confirmed",
"isGas": false,
"risk": 0.0,
"blockHeight": 7000000,
"error": "EVM Exception",
"confirmedBalance": "0.00000000",
"inputs": ["0xF966785800AD69912378933d673f4d33f8E45a84"],
"outputs": ["0xFb71DaA0c206Bb86eDb8AF3EC6a1E6caeADC1c5B"],
"erc20Data": {
"contractAddress": "0x4156D3342D5c385a87D264F90653733592000581",
"ticker": "SALT",
"decimals": 8
}
}
Transaction Subscription
To create a transaction subscription, you need to provide a currency type, callback URL, and txid. The callback URL will be hit everytime the txid progresses through one of the following states: detected
, mined
, confirmed
, dropped
, uncled
, or evicted
.
Create Transaction Subscription
Request Body
currency
The following are accepted currencies:
BTC
,LTC
,DOGE
,ETH
,ERC20: <contract address>
. Please noteETH
is exclusive of ERC-20 addresses.txid
Transaction ID
callback
A valid callback URL that accepts a
POST
request. This is the URL that our server will send push notifications to on transaction status changes.
Response
subscription_id
A unique ID which can be used to delete the subscription.
Example Request:
fetch('meerkat.watch/api/v0/enterprise/subscribe/transaction', {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "ApiKey <your api token>"
},
body: JSON.stringify({
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"currency": "BTC",
"callback": "https://example.com/txUpdate/1234"
})
})
Curl:
curl -XPOST 'https://meerkat.watch/api/v0/enterprise/subscribe/transaction' \
-H 'Authorization: ApiKey <your api token>' \
-H "Content-type: application/json" \
-d '{"txid":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","currency":"BTC","callback":"https://example.com/txUpdate/1234"}'
Example Response:
"<subscription id>"
Delete Transaction Subscription
Use the subscription_id
obtained from the Create transaction Subscription request to delete the subscription.
Example Request:
fetch('meerkat.watch/api/v0/enterprise/unsubscribe/transaction/<subscription id>', {
method: "DELETE",
headers: {
"Authorization": "ApiKey <your api token>",
}
})
Curl:
curl -X DELETE 'https://meerkat.watch/api/v0/enterprise/unsubscribe/transaction/<subscription_id>' \
-H 'Authorization: ApiKey <your api token>' \
-H 'Content-type: application/json'
Response
204 - No Content
Transaction Webhook
A WebHook is just a push notification from our server to yours. The callback URL set up in Create Transaction Subscription pushes a notification to your server every time the status of the transaction changes.
Body Attributes
timestamp
UTC time of event.
currency
One of
BTC
,LTC
,DOGE
,ETH
,ERC20:<contract address>
. Please noteETH
is exclusive of ERC-20 addresses.txid
Transaction ID
event
One of
detected
,mined
,confirmed
,dropped
,uncled
, orevicted
.blockHeight
Height of the block that the transaction was mined in (only for
mined
orconfirmed
).error
ETH/ERC20 only: an EVM exception thrown or where event logs not produced.
Example Webhook Body:
{
"timestamp": "2009-01-03T18:15:05Z",
"currency": "BTC",
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"event": "mined",
"blockHeight": 0,
"error": null
}