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

C# deserialize KeyValuePair from JSON

This is the absolute simplest version of this question (a subset of it). using System; using System.Collections.Generic; using System.Text.Json; public class Program { public class Subscription { public bool HasRead { get; set; } = true; public string TimeStamp {…

VIEW QUESTION
Back To Top
Search