NAV Navbar
shell java python php node.js javascript

Introduction

Coinscious Data Service - Alert API: We provide Alert API.

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Response

Coinscious uses standard HTTP response codes to indicate the success or failure of an API request. For example,
* Code 200 indicates success.
* Code 400 indicates an error that resulted from the provided information (e.g., a required parameter was missing).

JSON structure of an unexpected error response is the following:

{
  "code": "1001",
  "message": "Exchange not specified."
}

We support the following list of standard HTTP response codes:

Status Code Description
200 It's All Good.
400 Unexpected Error
Refer to the list of Error Codes we provide.
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
429 Too Many Requests
500 Internal Server Error

Alert API

Alert Keys

Obtain supported alert types and keys

HTTP Request

GET /alerts/keys

curl -X GET "https://alert-api.coinscious.org/alerts/keys" -H "accept: application/json" -H "Authorization: Bearer <token>"
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class Example {

    public static void main(String[] args) throws IOException {

        Request request = new Request.Builder()
                .get()
                .url("https://alert-api.coinscious.org/alerts/keys")
                .addHeader("Authorization", "bearer " + token)
                .build();

        Dispatcher dispatcher = new Dispatcher();
        OkHttpClient client = new OkHttpClient.Builder()
                .dispatcher(dispatcher)
                .build();

        Response response = client.newCall(request).execute();
        String body = response.body().string();
    }

}
import requests
url = 'https://alert-api.coinscious.org/alerts/keys'
headers = {'Authorization' : 'bearer token'}
response = requests.get(url, headers=headers)
<?php
$request = new HttpRequest();
$request->setUrl('https://alert-api.coinscious.org/alerts/keys');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Authorization' => 'bearer token'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "alert-api.coinscious.org",
  "path": "/alerts/keys",
  "headers": {'Authorization': 'bearer token'}
};

var request = https.request(options, function (response) {
  var chunks = [];
  response.on("data", function (chunk) {
    chunks.push(chunk);
  });
});

request.end();
var req =  new XMLHttpRequest();
req.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        console.log(JSON.parse(this.responseText));
    }
};
req.open("GET", "https://alert-api.coinscious.org/alerts/keys", true);
req.setRequestHeader("Authorization", "bearer token");
req.send();

The request returns JSON structured like the following:

[
    {
        "alertType": "volume",
        "keys": [
            {
                "key": "volumePump",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            },
            {
                "key": "volumeDump",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            }
        ]
    },
    {
        "alertType": "blockchain",
        "keys": [
            {
                "key": "topTransaction",
                "extraParams": [
                    {
                        "param": "token",
                        "values": [
                            "btc",
                            "usdt",
                            "eth",
                            "bnb",
                            "omg",
                            "zil",
                            "mkr",
                            "ae",
                            "bat",
                            "rep",
                            "ppt",
                            "gnt",
                            "wtc",
                            "snt",
                            "iost",
                            "aion",
                            "mith",
                            "dcn",
                            "link",
                            "ht",
                            "dgd",
                            "elf",
                            "hot",
                            "xin",
                            "fun",
                            "bnt",
                            "kin",
                            "ttu",
                            "powr",
                            "mana",
                            "lrc",
                            "qash",
                            "knc",
                            "wax",
                            "mco",
                            "tusd",
                            "cmt",
                            "theta",
                            "sub",
                            "loom",
                            "pay",
                            "noah",
                            "poly",
                            "okb",
                            "gusd",
                            "usdc",
                            "eurs",
                            "zrx"
                        ]
                    }
                ]
            }
        ]
    },
    {
        "alertType": "rsi",
        "keys": [
            {
                "key": "overbought",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            },
            {
                "key": "oversold",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            }
        ]
    },
    {
        "alertType": "price",
        "keys": [
            {
                "key": "pricePump",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            },
            {
                "key": "priceDump",
                "extraParams": [
                    {
                        "param": "exchange",
                        "values": []
                    },
                    {
                        "param": "pair",
                        "values": []
                    }
                ]
            }
        ]
    }
]

Responses

Code Description Schema
200 Successful response response schema

Response Schema

Name Type Required Description
anonymous [AlertTypeKeys] false none
» alertType string false none
» keys [AlertTypeKey] false none
»» key string false none
»» extraParams [AlertParam] false none
»»» param string false none
»»» values [string] false none

Alert Configurations

Set user's alert configurations

Http Request

POST /alerts/configurations

curl -X POST "https://alert-api.coinscious.org/alerts/configurations" -H "accept: application/json" -H "Authorization: Bearer <token> -d '[{"alertType":"blockchain","key":"topTransaction","exchange":"","pair":"","token":"usdt"}]'"
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class Example {

    public static void main(String[] args) throws IOException {

    String requestBody = "["
            + "{\"alertType\":\"blockchain\",\"key\":\"topTransaction\",\"token\":\"usdt\"}, "
            + "{\"alertType\": \"price\", \"key\": \"pricePump\", \"exchange\": \"binance\", \"pair\": \"btc_usdt\"}"
            + "]";
        Request request = new Request.Builder()
                .post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), requestBody))
                .url("https://alert-api.coinscious.org/alerts/configurations")
                .addHeader("Authorization", "bearer " + token)
                .build();

        Dispatcher dispatcher = new Dispatcher();
        OkHttpClient client = new OkHttpClient.Builder()
                .dispatcher(dispatcher)
                .build();

        Response response = client.newCall(request).execute();
        String body = response.body().string();
    }

}
import requests
url = 'https://alert-api.coinscious.org/alerts/configurations'
headers = {'Authorization' : 'bearer token'}
data = [{'alertType':'blockchain','key':'topTransaction','exchange':'','pair':'','token':'usdt'}]
response = requests.get(url, headers=headers, data=data)
<?php
$request = new HttpRequest();
$request->setUrl('https://alert-api.coinscious.org/alerts/configurations');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Authorization' => 'bearer token'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>
const https = require('https');
const data = JSON.stringify([{"alertType":"blockchain","key":"topTransaction","exchange":"","pair":"","token":"usdt"}])

var options = {
  "method": "GET",
  "hostname": "alert-api.coinscious.org",
  "path": "/alerts/configurations",
  "headers": {
        'Authorization': 'bearer token',
        'Content-Type': 'application/json',
        'Content-Length': data.length
  }
};

var request = https.request(options, function (response) {
  var chunks = [];
  response.on("data", function (chunk) {
    chunks.push(chunk);
  });
});

request.end();
const data = JSON.stringify([{"alertType":"blockchain","key":"topTransaction","exchange":"","pair":"","token":"usdt"}]);

const req =  new XMLHttpRequest();
req.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        console.log(JSON.parse(this.responseText));
    }
};
req.open("POST", "https://alert-api.coinscious.org/alerts/configurations", true);
req.setRequestHeader("Authorization", "bearer token");
req.setRequestHeader("Content-Type", "application/json");
req.send(data);

Body parameter

Name In Type Required
body body [Alertconfiguration] true
[
  {
    "alertType": "blockchain",
        "key": "topTransaction",
        "token": "btc"
    },
    {
    "alertType": "rsi",
        "key": "oversold",
        "exchange": "binance",
        "pair": "btc_usdt"
    },
    {
    "alertType": "price",
        "key": "pricePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    },
    {
    "alertType": "volume",
        "key": "volumePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    }
]

My Alert Configurations

Get user's alert configuration

Http Request

GET /alerts/configurations/

curl -X GET "https://alert-api.coinscious.org/alerts/configurations" -H "accept: application/json" -H "Authorization: Bearer <token>"
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class Example {

    public static void main(String[] args) throws IOException {

        Request request = new Request.Builder()
                .get()
                .url("https://alert-api.coinscious.org/alerts/configurations")
                .addHeader("Authorization", "bearer " + token)
                .build();

        Dispatcher dispatcher = new Dispatcher();
        OkHttpClient client = new OkHttpClient.Builder()
                .dispatcher(dispatcher)
                .build();

        Response response = client.newCall(request).execute();
        String body = response.body().string();
    }

}
import requests
url = 'https://alert-api.coinscious.org/alerts/configurations'
headers = {'Authorization' : 'bearer token'}
response = requests.get(url, headers=headers)
<?php
$request = new HttpRequest();
$request->setUrl('https://alert-api.coinscious.org/alerts/configurations');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Authorization' => 'bearer token'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "alert-api.coinscious.org",
  "path": "/alerts/configurations",
  "headers": {'Authorization': 'bearer token'}
};

var request = https.request(options, function (response) {
  var chunks = [];
  response.on("data", function (chunk) {
    chunks.push(chunk);
  });
});

request.end();
var req =  new XMLHttpRequest();
req.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        console.log(JSON.parse(this.responseText));
    }
};
req.open("GET", "https://alert-api.coinscious.org/alerts/configurations", true);
req.setRequestHeader("Authorization", "bearer token");
req.send();

Response

Code Description Schema
200 Successful response response schema

The request returns JSON structured like the following:

[
  {
    "alertType": "blockchain",
        "key": "topTransaction",
        "token": "btc"
    },
    {
    "alertType": "rsi",
        "key": "oversold",
        "exchange": "binance",
        "pair": "btc_usdt"
    },
    {
    "alertType": "price",
        "key": "pricePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    },
    {
    "alertType": "volume",
        "key": "volumePump",
        "exchange": "binance",
        "pair": "btc_usdt"
    }
]

Latest alerts

Get user's latest alerts

Http Request

GET /alerts/latest

curl -X GET "https://alert-api.coinscious.org/alerts/latest" -H "accept: application/json" -H "Authorization: Bearer <token>"
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class Example {

    public static void main(String[] args) throws IOException {

        Request request = new Request.Builder()
                .get()
                .url("https://alert-api.coinscious.org/alerts/latest")
                .addHeader("Authorization", "bearer " + token)
                .build();

        Dispatcher dispatcher = new Dispatcher();
        OkHttpClient client = new OkHttpClient.Builder()
                .dispatcher(dispatcher)
                .build();

        Response response = client.newCall(request).execute();
        String body = response.body().string();
    }

}
import requests
url = 'https://alert-api.coinscious.org/alerts/latest'
headers = {'Authorization' : 'bearer token'}
response = requests.get(url, headers=headers)
<?php
$request = new HttpRequest();
$request->setUrl('https://alert-api.coinscious.org/alerts/latest');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Authorization' => 'bearer token'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "alert-api.coinscious.org",
  "path": "/alerts/latest",
  "headers": {'Authorization': 'bearer token'}
};

var request = https.request(options, function (response) {
  var chunks = [];
  response.on("data", function (chunk) {
    chunks.push(chunk);
  });
});

request.end();
var req =  new XMLHttpRequest();
req.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        console.log(JSON.parse(this.responseText));
    }
};
req.open("GET", "https://alert-api.coinscious.org/alerts/latest", true);
req.setRequestHeader("Authorization", "bearer token");
req.send();

Response

Code Description Schema
200 Successful response response schema

The request returns JSON structured like the following:

[
    {
        "alertType": "price",
        "key": "pricePump",
        "time": 1558229993,
        "exchange": "binance",
        "pair": "btc_usdt",
        "alert": "[binance btc_usdt] Price increases from 7599.000000 to 7608.290000 at 2019-05-19T01:37:00Z !"
    },
    {
        "alertType": "price",
        "key": "pricePump",
        "time": 1558229118,
        "exchange": "binance",
        "pair": "xrp_usdt",
        "alert": "[binance xrp_usdt] Price increases from 0.377840 to 0.383080 at 2019-05-19T01:22:00Z !"
    },
    {
        "alertType": "price",
        "key": "pricePump",
        "time": 1558210000,
        "exchange": "binance",
        "pair": "xrp_btc",
        "alert": "[binance xrp_btc] Price increases from 0.000052 to 0.000052 at 2019-05-18T20:05:00Z !"
    },
    {
        "alertType": "price",
        "key": "priceDump",
        "time": 1558199200,
        "exchange": "coinbasePro",
        "pair": "btc_usd",
        "alert": "[coinbasePro btc_usd] Price decreases from 7343.030000 to 7295.600000 at 2019-05-18T17:05:00Z !"
    },
    {
        "alertType": "price",
        "key": "pricePump",
        "time": 1558230024,
        "exchange": "coinbasePro",
        "pair": "btc_usd",
        "alert": "[coinbasePro btc_usd] Price increases from 7625.970000 to 7636.550000 at 2019-05-19T01:37:00Z !"
    }
]

Response Schema

Name Type Required Restrictions Description
anonymous [Alert] false none none

Schemas

ErrorModel

{
  "code": "string",
  "message": "string"
}

Properties

Name Type Required Description
code string true Error list for all the API's, please refer example tag for api specific error code.
message string true none

AlertTypeKeys

{
  "alertType": "string",
  "keys": [
    {
      "key": "string",
      "extraParams": [
        {
          "param": "string",
          "values": [
            "string"
          ]
        }
      ]
    }
  ]
}

Properties

Name Type Required Description
alertType string false none
keys [AlertTypeKey] false none

AlertTypeKey

{
  "key": "string",
  "extraParams": [
    {
      "param": "string",
      "values": [
        "string"
      ]
    }
  ]
}

Properties

Name Type Required Description
key string false none
extraParams [AlertParam] false none

AlertParam

{
  "param": "string",
  "values": [
    "string"
  ]
}

Properties

Name Type Required Description
param string false none
values [string] false none

AlertConfiguration

{
  "alertType": "string",
  "key": "string",
  "exchange": "string",
  "pair": "string",
  "token": "string"
}

Properties

Name Type Required Description
alertType string true none
key string true none
exchange string false none
pair string false none
token string false none

Alert

{
  "alertType": "string",
  "key": "string",
  "exchange": "string",
  "pair": "string",
  "token": "string",
  "time": 0,
  "alert": "string"
}

Properties

Name Type Required Description
alertType string false none
key string false none
exchange string false none
pair string false none
token string false none
time number(Int64) false none
alert string false none

Error Codes

Coinscious Data Services - Alert API uses the following error codes:

Error Code Meaning
3001 Alert type not specified.
3002 Alert type not supported.
3003 Alert Key not specified.
3004 Alert Key not supported.
3005 Exchange is not supported for alert type.
3006 Token or pair not specified.
3007 Alert subscription missing or expired
3008 Alert configuration number exceed limit.
3009 Number of token or pairs in Alert configuration exceed limit.