[{
"last_upd_date": "2018-10-20T05:33:29",
"class_abbr_name": "-",
"reference_period": "1_year",
"performance_type_desc": "ความผันผวนของกองทุนรวม",
"performance_val": "9.9300",
"as_of_date": "29 มิถุนายน 2561"
}, {
"last_upd_date": "2018-10-20T05:33:29",
"class_abbr_name": "-",
"reference_period": "1_year_percentile",
"performance_type_desc": "ความผันผวนของกองทุนรวม",
"performance_val": "75.0000",
"as_of_date": "29 มิถุนายน 2561"
}, {
"last_upd_date": "2018-10-20T05:33:29",
"class_abbr_name": "-",
"reference_period": "10_year",
"performance_type_desc": "ความผันผวนของกองทุนรวม",
"performance_val": "20.8700",
"as_of_date": "29 มิถุนายน 2561"
}, {
"last_upd_date": "2018-10-20T05:33:29",
"class_abbr_name": "-",
"reference_period": "10_year_percentile",
"performance_type_desc": "ความผันผวนของกองทุนรวม",
"performance_val": "95.0000",
"as_of_date": "29 มิถุนายน 2561"
}]
I'm connecting to the API, and I want to extract the data to a dataframe. all the data above are only for one key. Maybe can I put this into a hierarchy table? Code
for proj_id in all_funds.proj_id:
req = limiter.call_get_api(url=f'https://api.sec.or.th/FundFactsheet/fund/{proj_id}/performance')
print(proj_id)
new_type = pd.read_json(req.content, typ='series', lines=True)
print(new_type)
past_return = past_return.append([{'proj_id': proj_id, 'performance_type_desc': new_type.get('performance_type_desc'),'performance_val':new_type.get('performance_val'),'as_of_date':new_type.get('as_of_date') }], ignore_index=True)
I've tried this, but it doesn't work since all the entry is all none. Are they any ways to put all this in a dataframe? It can be in any form.
Thank you so much