Consultar varios klines a la vez?

Hola a todos/as! Queria conusltarles si alguien puede generar una consulta PHP y AJAX con varios “klines” a la vez ?¡

I will pretend to know Spanish. Getting Klines data is as simple as sending a http request :slight_smile:

use GuzzleHttp\Client;

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.binance.com/api/v3/klines?symbol=BNBUSDT&interval=1m');

And how can I do it without using third party functions?

Hi!! Tnk for you!! I like your reply!

1 Like

You will need a library helping you sending the request, maybe cURL can help you without install package.

$url = 'https://api.binance.com/api/v3/klines?symbol=BNBUSDT&interval=1m';
$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, TRUE);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 $head = curl_exec($ch);
 $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
 curl_close($ch);

I didn’t test, but similar like this. Here is the manual:

https://www.php.net/manual/en/book.curl.php