A
A
Alexey2019-03-26 00:03:47
API
Alexey, 2019-03-26 00:03:47

How to export data received via API to CSV?

Hello!
There is an example of getting data via API, it looks like this

curl -H 'ecom-auth: ...' \
     -H 'Content-Type: application/json' \
     https://api2.xxxxx.com/integrat/v1/products

The response is a list of products.
Tell me how to get a response in the form of a link to a CSV file of goods?
Preferably with an example ....
I would be very grateful!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2019-03-26
@2ord

1. Get data via API.
2. Parse JSON by putting the list of products into a variable of the list type.
3. Open the CSV file for writing and serialize each element of the product list as a string in CSV format.
4. Upload to some server (HTTP, FTP) and get the path to the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question