pool/web/yaamp/core/exchange/coinbene.php
Tanguy Pruvot 42a6e8529e coinbene public api, optional
(disabled by default in settings table)
2018-10-15 10:20:59 +02:00

21 lines
559 B
PHP

<?php
// https://api.coinbene.com/v1/market/symbol
// https://api.coinbene.com/v1/market/ticker?symbol=all
function coinbene_api_query($method, $params='')
{
$uri = "https://api.coinbene.com/v1/{$method}";
if (!empty($params)) $uri .= "?{$params}";
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$execResult = strip_tags(curl_exec($ch));
$obj = json_decode($execResult);
return $obj;
}