S
S
sidorikv2020-11-16 08:39:59
API
sidorikv, 2020-11-16 08:39:59

How to get information from huge json array?

Hello everybody!
I make a request to the site using its api:
https://api.nike.com/product_feed/threads/v2/?anch... It gives out
a huge array of information from which you need to get just the productid of the desired sneakers, how to do this?
I am writing a discord bot and here is an example:
The user will throw a link to the product to the bot: https://www.nike.com/ru/launch/t/dunk-low-ceramic
And the bot should give him a list (I attach a screenshot)
5fb2102fb3822686249401.jpeg
It contains sizes and links to these sizes of such a plan:
https://www.nike.com/ru/launch/t/dunk-low-veneer?p...
Where:
https://www.nike.com/ru/launch /t/ - constant url
dunk-low-veneer - model name (will be in the thrown url)
?productId=6fc6ef30-5402-54f1-9bff-1e768c397194 - will change depending on the model
&size=9 - will change depending on the size

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Palych, 2020-11-16
@xzKakoyLogin

The link contains the following parameters: anchor, count, filter and fields. Use filter, fields to get only the data you need, or anchor and count for pagination.

S
Sergey Pankov, 2020-11-16
@trapwalker

get information from huge json array

I thought you had a problem reading a really huge JSON file. This happens when the file does not fit in memory, but something needs to be retrieved from it. You have to read the JSON file with a SAX parser so as not to put all the data in RAM.
But the problem here is obviously something else.
According to a fuzzy task for the author of the question, it is necessary to write a code that trivially converts json to a simpler structure.
It's just that the author of the question does not know how, but this does not prevent him from writing a bot.
You should proceed to the freelance exchange with this question, or formulate specifically what exactly you do not understand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question