-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.yaml
More file actions
106 lines (106 loc) · 3 KB
/
Copy pathopenapi.yaml
File metadata and controls
106 lines (106 loc) · 3 KB
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
openapi: 3.1.0
info:
title: FinMind API
description: FinMind 金融資料 API,支援台股、期權、總經與全球資料查詢。
version: "4.0"
servers:
- url: https://api.finmindtrade.com/api
security:
- bearerAuth: []
paths:
/v4/data:
get:
operationId: queryDataset
summary: 通用金融資料查詢
description: 依 dataset 名稱查詢 FinMind 資料,可帶 data_id 與日期區間。
parameters:
- name: dataset
in: query
required: true
description: >-
FinMind dataset 名稱(例如 TaiwanStockPrice、TaiwanStockMonthRevenue、
TaiwanFuturesDaily)。FinMind 支援約 90 個走本通用端點的 dataset;
完整清單與每個 dataset 的必填參數、會員層級,請參考已上傳的
knowledge bundle,並只使用其中列出的名稱,不要自行編造。
schema:
type: string
- name: data_id
in: query
required: false
description: 標的代號(股票、期貨、幣別等),部分 dataset 必填。
schema:
type: string
- name: start_date
in: query
required: false
description: 起始日期 YYYY-MM-DD。
schema:
type: string
format: date
- name: end_date
in: query
required: false
description: 結束日期 YYYY-MM-DD。
schema:
type: string
format: date
responses:
"200":
description: 查詢成功
content:
application/json:
schema:
$ref: "#/components/schemas/DataResponse"
"401":
$ref: "#/components/responses/Unauthorized"
"402":
$ref: "#/components/responses/PaymentRequired"
"5XX":
$ref: "#/components/responses/UpstreamError"
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
schemas:
DataResponse:
type: object
properties:
status:
type: integer
example: 200
msg:
type: string
example: success
data:
type: array
description: 結果列陣列,欄位依 dataset 而異。
items:
type: object
additionalProperties: true
Error:
type: object
properties:
status:
type: integer
msg:
type: string
responses:
Unauthorized:
description: Token 無效或未設定
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
PaymentRequired:
description: 此 dataset 需 sponsor 方案
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
UpstreamError:
description: 上游暫時無法連線
content:
application/json:
schema:
$ref: "#/components/schemas/Error"