INNER CODE UNIT · Python
get_THB_IMPL_INT_RATE
adminho/trading-stock-thailand · BOT_API_example.py:258
def get_THB_IMPL_INT_RATE(startDate, endDate):
return _fetch_all_rate("https://iapi.bot.or.th/Stat/Stat-ThaiBahtImpliedInterestRate/THB_IMPL_INT_RATE_V1/",
startDate, endDate,
_df_THB_IMPL_INT_RATE)
"""
# ปัญหาแต่ละ API ต้องการพารามิเตอร์ที่แตกต่างกัน
# ผมเลยเลือกทำ API แค่ 2 ตัวก่อน
def get_AllDailyRate(startDate, endDate):
df1 = get_DAILY_REF_RATE(startDate, endDate)
df2 = get_DAILY_AVG_EXG_RATE(startDate, endDate)
# for debug
df1.to_csv("daily_rate_test.csv")
df2.to_csv("daily_avg_exg_rate_test.csv")
df_merge = df1.join(df2, how="left")