k线数据
/kline?pid=39&interval=1&key=上方联系我们获取key
PARAMS
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
pid | query | string | yes | 产品Id(这个pid就是股票列表接口里面的Id字段) |
interval | query | string | yes | 1 5 15 30 45 60 D W M (1分钟 5分钟 15分钟 30分钟 45分钟 60分钟 天 周 月) |
key | query | string | yes | 联系我们获取key |
Example Response
json
[
{
"t": 1722232200, // 时间戳
"c": 3037.95, // close
"o": 3038.5, // open
"h": 3039, // 最高
"l": 3037.55, // 最低
"v": 2172 // 交易量
},
]
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=上方联系我们获取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=上方联系我们获取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;