question

Upvotes
Accepted
49 3 6 9

TickHistoryRaw Rest API received response not formatted

I am using TickHistoryRaw Rest API while providing few Fids in the extraction request. I am using Python and used the same tutorial logic provided in Refinitiv tutorials. The response i am saving in gzip format and then unzipping it which is csv file. Below is my Python file: Python_TickHistoryRaw.txt

When i opened csv its not formatted and the columns fields are inserted as rows which is very difficult to read and also i dont want to save this unformatted data to my Oracle databse table.

The FID Name column values normally this should be displayed in column section according to FIDS i have provided in the extraction request:

ASK

ASKSIZE

SEQNUM

BID

BIDSIZE

NUM_MOVES

TRD_IND_1

TRDPRC_1

TRDVOL_1

AGGRS_SID1

QUOTIM_NS

SALTIM_NS


So normally for every Key/Msg Sequence Number it will be my one row...This way i can also reduce the volume of the data and i can also insert this data in my database table and which is easily readable.


When i tried to extract the csv from Refinitiv gui template: https://select.datascope.refinitiv.com/DataScope/extractions/reports/create/TickHistoryTimeAndSales

i received the same response which i am getting now.


Can anyone please help here ? Currently for one instrument i am getting almost 1.4billion records just for previous 1 day request. If i get solution i can also reduce volume.



tick-history-rest-apiextraction
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
14.7k 39 12 18

Hi @rahul.deshmukh ,

Unfortunately the RAW output that you are requesting is in this format. It is designed to cover every asset class across every venue and different market data type like orderbooks etc and so there is no clean way to show that in a CSV file. You can write some cleanup routines using pandas before importing it into your database.

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
49 3 6 9

@Gurpreet i was searching for some examples in Refinitiv forum because this is very complex and tedious to map and organize rows into columns in CSV ....i was thinking the CSV itself should be created after parsing and then it can be loaded easily in database..Do we have any example ?

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.

No, we don't have any such example of parsing and normalization. Have you seen other Tickhistory extractions to see if maybe Time and Sales meets your requirements.
@Gurpreet yes we already checked and the Time and Sales doesnt provide tick history raw nanosecond data and it has missing trading prices history...i will try to see how i can parse this csv file...