CryptoTickers

Using CryptoTickers datasource you can create subscriptions for cryptocurrency price changes, discover currencies with growing market cap and much more.

Hooks Query Language lets you customize what data and when you want to receive based on CryptoTicker

Input Output Credits Freshness
CryptoTicker Coinmarketcap Real-time

What you can get from this API

  • Get an update when a cryptocurrency reaches some price point
  • Get an update when cryptocurrency price grows or falls by %
  • Get an update when cryptocurrency market cap reaches some value

How to Use

As every datasource at Hooks, you can choose to pull the data in your preferred format or to set up a webhook to receive the data when something happens.  

As we offer many datasources, we have developed a custom SQL-Like language (Hooks Query Language) to be able to query each datasource in the same format. To create a subscription the first thing you need to do is to define an HQL query and then send this query to create subscription endpoint.

CryptoTickers datasource has no mandatory parameters and you can use an optional WHERE clause to filter the output data (CryptoTicker) in order to receive just what you need. Hooks will then call your webhook once new data is available for your query. 

Step 1: Customize subscription

Hooks provide an elegant mechanism for creating subscriptions using Hooks Query Language. It has a similar notation to SQL and lets you define each subscription with a simple HQL query.

The following query will create a subscription to “Send me all the currencies that reach 18B market cap”:

SELECT * FROM CryptoTickers 
WHERE market_cap_usd >= 18000000000

Once this HQL query has new results – when a coin reaches 18B market cap – Hooks will send CryptoTicker object to your webhook:

{
    "matches_count": 4,
    "results": [
        {
            "24h_volume_usd": "10293900000.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_bitcoin_422008",
            "available_supply": 16878175,
            "id": "bitcoin",
            "market_cap_usd": 180873274570,
            "max_supply": 21000000,
            "name": "Bitcoin",
            "percent_change": {
                "1h": -0.92,
                "24h": -8.06,
                "7d": 16.4
            },
            "price_btc": 1,
            "price_usd": 10716.4,
            "symbol": "BTC",
            "total_supply": 16878175,
            "updated_at": {
                "countdown": -126,
                "datetime": "2018-02-21T15:54:29+0000",
                "timestamp": 1519228469
            },
            "volume_usd_24h": 10293900000
        },
        {
            "24h_volume_usd": "2669130000.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_ethereum_422008",
            "available_supply": 97754993,
            "id": "ethereum",
            "market_cap_usd": 82703559210,
            "max_supply": 0,
            "name": "Ethereum",
            "percent_change": {
                "1h": -2.53,
                "24h": -10.55,
                "7d": -5.77
            },
            "price_btc": 0.0804829,
            "price_usd": 846.029,
            "symbol": "ETH",
            "total_supply": 97754993,
            "updated_at": {
                "countdown": -143,
                "datetime": "2018-02-21T15:54:12+0000",
                "timestamp": 1519228452
            },
            "volume_usd_24h": 2669130000
        },
        {
            "24h_volume_usd": "923017000.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_ripple_422008",
            "available_supply": 39009215838,
            "id": "ripple",
            "market_cap_usd": 40219671805,
            "max_supply": 100000000000,
            "name": "Ripple",
            "percent_change": {
                "1h": -0.94,
                "24h": -9.31,
                "7d": -4.28
            },
            "price_btc": 0.00009808,
            "price_usd": 1.03103,
            "symbol": "XRP",
            "total_supply": 99992725510,
            "updated_at": {
                "countdown": -154,
                "datetime": "2018-02-21T15:54:01+0000",
                "timestamp": 1519228441
            },
            "volume_usd_24h": 923017000
        },
        {
            "24h_volume_usd": "691434000.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_bitcoin-cash_422008",
            "available_supply": 16979675,
            "id": "bitcoin-cash",
            "market_cap_usd": 22245411811,
            "max_supply": 21000000,
            "name": "Bitcoin Cash",
            "percent_change": {
                "1h": -2.49,
                "24h": -13.81,
                "7d": -0.85
            },
            "price_btc": 0.124632,
            "price_usd": 1310.12,
            "symbol": "BCH",
            "total_supply": 16979675,
            "updated_at": {
                "countdown": -143,
                "datetime": "2018-02-21T15:54:12+0000",
                "timestamp": 1519228452
            },
            "volume_usd_24h": 691434000
        }
    ]
}

Please take a look at the above object. You can use WHERE clause to filter all the properties of the CryptoTicker object and only get updates for what you need. 

Optional: Pull the data

You can use fetch endpoint to request the data currently available for your HQL query. Hooks will return the latest data available for HQL query. The result may be empty if we currently don’t have any data available for your query.

To pull the data for “All the coins with the market cap between 10M and 11M” you can use.

SELECT * FROM CryptoTickers 
WHERE market_cap_usd > 10000000 and
market_cap_usd<11000000

This query will return:

{
    "matches_count": 20,
    "results": [
        {
            "24h_volume_usd": "99354.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_bitcrystals_422008",
            "available_supply": 23184528,
            "id": "bitcrystals",
            "market_cap_usd": 10952556,
            "max_supply": 0,
            "name": "Bitcrystals",
            "percent_change": {
                "1h": -1.75,
                "24h": -14.9,
                "7d": -15.91
            },
            "price_btc": 0.00004452,
            "price_usd": 0.472408,
            "symbol": "BCY",
            "total_supply": 23184528,
            "updated_at": {
                "countdown": -183,
                "datetime": "2018-02-21T16:09:05+0000",
                "timestamp": 1519229345
            },
            "volume_usd_24h": 99354
        },
        {
            "24h_volume_usd": "63734.6",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_payfair_422008",
            "available_supply": 76070288,
            "id": "payfair",
            "market_cap_usd": 10938831,
            "max_supply": 0,
            "name": "Payfair",
            "percent_change": {
                "1h": -1.7,
                "24h": -19.98,
                "7d": 25.74
            },
            "price_btc": 0.00001355,
            "price_usd": 0.143799,
            "symbol": "PFR",
            "total_supply": 88999687,
            "updated_at": {
                "countdown": -171,
                "datetime": "2018-02-21T16:09:17+0000",
                "timestamp": 1519229357
            },
            "volume_usd_24h": 63734.6
        },
        {
            "24h_volume_usd": "58033.9",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_curecoin_422008",
            "available_supply": 23849712,
            "id": "curecoin",
            "market_cap_usd": 10915441,
            "max_supply": 0,
            "name": "Curecoin",
            "percent_change": {
                "1h": 0.29,
                "24h": -8.84,
                "7d": -10.34
            },
            "price_btc": 0.00004313,
            "price_usd": 0.457676,
            "symbol": "CURE",
            "total_supply": 23849712,
            "updated_at": {
                "countdown": -185,
                "datetime": "2018-02-21T16:09:03+0000",
                "timestamp": 1519229343
            },
            "volume_usd_24h": 58033.9
        },
        {
            "24h_volume_usd": "68085.4",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_jesus-coin_422008",
            "available_supply": 14817183822,
            "id": "jesus-coin",
            "market_cap_usd": 10895342,
            "max_supply": 0,
            "name": "Jesus Coin",
            "percent_change": {
                "1h": 30.06,
                "24h": -7.62,
                "7d": -43.11
            },
            "price_btc": 7e-8,
            "price_usd": 0.000735318,
            "symbol": "JC",
            "total_supply": 20325184344,
            "updated_at": {
                "countdown": -167,
                "datetime": "2018-02-21T16:09:21+0000",
                "timestamp": 1519229361
            },
            "volume_usd_24h": 68085.4
        },
        {
            "24h_volume_usd": "34415.9",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_blockcat_422008",
            "available_supply": 7360121,
            "id": "blockcat",
            "market_cap_usd": 10867955,
            "max_supply": 0,
            "name": "BlockCAT",
            "percent_change": {
                "1h": -0.2,
                "24h": -12.72,
                "7d": -10.66
            },
            "price_btc": 0.00013914,
            "price_usd": 1.4766,
            "symbol": "CAT",
            "total_supply": 9200151,
            "updated_at": {
                "countdown": -174,
                "datetime": "2018-02-21T16:09:14+0000",
                "timestamp": 1519229354
            },
            "volume_usd_24h": 34415.9
        },
        {
            "24h_volume_usd": "81574.8",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_pinkcoin_422008",
            "available_supply": 381906699,
            "id": "pinkcoin",
            "market_cap_usd": 10849244,
            "max_supply": 0,
            "name": "PinkCoin",
            "percent_change": {
                "1h": -0.39,
                "24h": -12.72,
                "7d": -5.57
            },
            "price_btc": 0.00000268,
            "price_usd": 0.0284081,
            "symbol": "PINK",
            "total_supply": 392906699,
            "updated_at": {
                "countdown": -185,
                "datetime": "2018-02-21T16:09:03+0000",
                "timestamp": 1519229343
            },
            "volume_usd_24h": 81574.8
        },
        {
            "24h_volume_usd": "1345800.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_b2bx_422008",
            "available_supply": 16516739,
            "id": "b2bx",
            "market_cap_usd": 10688642,
            "max_supply": 0,
            "name": "B2BX",
            "percent_change": {
                "1h": 1.45,
                "24h": -8.9,
                "7d": 33.88
            },
            "price_btc": 0.00006098,
            "price_usd": 0.64714,
            "symbol": "B2B",
            "total_supply": 19822337,
            "updated_at": {
                "countdown": -171,
                "datetime": "2018-02-21T16:09:17+0000",
                "timestamp": 1519229357
            },
            "volume_usd_24h": 1345800
        },
        {
            "24h_volume_usd": "93900.7",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_stealthcoin_422008",
            "available_supply": 28167263,
            "id": "stealthcoin",
            "market_cap_usd": 10649761,
            "max_supply": 0,
            "name": "Stealthcoin",
            "percent_change": {
                "1h": -2.64,
                "24h": -13.55,
                "7d": -0.23
            },
            "price_btc": 0.00003563,
            "price_usd": 0.37809,
            "symbol": "XST",
            "total_supply": 28167263,
            "updated_at": {
                "countdown": -184,
                "datetime": "2018-02-21T16:09:04+0000",
                "timestamp": 1519229344
            },
            "volume_usd_24h": 93900.7
        },
        {
            "24h_volume_usd": "84060.1",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_sphere_422008",
            "available_supply": 3082940,
            "id": "sphere",
            "market_cap_usd": 10573036,
            "max_supply": 0,
            "name": "Sphere",
            "percent_change": {
                "1h": -1.76,
                "24h": -13.56,
                "7d": -9.3
            },
            "price_btc": 0.00032317,
            "price_usd": 3.42953,
            "symbol": "SPHR",
            "total_supply": 3082940,
            "updated_at": {
                "countdown": -183,
                "datetime": "2018-02-21T16:09:05+0000",
                "timestamp": 1519229345
            },
            "volume_usd_24h": 84060.1
        },
        {
            "24h_volume_usd": "28524.5",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_flixxo_422008",
            "available_supply": 74497777,
            "id": "flixxo",
            "market_cap_usd": 10493757,
            "max_supply": 0,
            "name": "Flixxo",
            "percent_change": {
                "1h": -2.53,
                "24h": -15.66,
                "7d": -5.06
            },
            "price_btc": 0.00001327,
            "price_usd": 0.14086,
            "symbol": "FLIXX",
            "total_supply": 189151329,
            "updated_at": {
                "countdown": -171,
                "datetime": "2018-02-21T16:09:17+0000",
                "timestamp": 1519229357
            },
            "volume_usd_24h": 28524.5
        },
        {
            "24h_volume_usd": "29822.9",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_toacoin_422008",
            "available_supply": 1331155614,
            "id": "toacoin",
            "market_cap_usd": 10491436,
            "max_supply": 0,
            "name": "ToaCoin",
            "percent_change": {
                "1h": 0.4,
                "24h": -11,
                "7d": 6.91
            },
            "price_btc": 7.4e-7,
            "price_usd": 0.00788145,
            "symbol": "TOA",
            "total_supply": 8885254986,
            "updated_at": {
                "countdown": -175,
                "datetime": "2018-02-21T16:09:13+0000",
                "timestamp": 1519229353
            },
            "volume_usd_24h": 29822.9
        },
        {
            "24h_volume_usd": "55131.8",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_artbyte_422008",
            "available_supply": 792537250,
            "id": "artbyte",
            "market_cap_usd": 10460620,
            "max_supply": 0,
            "name": "ArtByte",
            "percent_change": {
                "1h": -1.72,
                "24h": -10.68,
                "7d": -1.02
            },
            "price_btc": 0.00000124,
            "price_usd": 0.0131989,
            "symbol": "ABY",
            "total_supply": 792537250,
            "updated_at": {
                "countdown": -185,
                "datetime": "2018-02-21T16:09:03+0000",
                "timestamp": 1519229343
            },
            "volume_usd_24h": 55131.8
        },
        {
            "24h_volume_usd": "106375.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_solaris_422008",
            "available_supply": 1028931,
            "id": "solaris",
            "market_cap_usd": 10452702,
            "max_supply": 0,
            "name": "Solaris",
            "percent_change": {
                "1h": 12.72,
                "24h": -4.08,
                "7d": -20.96
            },
            "price_btc": 0.00095729,
            "price_usd": 10.1588,
            "symbol": "XLR",
            "total_supply": 1178632,
            "updated_at": {
                "countdown": -178,
                "datetime": "2018-02-21T16:09:10+0000",
                "timestamp": 1519229350
            },
            "volume_usd_24h": 106375
        },
        {
            "24h_volume_usd": "6430.16",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_bunnycoin_422008",
            "available_supply": 102679085944,
            "id": "bunnycoin",
            "market_cap_usd": 10272529,
            "max_supply": 0,
            "name": "BunnyCoin",
            "percent_change": {
                "1h": 0.97,
                "24h": 44.07,
                "7d": 24.44
            },
            "price_btc": 9e-9,
            "price_usd": 0.000100045,
            "symbol": "BUN",
            "total_supply": 102679085944,
            "updated_at": {
                "countdown": -184,
                "datetime": "2018-02-21T16:09:04+0000",
                "timestamp": 1519229344
            },
            "volume_usd_24h": 6430.16
        },
        {
            "24h_volume_usd": "20884.8",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_gatcoin_422008",
            "available_supply": 529861449,
            "id": "gatcoin",
            "market_cap_usd": 10172280,
            "max_supply": 0,
            "name": "Gatcoin",
            "percent_change": {
                "1h": 10.67,
                "24h": -3.67,
                "7d": -5.07
            },
            "price_btc": 0.00000181,
            "price_usd": 0.019198,
            "symbol": "GAT",
            "total_supply": 1000000000,
            "updated_at": {
                "countdown": -169,
                "datetime": "2018-02-21T16:09:19+0000",
                "timestamp": 1519229359
            },
            "volume_usd_24h": 20884.8
        },
        {
            "24h_volume_usd": "224194.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_eroscoin_422008",
            "available_supply": 186744000,
            "id": "eroscoin",
            "market_cap_usd": 10103093,
            "max_supply": 0,
            "name": "Eroscoin",
            "percent_change": {
                "1h": 3.05,
                "24h": -6.73,
                "7d": 23.56
            },
            "price_btc": 0.0000051,
            "price_usd": 0.0541013,
            "symbol": "ERO",
            "total_supply": 240000000,
            "updated_at": {
                "countdown": -171,
                "datetime": "2018-02-21T16:09:17+0000",
                "timestamp": 1519229357
            },
            "volume_usd_24h": 224194
        },
        {
            "24h_volume_usd": "51065.9",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_vcash_422008",
            "available_supply": 15393506,
            "id": "vcash",
            "market_cap_usd": 10059518,
            "max_supply": 0,
            "name": "Vcash",
            "percent_change": {
                "1h": 1.01,
                "24h": -6.97,
                "7d": -6.84
            },
            "price_btc": 0.00006158,
            "price_usd": 0.653491,
            "symbol": "XVC",
            "total_supply": 15393506,
            "updated_at": {
                "countdown": -184,
                "datetime": "2018-02-21T16:09:04+0000",
                "timestamp": 1519229344
            },
            "volume_usd_24h": 51065.9
        },
        {
            "24h_volume_usd": "1011880.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_change_422008",
            "available_supply": 37109887,
            "id": "change",
            "market_cap_usd": 10011691,
            "max_supply": 0,
            "name": "Change",
            "percent_change": {
                "1h": -2.56,
                "24h": -6.92,
                "7d": -17.05
            },
            "price_btc": 0.00002542,
            "price_usd": 0.269785,
            "symbol": "CAG",
            "total_supply": 79184116,
            "updated_at": {
                "countdown": -173,
                "datetime": "2018-02-21T16:09:15+0000",
                "timestamp": 1519229355
            },
            "volume_usd_24h": 1011880
        },
        {
            "24h_volume_usd": "31533.0",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_get-protocol_422008",
            "available_supply": 10384393,
            "id": "get-protocol",
            "market_cap_usd": 10010503,
            "max_supply": 0,
            "name": "GET Protocol",
            "percent_change": {
                "1h": 6.6,
                "24h": -2.54,
                "7d": -15.79
            },
            "price_btc": 0.00009084,
            "price_usd": 0.963995,
            "symbol": "GET",
            "total_supply": 33368773,
            "updated_at": {
                "countdown": -169,
                "datetime": "2018-02-21T16:09:19+0000",
                "timestamp": 1519229359
            },
            "volume_usd_24h": 31533
        },
        {
            "24h_volume_usd": "329.765",
            "_entity_type": "CryptoTicker",
            "_id": "CryptoTicker_asiacoin_422008",
            "available_supply": 1336688086,
            "id": "asiacoin",
            "market_cap_usd": 10071357,
            "max_supply": 0,
            "name": "AsiaCoin",
            "percent_change": {
                "1h": 4.47,
                "24h": -7.21,
                "7d": -1.46
            },
            "price_btc": 7.1e-7,
            "price_usd": 0.00753456,
            "symbol": "AC",
            "total_supply": 1336688086,
            "updated_at": {
                "countdown": -186,
                "datetime": "2018-02-21T16:09:02+0000",
                "timestamp": 1519229342
            },
            "volume_usd_24h": 329.765
        }
    ]
}

Step 2: Create subscription

To create a subscription you just need to send an HQL query and a title of your choice to subscriptions endpoint:

curl -H "Content-type: application/json" -d '{
	"query": "SELECT * FROM CryptoTickers WHERE market_cap_usd > 10000000 and market_cap_usd < 11000000"
}' 'http://api.hooksdata.io/v1/subscriptions'

Hooks will then create a subscription on our servers and call your webhook once new data is available for your query.

Examples

Using HQL you can customize what data you want to select from a datasource and also filter the output using a WHERE clause. The following examples show how you can use HQL to choose just the data you need:

Get all coins with a 24h price growth of more than 15%.

SELECT * FROM CryptoTickers 
WHERE percent_change.24h > 15

Get an update when Bitcoin cost is more than $10k.

SELECT * FROM CryptoTickers 
WHERE name='Bitcoin'
AND price_usd > 10000