API Example

1<?php
2 
3 /* API URL */
4 $url = 'https://www.gametracker.ro/api/v1/server/query?game_type=cs16&amp;ip=AIM.DUAL-GAMING.RO&amp;c_port=27015&amp;q_port=27015';
5 
6 /* Init cURL resource */
7 $ch = curl_init($url);
8 
9 /* set the content type json */
10 $headers = [];
11 $headers[] = 'Content-Type:application/json';
12 
13 /* your token */
14 $token = "your token";
15 $headers[] = "Authorization: Bearer ".$token;
16 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
17 
18 /* set return type json */
19 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
20 
21 /* execute request */
22 $result = curl_exec($ch);
23 
24 /* close cURL resource */
25 curl_close($ch);
26 
27 echo '<pre>';
28 print_r($result);
29 echo '</pre>';
30 
31?>

Result from above code can be found here