skip to Main Content

Json – API request – TypeError: string indices must be integers

I develop a simple API request. Here is the code: import requests import json #Get data result = requests.get("https://pkip.riga.lv/documentregistration/divisionregister?district_id=516&division_id=2863") divisions = json.loads(result.content) info_list = [] for info in divisions: info_list.append(info["valid_from"]) print (info_list) div_list = list(dict.fromkeys(info_list)) #Sort div_list.sort() #Print for info…

VIEW QUESTION

JSON from api to html – Javascript

I am pulling json from an API but its format is not familiar to me. It looks like this: {"ok": true, "database": "boe_spending", "query_name": null, "rows": [["CITIBANK NA", 99237716.31], ["MARYLAND STATE RETIREMENT & PENSION SYSTEM", 16438857.25], ["DALY COMPUTERS INC", 9314951.79]],…

VIEW QUESTION
Back To Top
Search