Skip to content
Advertisement

What is the best way to combine multiple ndjson urls from a REST API?

My goal is to extract all of the urls and add a get request to each ndjson file; however, this can be complicated when there are more 10 urls. Is there a better way to do this or do I need to put multiple GET requests in and then join the ndjson files and then parse the data.

JavaScript

Output:

JavaScript
JavaScript

Output:

JavaScript

I currently add multiple GET requests here:

JavaScript

Advertisement

Answer

If I understood your question correctly, you send some request which returns you provided JSON object. You need to send requests to every url from this object and merge data into a single container (e.g. dict).

JavaScript

Normally ndjson is a list of JSON objects separated by newline char, so without actual data it’s not possible to help with code which will store this data in proper (for future parsing) format.

Advertisement