Access real-time market snapshot

markets/snapshot


Results

You can access a real-time "snapshot" of the current Market State of the Cryptoquote platform via REST. This webservice returns a JSON array of market objects It's recommended that you check this before trying to process real-time Streaming messages, as this service will reflect the schema of the market-for-exchange (not all exchanges report the same information).

You can also use this endpoint to view all supported cryptocurrency exchanges and respective symbol/pairs available.

Endpoint: https://api.cryptoquote.io/v1/markets/snapshot?key=your_api_key

Specification
Endpoint
markets/snapshot

Support
Current values

API Call Counts
100 per API call.

API Plan
gold



Input Parameters
base

Base cryptocurrency symbol

Example : BTC



Output Descriptions
symbol

The common/local symbol/ticker of the symbol

Type: string


exchange

the exchange code e.g. gemini

Type: string



Sample Output
{
    "symbol": "BTCUSDT",
    "exchange": {
      "name": "ZBG"
    },
    "symbolPair": "BTC/USDT",
    "updateType": "trade",
    "lastTradeTime": 1642095539000,
    "lastTradeSide": "buy",
    "lastTradePrice": "42864.19",
    "lastTradeSize": "0.0001",
    "updated": 1642095541096,
    "instrument": {
      "symbol": "BTCUSDT",
      "exchange": "zbg",
      "name": "Bitcoin/Tether",
      "eod_only": null,
      "created_at": "2022-01-10T22:10:11.369Z",
      "symbol_pair": "BTC/USDT",
      "type": 1,
      "id": 127513,
      "base": "BTC",
      "quote": "USDT"
    },
    "technicals": {
      "id": 61212,
      "market_id": "127513",
      "base": "BTC",
      "quote": "USDT",
      "updated_at": "2022-01-13T16:07:15.990Z",
      "one_day_ref_date": "2022-01-11T16:30:00.000Z",
      "one_day_ref_price": "42690.32",
      "one_day_chg": "837.6800000000003",
      "one_day_pchg": "1.9244624149972438",
      "seven_day_ref_date": "2022-01-10T22:09:00.000Z",
      "seven_day_ref_price": "41285.86",
      "seven_day_chg": "1976.699999999997",
      "seven_day_pchg": "4.569077742972208",
      "one_day_vol_ref_date": "2022-01-11T16:33:00.000Z",
      "one_day_vol": "11213.2433",
      "one_day_amount": "481904378.705353",
      "seven_day_vol_ref_date": "2022-01-10T22:09:00.000Z",
      "seven_day_vol": "29810.3228",
      "seven_day_amount": "1279834643.250362"
    }
  },
  {
    "symbol": "BTCUSDC",
    "exchange": {
      "name": "Crypto"
    },
    "updated": 1642095538226,
    "updateType": "trade",
    "lastTradeSize": 0.000024,
    "lastTradePrice": 42862.76,
    "lastTradeTime": 1642095538054,
    "lastTradeSide": "buy",
    "instrument": {
      "symbol": "BTCUSDC",
      "exchange": "crypto",
      "name": "Bitcoin/USD Coin",
      "eod_only": null,
      "created_at": "2021-07-09T19:13:58.100Z",
      "symbol_pair": "BTC/USDC",
      "type": 1,
      "id": 3021,
      "base": "BTC",
      "quote": "USDC"
    },
    "technicals": {
      "id": 4,
      "market_id": "3021",
      "base": "BTC",
      "quote": "USDC",
      "updated_at": "2022-01-13T16:06:46.652Z",
      "one_day_ref_date": "2022-01-11T16:30:00.000Z",
      "one_day_ref_price": "42712.85",
      "one_day_chg": "809.7900000000009",
      "one_day_pchg": "1.8606178301683924",
      "seven_day_ref_date": "2022-01-06T16:00:00.000Z",
      "seven_day_ref_price": "42856.87",
      "seven_day_chg": "425.3099999999977",
      "seven_day_pchg": "0.9826445895285257",
      "one_day_vol_ref_date": "2022-01-11T16:33:00.000Z",
      "one_day_vol": "606.099363",
      "one_day_amount": "26084049.84402574",
      "seven_day_vol_ref_date": "2022-01-06T16:06:00.000Z",
      "seven_day_vol": "5115.283754",
      "seven_day_amount": "215537239.68320033"
    }
  }

REST
GET https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key
Python
import requests 
r = requests.get("https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key")
data = r.json()
print(data)
Node.js
var http = require('http');
var buffer = '';
var options = {
	host: 'https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key',
	port: 80,
	path: 'https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key',
	headers: headers
};
callback = function(response) {
	response.on('data', function (chunk) {
	buffer += chunk;
});
response.on('end', function () {
	// your code here if you want to use the results !
});
}

var req = http.get(options, callback).end();
C#
using (var client = new HttpClient())
{
	client.BaseAddress = new Uri("{$api_host}");
	client.DefaultRequestHeaders.Clear();
	//ADD Acept Header to tell the server what data type you want
	client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
	//SET Parameters
	HttpResponseMessage response = await client.GetAsync("https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key";
URL url = new URL(uri);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
	connection.setRequestMethod("GET");
	connection.setRequestProperty("Accept", "application/json");
InputStream xml = connection.getInputStream();
R
1 - Install package
install.packages("RCurl")
install.packages("jsonlite")
2 - Request the data:
library('RCurl')
require('jsonlite')
json <- getURL(URLencode('https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key';
$handle = curl_init(); 
	curl_setopt($handle, CURLOPT_URL, $url);
	curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

	$data = curl_exec($handle);
curl_close($handle);
//parse your data as per your needs....
Javascript
var url = 'https://api.cryptoquote.io/v1/markets/snapshot&https://api.cryptoquote.io/v1/markets/snapshot?key=&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});