Skip to content
Advertisement

Tag: json

Error in making POST request to django API

From post man, I’m trying to make POST request to an order API created using django restframework but I’m getting the following error: The specific point where the error is located is specified in the error but I find difficulty constructing VALID json for the request body. Here is how I’m making the request on postman: Here is the program:

Writing a List of Dictionaries to seperate JSONs

I do have dictionary, with each value as a list. I want to write individual items to separate JSON files. For example Now I want 3 jsons i.e data1.jsob, data2.json, data3.json in the following(approx) format. data1.json data2.json and so on. My current approach is But this is wrong. Any helps appreciated. Answer You could use pandas to do the work

Adding and saving to list in external json file

I’m very new to Python and I’m struggling when it comes to saving the data that the user has entered to a json file when quitting the application. Also every time I run my code all the data inside the json file is wiped. When I enter the input to save and exit I get this error code: Here is

Extract data from json in these format

I’ve been messing around with JSON for some time, just pushing it out as text and it hasn’t hurt anybody (that I know of), but I’d like to start doing things properly. this is my code : this is my json file: my output is these: I want output like in these format as you have shown in the pic

How do I extract all keys from this JSON file?

The data I’m working with is the entire list of yugioh cards, found at this endpoint: https://db.ygoprodeck.com/api/v7/cardinfo.php There’s a top-level data node that I can ignore, but each sub-node immediately after that (0, 1, 2,…) is a unique card in the cardset. I want to find out how many unique keys there are in this entire dataset. The tricky part

How to extract all symbol and last_price from this json?

I tried like this, but it doesn’t work. It worked with an other json file (https://www.binance.com/fapi/v1/ticker/price) I think it’s because the beginning and end is different. There is some parts before the bracket and after. I got the error: symbol = (pair[‘symbol’]) TypeError: string indices must be integers Answer e contains some other information. The data that you want is

missing some messages in websocket client?

I am trying to implement a websocket client that connects to the popular crypto exchange FTX. I have simplified my problem to the following example code below: The output of the program overall is as expected, but with one major problem: the cumulative trading volume that gets output to the console is WAY too low. It should be about 1,000x-10,000x

How do i remove a specific json value in python?

I’m making a playlist website that can create display and delete playlists and songs. I’m using a JSON file to store the data. The only feature that isn’t working is the delete song feature. This is my JSON file I’m using the ID of the playlist and the index of the song to locate it in the list and using

Advertisement