akshare 0.1.2

100% pure Rust implementation of akshare — unified access to Chinese and global financial market data APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
//! Shareholder analysis (股东分析) from Eastmoney.

use super::helpers::{
    fmt_date, json_f64, json_f64_opt, json_i64, json_i64_opt, json_str, json_str_opt,
};
use super::types::{
    GdfxHoldingAnalyse, GdfxHoldingChange, GdfxHoldingDetail, GdfxHoldingStatistic, GdfxTeamwork,
    GdfxTop10, HoldChangeCninfo, HoldControlCninfo, ManagementDetail,
};
use crate::client::AkShareClient;
use crate::error::Result;

impl AkShareClient {
    /// 股东持股统计-十大流通股东
    pub async fn stock_gdfx_free_holding_statistics_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingStatistic>> {
        let filter = format!(
            "(HOLDNUM_CHANGE_TYPE=\"001\")(END_DATE='{}')",
            fmt_date(date)
        );
        let data = self
            .dc_fetch_all(
                "RPT_COOPFREEHOLDERS_ANALYSIS",
                "ALL",
                &filter,
                "STATISTICS_TIMES,COOPERATION_HOLDER_MARK",
                "-1,-1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingStatistic {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                statistics_count: json_i64_opt(v, "STATISTICS_TIMES"),
                avg_change_10d: json_f64_opt(v, "HOLD_10_DAYS_AVG_CHR"),
                max_change_10d: json_f64_opt(v, "HOLD_10_DAYS_MAX_CHR"),
                min_change_10d: json_f64_opt(v, "HOLD_10_DAYS_MIN_CHR"),
                avg_change_30d: json_f64_opt(v, "HOLD_30_DAYS_AVG_CHR"),
                max_change_30d: json_f64_opt(v, "HOLD_30_DAYS_MAX_CHR"),
                min_change_30d: json_f64_opt(v, "HOLD_30_DAYS_MIN_CHR"),
                avg_change_60d: json_f64_opt(v, "HOLD_60_DAYS_AVG_CHR"),
                max_change_60d: json_f64_opt(v, "HOLD_60_DAYS_MAX_CHR"),
                min_change_60d: json_f64_opt(v, "HOLD_60_DAYS_MIN_CHR"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 股东持股统计-十大股东
    pub async fn stock_gdfx_holding_statistics_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingStatistic>> {
        let filter = format!(
            "(HOLDNUM_CHANGE_TYPE=\"001\")(END_DATE='{}')",
            fmt_date(date)
        );
        let data = self
            .dc_fetch_all(
                "RPT_COOPHOLDERS_ANALYSIS",
                "ALL",
                &filter,
                "STATISTICS_TIMES,COOPERATION_HOLDER_MARK",
                "-1,-1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingStatistic {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                statistics_count: json_i64_opt(v, "STATISTICS_TIMES"),
                avg_change_10d: json_f64_opt(v, "HOLD_10_DAYS_AVG_CHR"),
                max_change_10d: json_f64_opt(v, "HOLD_10_DAYS_MAX_CHR"),
                min_change_10d: json_f64_opt(v, "HOLD_10_DAYS_MIN_CHR"),
                avg_change_30d: json_f64_opt(v, "HOLD_30_DAYS_AVG_CHR"),
                max_change_30d: json_f64_opt(v, "HOLD_30_DAYS_MAX_CHR"),
                min_change_30d: json_f64_opt(v, "HOLD_30_DAYS_MIN_CHR"),
                avg_change_60d: json_f64_opt(v, "HOLD_60_DAYS_AVG_CHR"),
                max_change_60d: json_f64_opt(v, "HOLD_60_DAYS_MAX_CHR"),
                min_change_60d: json_f64_opt(v, "HOLD_60_DAYS_MIN_CHR"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 股东持股变动统计-十大流通股东
    pub async fn stock_gdfx_free_holding_change_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingChange>> {
        let filter = format!("(END_DATE='{}')", fmt_date(date));
        let data = self
            .dc_fetch_all(
                "RPT_FREEHOLDERS_BASIC_INFO",
                "ALL",
                &filter,
                "HOLDER_NUM,HOLDER_NEW",
                "-1,-1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingChange {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                total_holdings: json_i64(v, "HOLDER_NUM"),
                new_positions: json_i64(v, "HOLDER_NEW"),
                increased: json_i64(v, "HOLDER_INCREASE"),
                unchanged: json_i64(v, "HOLDER_UNCHANGED"),
                decreased: json_i64(v, "HOLDER_DECREASE"),
                circulating_market_cap: json_f64_opt(v, "FREE_MARKET_CAP"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 股东持股变动统计-十大股东
    pub async fn stock_gdfx_holding_change_em(&self, date: &str) -> Result<Vec<GdfxHoldingChange>> {
        let filter = format!("(END_DATE='{}')", fmt_date(date));
        let data = self
            .dc_fetch_all(
                "RPT_HOLDERS_BASIC_INFO",
                "ALL",
                &filter,
                "HOLDER_NUM,HOLDER_NEW",
                "-1,-1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingChange {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                total_holdings: json_i64(v, "HOLDER_NUM"),
                new_positions: json_i64(v, "HOLDER_NEW"),
                increased: json_i64(v, "HOLDER_INCREASE"),
                unchanged: json_i64(v, "HOLDER_UNCHANGED"),
                decreased: json_i64(v, "HOLDER_DECREASE"),
                circulating_market_cap: json_f64_opt(v, "FREE_MARKET_CAP"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 个股-十大流通股东
    pub async fn stock_gdfx_free_top_10_em(
        &self,
        symbol: &str,
        date: &str,
    ) -> Result<Vec<GdfxTop10>> {
        let url = "https://emweb.securities.eastmoney.com/PC_HSF10/ShareholderResearch/PageSDLTGD";
        let resp = self
            .get(url)
            .query(&[
                ("code", symbol.to_uppercase().as_str()),
                ("date", fmt_date(date).as_str()),
            ])
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let arr = json
            .get("sdltgd")
            .and_then(|d| d.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(arr
            .iter()
            .enumerate()
            .map(|(i, v)| GdfxTop10 {
                rank: (i + 1) as i64,
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_nature: json_str_opt(v, "HOLDER_NATURE"),
                share_type: json_str_opt(v, "SHARES_TYPE"),
                holding_count: json_f64(v, "HOLD_NUM"),
                holding_ratio: json_f64(v, "FREE_HOLDNUM_RATIO"),
                change: json_str_opt(v, "XZCHANGE"),
                change_ratio: json_f64_opt(v, "CHANGE_RATIO"),
            })
            .collect())
    }

    /// 个股-十大股东
    pub async fn stock_gdfx_top_10_em(&self, symbol: &str, date: &str) -> Result<Vec<GdfxTop10>> {
        let url = "https://emweb.securities.eastmoney.com/PC_HSF10/ShareholderResearch/PageSDGD";
        let resp = self
            .get(url)
            .query(&[
                ("code", symbol.to_uppercase().as_str()),
                ("date", fmt_date(date).as_str()),
            ])
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let arr = json
            .get("sdgd")
            .and_then(|d| d.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(arr
            .iter()
            .enumerate()
            .map(|(i, v)| GdfxTop10 {
                rank: (i + 1) as i64,
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_nature: None,
                share_type: json_str_opt(v, "SHARES_TYPE"),
                holding_count: json_f64(v, "HOLD_NUM"),
                holding_ratio: json_f64(v, "HOLD_RATIO"),
                change: json_str_opt(v, "XZCHANGE"),
                change_ratio: json_f64_opt(v, "CHANGE_RATIO"),
            })
            .collect())
    }

    /// 股东持股明细-十大流通股东
    pub async fn stock_gdfx_free_holding_detail_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingDetail>> {
        let filter = format!("(END_DATE='{}')", fmt_date(date));
        let data = self
            .dc_fetch_all(
                "RPT_F10_EH_FREEHOLDERS",
                "ALL",
                &filter,
                "UPDATE_DATE,SECURITY_CODE,HOLDER_RANK",
                "-1,1,1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingDetail {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                code: json_str(v, "SECURITY_CODE"),
                name: json_str(v, "SECURITY_NAME_ABBR"),
                report_date: json_str(v, "END_DATE"),
                holding_count: json_f64(v, "HOLD_NUM"),
                holding_change: json_f64_opt(v, "XZCHANGE"),
                holding_change_ratio: json_f64_opt(v, "CHANGE_RATIO"),
                holding_change_name: json_str_opt(v, "HOLDNUM_CHANGE_NAME"),
                circulating_market_cap: json_f64_opt(v, "HOLDER_MARKET_CAP"),
                notice_date: json_str(v, "UPDATE_DATE"),
            })
            .collect())
    }

    /// 股东持股明细-十大股东
    pub async fn stock_gdfx_holding_detail_em(
        &self,
        date: &str,
        _indicator: &str,
        symbol: &str,
    ) -> Result<Vec<GdfxHoldingDetail>> {
        let filter = format!(
            "(END_DATE='{}')(HOLDNUM_CHANGE_TYPE=\"{}\")",
            fmt_date(date),
            symbol
        );
        let report = "RPT_F10_EH_HOLDERS";
        let data = self
            .dc_fetch_all(
                report,
                "ALL",
                &filter,
                "UPDATE_DATE,SECURITY_CODE,HOLDER_RANK",
                "-1,1,1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingDetail {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                code: json_str(v, "SECURITY_CODE"),
                name: json_str(v, "SECURITY_NAME_ABBR"),
                report_date: json_str(v, "END_DATE"),
                holding_count: json_f64(v, "HOLD_NUM"),
                holding_change: json_f64_opt(v, "XZCHANGE"),
                holding_change_ratio: json_f64_opt(v, "CHANGE_RATIO"),
                holding_change_name: json_str_opt(v, "HOLDNUM_CHANGE_NAME"),
                circulating_market_cap: json_f64_opt(v, "HOLDER_MARKET_CAP"),
                notice_date: json_str(v, "UPDATE_DATE"),
            })
            .collect())
    }

    /// 股东持股分析-十大流通股东
    pub async fn stock_gdfx_free_holding_analyse_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingAnalyse>> {
        let filter = format!("(END_DATE='{}')", fmt_date(date));
        let data = self
            .dc_fetch_all(
                "RPT_F10_EH_FREEHOLDERS_ANALYSE",
                "ALL",
                &filter,
                "SECURITY_CODE",
                "1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingAnalyse {
                code: json_str(v, "SECURITY_CODE"),
                name: json_str(v, "SECURITY_NAME_ABBR"),
                report_date: json_str(v, "END_DATE"),
                holder_count: json_i64_opt(v, "HOLDER_NUM"),
                holder_count_change: json_i64_opt(v, "HOLDER_NUM_CHANGE"),
                holder_count_ratio: json_f64_opt(v, "HOLDER_NUM_RATIO"),
                avg_holding_amount: json_f64_opt(v, "AVG_HOLD_NUM"),
                avg_market_cap: json_f64_opt(v, "AVG_MARKET_CAP"),
                total_market_cap: json_f64_opt(v, "TOTAL_MARKET_CAP"),
                total_shares: json_f64_opt(v, "TOTAL_A_SHARES"),
                price: json_f64_opt(v, "CLOSE_PRICE"),
                change_pct: json_f64_opt(v, "CHANGE_RATE"),
            })
            .collect())
    }

    /// 股东持股分析-十大股东
    pub async fn stock_gdfx_holding_analyse_em(
        &self,
        date: &str,
    ) -> Result<Vec<GdfxHoldingAnalyse>> {
        let filter = format!("(END_DATE='{}')", fmt_date(date));
        let data = self
            .dc_fetch_all(
                "RPT_F10_EH_HOLDERS_ANALYSE",
                "ALL",
                &filter,
                "SECURITY_CODE",
                "1",
                500,
                10,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxHoldingAnalyse {
                code: json_str(v, "SECURITY_CODE"),
                name: json_str(v, "SECURITY_NAME_ABBR"),
                report_date: json_str(v, "END_DATE"),
                holder_count: json_i64_opt(v, "HOLDER_NUM"),
                holder_count_change: json_i64_opt(v, "HOLDER_NUM_CHANGE"),
                holder_count_ratio: json_f64_opt(v, "HOLDER_NUM_RATIO"),
                avg_holding_amount: json_f64_opt(v, "AVG_HOLD_NUM"),
                avg_market_cap: json_f64_opt(v, "AVG_MARKET_CAP"),
                total_market_cap: json_f64_opt(v, "TOTAL_MARKET_CAP"),
                total_shares: json_f64_opt(v, "TOTAL_A_SHARES"),
                price: json_f64_opt(v, "CLOSE_PRICE"),
                change_pct: json_f64_opt(v, "CHANGE_RATE"),
            })
            .collect())
    }

    /// 股东协同-十大流通股东
    pub async fn stock_gdfx_free_holding_teamwork_em(
        &self,
        symbol: &str,
    ) -> Result<Vec<GdfxTeamwork>> {
        let filter = format!("(HOLDER_TYPE=\"{symbol}\")");
        let data = self
            .dc_fetch_all(
                "RPT_FREEHOLDERS_TEAMWORK",
                "ALL",
                &filter,
                "HOLDER_NUM",
                "-1",
                500,
                1,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxTeamwork {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                holding_count: json_i64(v, "HOLDER_NUM"),
                total_market_cap: json_f64_opt(v, "FREE_MARKET_CAP"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 股东协同-十大股东
    pub async fn stock_gdfx_holding_teamwork_em(&self, symbol: &str) -> Result<Vec<GdfxTeamwork>> {
        let filter = format!("(HOLDER_TYPE=\"{symbol}\")");
        let data = self
            .dc_fetch_all(
                "RPT_HOLDERS_TEAMWORK",
                "ALL",
                &filter,
                "HOLDER_NUM",
                "-1",
                500,
                1,
                &[],
            )
            .await?;
        Ok(data
            .iter()
            .map(|v| GdfxTeamwork {
                holder_name: json_str(v, "HOLDER_NAME"),
                holder_type: json_str_opt(v, "HOLDER_TYPE"),
                holding_count: json_i64(v, "HOLDER_NUM"),
                total_market_cap: json_f64_opt(v, "FREE_MARKET_CAP"),
                holding_stocks: json_str_opt(v, "HOLD_SECURITIES"),
            })
            .collect())
    }

    /// 巨潮-股东持股变动
    pub async fn stock_hold_change_cninfo(&self, symbol: &str) -> Result<Vec<HoldChangeCninfo>> {
        let url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1087";
        let resp = self
            .post(url)
            .form(&[("seccode", symbol)])
            .header("User-Agent", "Mozilla/5.0")
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let records = json
            .get("records")
            .and_then(|r| r.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(records
            .iter()
            .map(|v| HoldChangeCninfo { data: v.clone() })
            .collect())
    }

    /// 巨潮-实际控制人
    pub async fn stock_hold_control_cninfo(&self, symbol: &str) -> Result<Vec<HoldControlCninfo>> {
        let url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1088";
        let resp = self
            .post(url)
            .form(&[("seccode", symbol)])
            .header("User-Agent", "Mozilla/5.0")
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let records = json
            .get("records")
            .and_then(|r| r.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(records
            .iter()
            .map(|v| HoldControlCninfo { data: v.clone() })
            .collect())
    }

    /// 巨潮-管理层明细
    pub async fn stock_hold_management_detail_cninfo(
        &self,
        symbol: &str,
    ) -> Result<Vec<ManagementDetail>> {
        let url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1089";
        let resp = self
            .post(url)
            .form(&[("seccode", symbol)])
            .header("User-Agent", "Mozilla/5.0")
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let records = json
            .get("records")
            .and_then(|r| r.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(records
            .iter()
            .map(|v| ManagementDetail { data: v.clone() })
            .collect())
    }

    /// 东方财富-管理层明细
    pub async fn stock_hold_management_detail_em(
        &self,
        symbol: &str,
    ) -> Result<Vec<ManagementDetail>> {
        let url = "https://emweb.securities.eastmoney.com/PC_HSF10/CompanyManagement/PageAjax";
        let resp = self
            .get(url)
            .query(&[("code", symbol.to_uppercase().as_str())])
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let arr = json.as_array().cloned().unwrap_or_default();
        Ok(arr
            .iter()
            .map(|v| ManagementDetail { data: v.clone() })
            .collect())
    }

    /// 东方财富-管理层人员
    pub async fn stock_hold_management_person_em(
        &self,
        symbol: &str,
    ) -> Result<Vec<ManagementDetail>> {
        let url = "https://emweb.securities.eastmoney.com/PC_HSF10/CompanyManagement/PageAjax";
        let resp = self
            .get(url)
            .query(&[("code", symbol.to_uppercase().as_str())])
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let arr = json.as_array().cloned().unwrap_or_default();
        Ok(arr
            .iter()
            .map(|v| ManagementDetail { data: v.clone() })
            .collect())
    }

    /// 巨潮-股东户数
    pub async fn stock_hold_num_cninfo(
        &self,
        symbol: &str,
        date: &str,
    ) -> Result<Vec<HoldChangeCninfo>> {
        let url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1090";
        let sd = fmt_date(date);
        let resp = self
            .post(url)
            .form(&[("seccode", symbol), ("sdate", sd.as_str())])
            .header("User-Agent", "Mozilla/5.0")
            .send()
            .await
            .map_err(crate::error::Error::from)?
            .error_for_status()
            .map_err(crate::error::Error::from)?;
        let json: serde_json::Value = resp.json().await.map_err(crate::error::Error::from)?;
        let records = json
            .get("records")
            .and_then(|r| r.as_array())
            .cloned()
            .unwrap_or_default();
        Ok(records
            .iter()
            .map(|v| HoldChangeCninfo { data: v.clone() })
            .collect())
    }
}