Ticker
get
https://api.btcturk.com
/api/v2/ticker
Pair
get
https://api.btcturk.com
/api/v2/ticker/currency
Currency

C# Code Example

1
// You can download ApiClient .net core complete library from github https://github.com/BTCTrader/broker-api-csharp-v2
2
3
var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
4
5
var publicKey = configuration["publicKey"];
6
var privateKey = configuration["privateKey"];
7
var resourceUrl = configuration["resourceUrl"];
8
var apiClientV1 = new ApiClientV1(publicKey, privateKey, resourceUrl);
9
var tickerList = apiClientV1.GetTicker("BTC_TRY");
10
11
if (tickerList.Result.Success)
12
{
13
foreach (var ticker in tickerList.Result.Data)
14
{
15
Console.WriteLine(ticker.ToString());
16
}
17
}
18
else
19
{
20
Console.WriteLine(tickerList.Result.ToString());
21
}
Copied!

Python Code Example

1
import time, base64, hmac, hashlib, requests, json
2
3
base = "https://api.btcturk.com"
4
method = "/api/v2/ticker?pairSymbol=BTC_TRY"
5
uri = base+method
6
7
result = requests.get(url=uri)
8
result = result.json()
9
print(json.dumps(result, indent=2))
Copied!

PHP Code Example

1
<?php
2
$base = "https://api.btcturk.com";
3
$method = "/api/v2/ticker?pairSymbol=BTC_TRY";
4
$uri = $base.$method;
5
6
$ch = curl_init();
7
curl_setopt($ch, CURLOPT_URL, $uri);
8
curl_setopt($ch, CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_2");
9
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
10
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
11
$result = curl_exec($ch);
12
13
if (curl_errno($ch)) {
14
print_r(curl_error($ch));
15
}
16
$answer = json_decode($result);
17
print_r($answer);
Copied!
Last modified 5mo ago