Answer the question
In order to leave comments, you need to log in
How to work with such json?
I make an API request and get this response:
[{
'pl': 'Категория',
'vl': 'Техника для красоты и здоровья',
'p': 'category',
'v': 15060
}, {
'pl': 'Тип сделки',
'vl': 'Продажа',
'p': 'type',
'v': 'sell'
}, {
'pl': 'Вся Беларусь',
'vl': 'Гомельская',
'p': 'region',
'v': 2
}, {
'pl': 'Город / Район',
'vl': 'Гомель',
'p': 'area',
'v': '5'
}, {
'pl': 'Тип оплаты',
'vl': 'Цена',
'p': 'remuneration_type',
'v': '1'
}, {
'pl': 'Тип',
'vl': 'Электромассажеры',
'p': 'health_equipment_type',
'v': '60'
}, {
'pl': 'Производитель',
'vl': 'Другой',
'p': 'health_equipment_brand',
'v': '100'
}, {
'pl': 'Запчасть',
'vl': '-',
'p': 'appliances_spare_part',
'v': False
}, {
'pl': 'Состояние',
'vl': 'Б/у',
'p': 'condition',
'v': '1'
}, {
'pl': 'Товары с Куфар Доставкой',
'vl': 'Да',
'p': 'delivery_enabled',
'v': True
}, {
'pl': 'Товары с Куфар Оплатой',
'vl': 'Да',
'p': 'safedeal_enabled',
'v': True
}, {
'pl': 'Возможна доставка',
'vl': '-',
'p': 'delivery_pro',
'v': False
}, {
'pl': 'Возможна рассрочка',
'vl': '-',
'p': 'installment_pro',
'v': False
}, {
'pl': 'Возможен обмен',
'vl': '-',
'p': 'possible_exchange',
'v': False
}]
'pl': 'Город / Район',
'vl': 'Гомель',
'p': 'area',
'v': '5'
{'pl': 'Тип сделки', 'vl': 'Продажа', 'p': 'type', 'v': 'sell'}
Answer the question
In order to leave comments, you need to log in
This is not json )
But if you want to get data, then for example, by the key 'vl': 'Gomel':
next(filter(lambda x: x['vl'] == 'Гомель', a))
# {'pl': 'Город / Район', 'vl': 'Гомель', 'p': 'area', 'v': '5'}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question