For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
5 2 2 4

Using Python, how can I save the content of “response_text” into a csv file?

Using Python, how can I save the content of “response_text” into a csv file? Probably a very quick one

Thanks!


pythondss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
7.6k 15 6 9

@zoe

Do you mean the response message from the On-demand Extraction request?

There are many ways in python and you can find it on the internet.

You can just open the file and write the data from the response raw data like below sample codes where r is a response.

with open(fileName, 'wb') as fd:
   fd.write(r.raw.read())

You may also read the below article, it a good article explains how to optimize your codes to download the data. It should be able to apply to your case as well.

https://developers.refinitiv.com/article/how-optimize-trth-tick-history-file-downloads-python-and-other-languages

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.