Json 选择dict中具有相同键的所有值

Json 选择dict中具有相同键的所有值,json,python-3.x,dictionary,Json,Python 3.x,Dictionary,我正在使用API从公司获取一些财务数据 原料药 如何选择关键收入的所有值 import urllib.request import json income_statement = ('https://financialmodelingprep.com/api/v3/financials/income-statement/TD') response = urllib.request.urlopen(income_statement) parseResponse = json.loads(res

我正在使用API从公司获取一些财务数据

原料药

如何选择关键收入的所有值

import urllib.request
import json

income_statement = ('https://financialmodelingprep.com/api/v3/financials/income-statement/TD')

response = urllib.request.urlopen(income_statement)
parseResponse = json.loads(response.read())

test = (parseResponse['financials'][0]['Revenue'])

这将给我一个数字,但不是所有的关键=收入

您需要遍历
financials
数组,并将所有收入存储在另一个数组中。差不多

all_revenue = [item['Revenue'] for item in parseResponse['financials']]