question

Upvotes
Accepted
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
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.

Upvotes
Accepted
25.1k 68 15 21

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.

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.

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.

Upvotes
25.1k 68 15 21

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

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.

Upvotes
32.2k 41 11 20

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.

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.

Upvotes
11.3k 26 9 14

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
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.