串接資料API格式


一、 API認證流程

1.流程圖

2.步驟

(1)驗證:利用數據貓頭鷹所提供之AppID 與 AppSecret 呼叫取得交易驗證碼API,可取得交易驗證碼(Token)

(2)取資料:將步驟一取得的交易驗證碼與查詢商品規格呼叫商品API,可取得所需的資料

**交易驗證碼時效為24小時,失效時,取用商品會回傳狀態訊息401,請重新取用交易驗證碼即可**

 

二、AppID與AppSecrect

1.於數據貓頭鷹網站中點選使用者圖式,可進到使用者資訊頁面

2.於畫面的左方為AppID 與 AppSecret

 

三、API格式

1.Http Header與參數格式

2.Http Header 與參數格式範例

 

3.呼叫網址格式

4.呼叫網址格式範例

 

四、回傳內容

1.回傳種類

Json Xml Csv Excel(.xlsx)

2.驗證回傳格式(json為例)

{'token': 'eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyMDE4MDEzMDE0MzgxMDY0MSIsImV4cCI6MTUzNjM3OTc5OX0.JisBN5adZMj1loBtWY5z5WOrcBYhEU0p2wdJ_R32pTMikW2Ws1gQXFu5y3-gYtfptcmf9DzyTwsAclzHCicCRw'}

3.資料回傳格式(json為例)

{"Title":["年月","股票代號","股票名稱","預估年營收(千)","累計營收達成率(%)","單月營收(千)","去年單月營收(千)","單月營收年成長(%)","單月營收月變動(%)","累計營收(千)","去年累計營收(千)","累計營收成長(%)","近三月營收(千)","近三月營收年成長(%)","近三月營收月變動(%)","近12月累計營收(千)","近12月營收成長(%)","淨值(千)","資金貸放餘額(千)","資金貸放佔淨值比(%)","背書保證單月金額(千)","背書保證累計餘額(千)","背書保証累計餘額佔淨值比(%)","重要子公司本月營業收入淨額(千)","重要子公司本年累計營收淨額(千)","公告日"],"Data":[["201807","2330","台積電","","","74370924","71611190","3.85","5.58","555726406","519380802","7","225777954","-1.23","-9.76","1013792845","4.99","1605898389","0","0","6241","2546743","0.16","","","20180810"],["201806","2330","台積電","","","70438298","84187305","-16.33","-13.01","481355482","447769612","7.5","233276811","9.08","-5.97","1011033111","4.19","1605898389","0","0","46599","2540502","0.16","","","20180710"],["201805","2330","台積電","","","80968732","72795974","11.23","-1.1","410917184","363582307","13.02","266535950","23.66","13.77","1024782118","5.91","1605898389","0","0","36365","2493903","0.16","","","20180608"]]}

 

五、錯誤狀態訊息

 

 

有任何意見/疑問歡迎到粉絲專業:數據貓頭鷹CMoney留言私訊小編唷