A
A
Andrey2018-03-02 15:25:06
Python
Andrey, 2018-03-02 15:25:06

How to parse info from qiwi api Python?

I need to display data by keys, but I can’t figure out how to parse them correctly.
(requests).
The basic commands are correct (I hope):

get = requests.get(apiurl, headers=auth)
get.encoding = 'utf-8'
trans = (get.text)
data = json.loads(trans)

No matter how I tried, I get a KeyError.
https://developer.qiwi.com/ru/qiwi-wallet-personal...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
power mind, 2018-03-02
@dkdoter

In python, KeyError usually occurs when you try to get a value from a dictionary given a key that is not in it. There, before the KeyError itself, there should be something like

File "", line 1, in

There should be an error in this line
PS: throw off the text of the program and the result of the execution, because I did not quite understand the problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question