question

vinod.amarnath avatar image
1 1 2 0

TRTH REST API - Could you please provide python API code to retrieve extraction ID and also Python code to download extracted file.

@vinod.amarnath

pythontick-history-rest-apirest-api
10 |1500

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

Gurpreet avatar image
14.7k 39 12 18

Hi @vinod.amarnathm

Please take a look at Python samples in the downloads tab of TRTH API. You can also look at Refinitiv API samples github site, and search for TRTH and filter by Python.

If you are still unable to find what you need, ask here again, and we will put something together.

1 comment
10 |1500

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

Hi @Gurpreet. Thank You. I did checked on all searches and posted here. All I got was Scheduling or using specific report templates with python.

I am looking specifically to

python API code to retrieve extraction ID and also Python code to download extracted file.

Gurpreet avatar image
14.7k 39 12 18

Which extraction endpoint are you trying to invoke, and what are the parameters.

10 |1500

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

zoya faberov avatar image
28.3k 30 11 15

Hello @vinod.amarnath,

Does Python Code Examples in TRTH Downloads Section, example TRTH OnDemand Intraday look to be what you are looking for? Request and retrieve IntradayBars in python?

jobId = Extraction ID.

Please find the explanation of the approach to asynchronous request processing in this tutorial.

10 |1500

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

veerapath.rungruengrayubkul avatar image
11.3k 25 8 13

Hi @vinod.amarnath,

The TRTH Python Code Samples in the download tab contains the TRTH_Get_Latest_Schedule_Files example. The example demonstrates how to retrieve last extraction id and download the extraction files for a given schedule name. Below are the list of provided functions:

  • Get authentication token
  • Get the schedule ID from the schedule name
  • Get the report extraction ID for the last extraction of a schedule
  • Get the extracted file list, with for each file its ID, type, name and size
  • Download and save a file to disk (the file is referenced by its file ID)
  • Download and display the extraction notes file, without saving them to disk
  • Read and display a text file (from hard disk)
  • Read, decompress and display a zipped text file
  • Read, decompress and display a gzipped text file
10 |1500

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