NAV
Shell HTTP JavaScript Node.JS PHP Ruby Python Java GO
  • Getting started
  • Authentication
  • REST APIs
  • WebSockets
  • Standards and Conventions
  • Errors and Rate Limits
  • Arbitrage

    This section describes calls related to trading data (arbitrage, Private APIs, etc ...).

    Sample Data

    
    curl -X GET \
      'https://api.cryptoapis.io/v1/trading/arbitrage-rest' \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key'
    
    
    
    GET https://api.cryptoapis.io/v1/trading/arbitrage-rest HTTP/1.1
    Host: https://api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    
    
    $.ajaxSetup({
      headers:{
        "Content-Type": "application/json" ,
        "X-API-Key": "my-api-key"
      }
    });
    
    $.get('https://api.cryptoapis.io/v1/trading/arbitrage-rest').then(function(d) {console.log(d)});
    
    
    
    const https = require('https');
    
    var options = {
      "method": "GET",
      "hostname": "https://api.cryptoapis.io",
      "path": "/v1/trading/arbitrage-rest",
      "headers": {
        'Content-Type': 'application/json',
        'X-API-Key': 'my-api-key'
      }
    };
    
    var request = https.request(options, function (response) {
      response.on("data", function (data) {
        console.log(data);
      });
    });
    
    request.end();
    
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/arbitrage-rest');
    $request->setMethod(HTTP_METH_GET);
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    try {
      $response = $request->send();
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/arbitrage-rest")
    http = Net::HTTP.new(url.host, url.port)
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    response = http.request(request)
    puts response.read_body
    
    
    
    import requests
    url = 'https://api.cryptoapis.io/v1/trading/arbitrage-rest'
    headers = {
      'Content-Type': 'application/json',
      'X-API-Key': 'my-api-key'
    }
    response = requests.get(url, headers=headers)
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/arbitrage-rest")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    import (
      "gopkg.in/resty.v0"
    )
    
    func main()
    {
        resp, err := resty.R().
          SetHeader("Content-Type", "application/json").
          SetHeader("X-API-Key", "my-api-key").
          Get("https://api.cryptoapis.io/v1/trading/arbitrage-rest")
    }
    
    

    Response body

    {
        "meta": {
            "totalCount": 17343,
            "index": 0,
            "limit": 50,
            "results": 50
        },
        "payload": [
            {
                "initExchange": "LBANK",
                "initBaseAsset": "BNB",
                "initQuoteAsset": "USDT",
                "initExchangeType": "SPOT",
                "initDirection": "BIDS",
                "initPrice": 17.5399,
                "initAmount": 4,
                "initFee": 0,
                "matchExchange": "BINANCE",
                "matchBaseAsset": "BNB",
                "matchQuoteAsset": "USDT",
                "matchExchangeType": "SPOT",
                "matchDirection": "ASKS",
                "matchPrice": 17.2763,
                "matchAmount": 40.42,
                "matchFee": 0,
                "priceDifference": 0.2670548346243715,
                "quoteAssetUSDPrice": 1.0131063528997402,
                "investmentUSD": 71.44789951998973,
                "profitWithoutFees": 1.068219338497486,
                "_id": "5cb087d101f465309fd1fa20",
                "baseAssetUSDPrice": 17.861974879997433,
                "matchQuoteAssetUSDPrice": 1.0131063528997402,
                "matchBaseAssetUSDPrice": 17.861974879997433,
                "matched": "LBANK-bnb_usdt-BIDS-17.5399-1555072946527",
                "grouped": false,
                "matchType": "negative"
            },
            ...
            {
                "initExchange": "YOBIT",
                "initBaseAsset": "LOC",
                "initQuoteAsset": "BTC",
                "initExchangeType": "SPOT",
                "initDirection": "ASKS",
                "initPrice": 9e-8,
                "initAmount": 16194514.60550616,
                "initFee": 0,
                "matchExchange": "FATBTC",
                "matchBaseAsset": "LOC",
                "matchQuoteAsset": "BTC",
                "matchExchangeType": "SPOT",
                "matchDirection": "BIDS",
                "matchPrice": 1e-7,
                "matchAmount": 20000,
                "matchFee": 0,
                "priceDifference": 0.00004991466126717627,
                "quoteAssetUSDPrice": 4991.466126717627,
                "investmentUSD": 16450.24110000122,
                "profitWithoutFees": 0.9982932253435254,
                "_id": "5cb0861701f465dd6dd1fa1f",
                "baseAssetUSDPrice": 0.822512055000061,
                "matchQuoteAssetUSDPrice": 4991.466126717627,
                "matchBaseAssetUSDPrice": 0.822512055000061,
                "matched": "YOBIT-loc_btc-ASKS-9e-8-1555072532702",
                "grouped": false,
                "matchType": "negative"
            }
        ]
    }
    

    Get latest quote updates for up to 1 hour ago. Latest data is always returned in time descending order.

    HTTP Request

    GET /v1/trading/arbitrage-rest?skip={skip}&limit={limit}

    URL Parameters
    Variable Type Description
    skip int The offset of items to start from. Useful for paginations. (e.g. skip=100 would show results from 101 item to 150)
    limit int Amount of items to return (optional, default value is 50)
    Meta Response
    Variable Type Description
    totalCount int Total count of the items in the listing for the given criteria
    index int Sequential index number of the items list start position (depends on the skip parameter) for the given criteria
    limit int Limit number of the items list (depends on the limit parameter) for the given criteria.
    results int Count of the items listed in the current response for the given criteria
    Output Variables
    Variables Description
    initExchange Exchange name, where the initial quote took place
    initBaseAsset Base asset name, where the initial quote took place
    initQuoteAsset Quote asset name, where the initial quote took place
    initExchangeType Exchange type, where the initial quote took place
    initDirection Direction, where the initial quote took place
    initPrice Base asset whole unit price in quote assets, where the initial quote took place
    initAmount Amount of base asset, where the initial quote took place
    initFee Exchange fee in USD needed for the trade, where the initial quote took place
    matchExchange Exchange name, where the matching quote took place
    matchBaseAsset Base asset name, where the matching quote took place
    matchQuoteAsset Quote asset name, where the matching quote took place
    matchExchangeType Exchange type, where the matching quote took place
    matchDirection Direction, where the matching quote took place
    matchPrice Base asset whole unit price in quote assets, where the matching quote took place
    matchAmount Amount of base asset, where the matching quote took place
    matchFee Exchange fee in USD needed for the trade, where the matching quote took place
    priceDifference Difference between initial and matching price in USD
    quoteAssetUSDPrice Quote asset whole unit price in USD when the matching happened, where the initial quote took place
    investmentUSD Quote asset whole unit price in USD when the matching happened, where the initial quote took place
    profitWithoutFees Profit in USD without the exchanges fees if the trade was made
    baseAssetUSDPrice Base asset whole unit price in USD when the matching happened, where the initial quote took place
    matchQuoteAssetUSDPrice Quote asset whole unit price in USD when the matching happened, where the matching quote took place
    matchBaseAssetUSDPrice Base asset whole unit price in USD when the matching happened, where the matching quote took place
    matched Unique string identifier of the initial quote
    grouped If grouped is true the initial quote has been matched with other matching quotes in order to trade the maximum amount
    matchType Can be one of: positive, negative, positive_correlation_base_quote, positive_correlation_quote_base, negative_correlation_base_base, negative_correlation_quote_quote