Coming soon! Currently, Crypto-ML is offering API connections on an invite-only basis.

API Overview

Crypto-ML provides a WebSocket API. Once connected, you will receive output from our machine learning models.

The WebSocket connection is designed to stay open until your client terminates the connection. That means a ping or “keep-alive” mechanism is not required from the client in order to keep the connection up.

Using this method, each end client receives notifications immediately.

Crypto-ML API WebSocket Diagram - Multi-Connection

Account Provisioning

After registering for an API account, your organization will receive an API Key. This key will allow for a defined number of concurrent sessions.

API Details

Following are technical details for using the API.

API Access URL

 wss://api.crypto-ml.com?apiKey=YOUR_API_KEY

Sample Payloads

Market Index

Every 24 hours, the client receives updated Market Index data, including the current value and the 7-day trend.

Market Index samples:

{"bullBear":"BULL 13.56","_7dayTrend":"Bull market weakening."}
{"bullBear":"BULL 19.62","_7dayTrend":"Bull market strengthening."}
{"bullBear":"BEAR -0.55","_7dayTrend":"Bear market strengthening."}
{"bullBear":"BEAR -6.07","_7dayTrend":"Bear market weakening."}

Trade Alerts

As real-time trade alerts are issued, the data will be instantly streamed.

Long trade samples:

{"side":"sell","productCode":"BTC-USD","price":"9543.01","time":"2020-02-24T18:38:01.6484377Z"}
{"side":"sell","productCode":"ETH-USD","price":"267.32","time":"2020-02-24T09:23:25.7622456Z"}
{"side":"buy","productCode":"BTC-USD","price":"9891.77","time":"2020-02-23T05:37:39.2429824Z"}
{"side":"buy","productCode":"ETH-USD","price":"264.56","time":"2020-02-22T01:22:42.2901814Z"}

Short trade samples:

{"side":"short","productCode":"BTC-USD","price":"8291.73","time":"2020-01-23T18:05:51.1944978Z"}
{"side":"close","productCode":"BTC-USD","price":"7414.6","time":"2020-01-24T13:05:51.1244110Z"}

JavaScript Client Sample

The following code creates a simple JavaScript client that opens the WebSocket connection and receives updates from Crypto-ML’s Streaming API:

<head>
<script>
socket = new WebSocket("wss://api.crypto-ml.com?apiKey=YOUR_API_KEY");
socket.onopen = function(e) {
  console.log("Connection established");  
};
socket.onmessage = function(event) {
  console.log("Data received from server:"+ event.data);
};
socket.onclose = function(event) {
  if (event.wasClean) {
    console.log("Connection closed cleanly, code="+event.code+",reason="+event.reason);
  } else {  
    console.log("Connection died");
  }
};
socket.onerror = function(error) {
  console.log("error:"+ error.message);
};
</script>
</head>