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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
20 0 0 2

DSS extract raw - gzip

According to the guide, we did 2 steps for extracting using DSS rest api:

Step 1:  url1 - https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractRaw 
Step 2: url2 - https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/RawExtractionResults('$JOBID')/$value

$JOBID is obtained in step 1.

In step 2, we set the header:

requestHeaders['Accept-Encoding'] = 'gzip'

When we get the response data from step 2,

resp = requests.get(url2, headers = requestHeaders)

data is sitting in resp.text and could directly save into a csv file.

What's the role of 'gzip' here? We don't see any zipping/compressing.

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

@Liang.Xue

Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@Liang.Xue

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
22.1k 59 14 21

Hi @Liang.Xue,

It is advisable to start with a Refinitiv sample and then modify it to your needs.

In most languages, the content decoding is automatically handled by the library - which in this case is the requests module. The actual binary transfer on the wire is gzipped.

If you would like to not have automatic decoding of the binary data (which is a requirement for very large direct data download from AWS), you should set the flag:

req.raw.decode_content = False

See this article on direct AWS downloads.

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.