K-line data
/kline?pid=39&interval=1&key=Contact us to get the key
PARAMS
name | Location | type | Required | illustrate |
---|---|---|---|---|
pid | query | string | yes | Product ID (this pid is the ID field in the stock list interface) |
interval | query | string | yes | 1 5 15 30 45 60 D W M (1 minute 5 minutes 15 minutes 30 minutes 45 minutes 60 minutes Day Week Month) |
key | query | string | yes | Contact us to get the key |
Example Response
json
[
{
"t": 1722232200, // Timestamp
"c": 3037.95, // close
"o": 3038.5, // open
"h": 3039, // Highest
"l": 3037.55, // lowest
"v": 2172 // Trading Volume
},
]
Example Request
java
import java.io.*;
import okhttp3.*;
public class main {
public static void main(String []args) throws IOException{
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("/kline?pid=39&interval=1&key=Contact us to get the key")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '/kline?pid=39&interval=1&key=Contact us to get the key',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;