Get Trades

Gets a list the latest trades for a product.

  • 2 parameters can be used for the trades enpoint:

    • pairSymbol

    • last

  • You can send pairSymbol parameter in this format BTCUSDT

  • Max of 50 latest trades can be used for the trades parameter

There are 2 possible options:

Without last parameter

https://api.btcturk.com/api/v2/trades?pairSymbol=BTCUSDT

Default 50 trades of BTCUSDT

With last parameter

https://api.btcturk.com/api/v2/trades?pairSymbol=BTCUSDT&last=30

30 trades of BTCUSDT

Trades

GET https://api.btcturk.com/api/v2/trades

Query Parameters

NameTypeDescription

pairSymbol

string

BTCTRY, ETHTRY etc.

last

integer

Indicates how many last trades you want. Max is 50.

  {
  "success": true,
  "message": null,
  "code": 0,
  "data": [
    {
      "pair": BTCTRY,
      "pairNormalized": BTC_TRY,
      "numerator": BTC,
      "denominator": TRY,
      "date": 1533650242300,
      "tid": "636692470417865271",
      "price": "33490",
      "amount": "0.00032747"
    },
    {
      "pair": BTCTRY,
      "pairNormalized": BTC_TRY,
      "numerator": BTC,
      "denominator": TRY,
      "date": 1533650237143,
      "tid": "636692470367947749",
      "price": "33245",
      "amount": "0.00471901"
    }
    ]
  }

Code Example

// You can download ApiClient .net core complete library from github https://github.com/BTCTrader/broker-api-csharp-v2

var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

var publicKey = configuration["publicKey"];
var privateKey = configuration["privateKey"];
var resourceUrl = configuration["resourceUrl"];
var apiClientV1 = new ApiClientV1(publicKey, privateKey, resourceUrl);

var trades = apiClientV1.GetLastTrades("BTCTRY", 10);

if (trades.Result.Success)
{
    Console.WriteLine("Last 10 trades in the market");
    foreach (var trade in trades.Result.Data)
    {
        Console.WriteLine(trade.ToString());
    }
}
else
{
    Console.WriteLine(trades.Result.ToString());
}

Last updated