question

Upvotes
Accepted
11 3 3 7

How to pull exchange by day in Tick History V 2.0.

Can someone please post a description of the JSON request to pull back exchange by day files under the new tick history API. In the old version we simply downloaded the exchange by day files from their respective folders (e.g. corporate actions, market data etc) from a single ftp location. In the new system it appears you actually have to make calls to pull back these files. Can you please post an example of what the JSON Request should look like to get back different files such as corporate actions, market data, etc. Also can you refer me to where in the documentation this service is located?

pythontick-history-rest-apijsonvenue-by-day
icon clock
10 |1500

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

14 Answers

Upvotes
Accepted
23k 22 9 14

I think you are looking to retrieve Venue By Day, VBD files?

If this is correct, please refer to REST API Tutorial 2: Retrieving VBD files

If this is different, please update the question with more detail?

Thanks

icon clock
10 |1500

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

Upvotes
13.7k 26 8 12

@noah.kauffman, to add to Zoya's reply, on the topic of documentation:

  • VBD extractions are also called "Standard extractions".
  • VBD relevant calls are documented in the REST API User Guide chapter 11.
  • The REST API Reference Tree is the API call reference describing all calls with their input parameters and outputs.

To experiment you can also run VBD calls and display the corresponding HTTP requests and responses using the C# example application, which has example calls under its section "Standard Extractions" (refer to screenshot below). The C# example application installation and usage are described in the Quick Start. Even though it is called the C# example application, as it displays HTTP requests and responses it is useful whatever programming language you use.


icon clock
10 |1500

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

Upvotes
11 3 3 7

Thanks for the response. Any chance you could post a python file with an example call? That would be super helpful. Otherwise, can you simply explain what the JSON Request should look like? I'm running the following request string and getting a 400 response.:

requestUrl='https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages'
requestHeaders={
    "Prefer":"respond-async",
    "Content-Type":"application/json",
    "charset":"utf-8",
    "Authorization": "token " + token
}




requestBody= {
  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#UserPackages",
  "value": [
    {
      "UserPackageId": "0x0460dc1d24a62cb1",
      "PackageId": "0x0460dc1d24a62cb1",
      "PackageName": "US Insider Trading Model v3",
      "SubscriptionId": "0x0400dc1d24a00cb3",
      "SubscriptionName": "Insider"
    },
    {
      "UserPackageId": "0x04f21a8d1a559cb1",
      "PackageId": "0x04f21a8d1a559cb1",
      "PackageName": "CSI - CHINA SECURITIES INDEX COMPANY",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f9cf0080e59cb1",
      "PackageId": "0x04f9cf0080e59cb1",
      "PackageName": "ZHC - China Zhengzhou Commodity Exchange",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f9cf0080a59cb1",
      "PackageId": "0x04f9cf0080a59cb1",
      "PackageName": "TOJ - Asia Composite",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f21a8d23f59cb1",
      "PackageId": "0x04f21a8d23f59cb1",
      "PackageName": "MCE - BME SPANISH EXCHANGE EQUITIES LEVEL 2",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f21a8d2a359cb1",
      "PackageId": "0x04f21a8d2a359cb1",
      "PackageName": "SAP - Sapporo Stock Exchange",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f21a8d20859cb1",
      "PackageId": "0x04f21a8d20859cb1",
      "PackageName": "JNX - SBI JAPANNEXT PTS Level 2",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    },
    {
      "UserPackageId": "0x04f21a8d2c059cb1",
      "PackageId": "0x04f21a8d2c059cb1",
      "PackageName": "SHF - Shanghai Futures Exchange",
      "SubscriptionId": "0x0400dc1d24a00cb4",
      "SubscriptionName": "TRTH Venue by Day"
    }
  ]
}


r2 = requests.post(requestUrl, json=requestBody,headers=requestHeaders)


icon clock
10 |1500

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

Upvotes
23k 22 9 14

I do not have VBD python script to share but the tutorial REST API Tutorial 2: Retrieving VBD files contains the complete details and requests, and sample responses for the steps that are necessary to retrieve VBD.

In the most basic form, they are:

Get available packages, with PackageIds:

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages

Get specific VBD file list by PackageId:

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1') 

Get specific VBD file:

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveries('0x05a61154de8b3016')/$value 

Does this help?

icon clock
10 |1500

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

Upvotes
11 3 3 7

So I took a look at the tutorial, which is how I came to form that JSON request in the first place (it's the example they give in the documentation). However, I receive a 400 response from the request string mentioned in the tutorial. If you cannot provide an example in python would you at least be able to provide a sample JSON request string that we should be using? Thanks much!

icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hi @noah.kauffman,

Just to see how to request and use token in python, please refer to Python example in

TRTH Downloads Section

icon clock
10 |1500

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

Upvotes
11 3 3 7

I'm able to connect and download reports for tick data on demand. However, that example has three components to a call (a) requestUrl (b) requestHeader and (c) requestBody.

What you have told me is that for the type of call described that no request body should be sent. However, what I am seeing is that calling as follows:

requestUrl='https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages'
requestHeaders={
    "Prefer":"respond-async",
    "Content-Type":"application/json",
    "charset":"utf-8",
    "Authorization": "token " + token
}
r2 = requests.post(requestUrl, headers=requestHeaders)

... Results in a response code of: 400

And more simply calling with the following ...

requestUrl='https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages'
r2 = requests.post(requestUrl)

....

Leads to a response code of 401.

Could you please specify how this call is supposed to be made without requestBody, because I'm not able to get it to work.

icon clock
10 |1500

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

Upvotes
11 3 3 7

request-example-python.txt

Please see attached code, which generates a 400 response. Can you please let me know what the request call is supposed to look like if it is not supposed to look as I currently have it. Thanks!


icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @noah.kauffman,

Please note, the request should be GET, not POST for VBD, please try the following

 requestUrl='https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages'
requestHeaders={
    "Prefer":"respond-async",
    "Content-Type":"application/json",
    "Authorization": "token " + token
}
r2 = requests.get(requestUrl, headers=requestHeaders)

please let us know if you get back 200/202 status + data

icon clock
10 |1500

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

Upvotes
11 3 3 7

nevermind - deleting last comment about packageids returning the same value.

icon clock
10 |1500

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

Upvotes
11 3 3 7

I'm receiving response code 400 when pulling for the following exchanges ...

Error 1:

NMS - NASDAQ Stock Market Exchange Large Cap (formally known as NASDAQ NATIONAL MARKET SYSTEM)

package_id: 0x04f21a8d26859cb1

GET: https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d26859cb1')


Error 2: 

NSQ - Consolidated Issue Listed on Nasdaq Global Select Market

package_id: 0x04f21a8d27059cb1

GET: https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d27059cb1')

other exchanges are working fine. Any idea why the error with the above exchanges?

icon clock
10 |1500

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

Instead of /Packages

try

/UserPackages

to get the list, and this command will yield only packages your user is entitled for. Check if you are entitled to NASDAQ VBD.

Hi @noah.kauffman ,

I have just tested with these two ids, and these two do not come up, for me too. This is a suspected content missing issue, so the best way to investigate this is to open a content-related inquiry via My Account or to call Thomson Reuters Helpdesk to report this is happening and ask to investigate.

Upvotes
11 3 3 7

ok - all good now. thanks!

icon clock
10 |1500

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

Upvotes
11 3 3 7

So where do I submit the ticket regarding missing exchanges which I should be credentialed for.. is that via https://tickhistory.thomsonreuters.com/TickHistory/login.jsp or through another site?

icon clock
10 |1500

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

Upvotes
23k 22 9 14

The best way to get a content issue that you suspect, looked and investigated by the appropriate content group, is by MyAccount Raise A Case or by calling Thomson Reuters Helpdesk.

icon clock
10 |1500

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

Click below to post an Idea Post Idea