# Accessing historical data & histogram

**URL:** <https://community.tradovate.com/t/accessing-historical-data-histogram/2479>\
**Category:** Community Support\
**Created:** [June 10, 2021, 10:33pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479 "2021-06-10T22:33:09Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boomerang](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Boomerang](https://community.tradovate.com/u/Boomerang)\
**Post date:** [June 10, 2021, 10:33pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/1 "2021-06-10T22:33:09Z")

</div>

Okay, as a basic example, I’m sending the follow message to access “@NQ” data (continuous):

```auto
            symbol: "@NQ",
            chartDescription: {
              withHistogram: true,
              elementSize: 5,
              elementSizeUnit: "UnderlyingUnits",
              underlyingType: "MinuteBar",
            },
            timeRange: {
              asMuchAsElements: 300,
              //closestTimestamp: "2021-04-04T19:45:00.000Z", // Enable this to use historical
            },

```

This allows me to access 5m bars on the “@NQ” with histograms intact. To go back further, I enable

> closestTimestamp

and I am able to go back ~2 months, BUT, if I keep the following enabled

> withHistogram: true

It just returns, which I presume means no data:

> a[{“s”:200,“i”:2,“d”:{“mode”:“RealTime”,“historicalId”:743368,“realtimeId”:743368}}]  
> a[{“e”:“chart”,“d”:{“charts”:[{“id”:743368,“eoh”:true}]}}]

When I disable the histogram, I am able to access 5m bars back 2 months. When I then try to go back 3 or 4 months by adjusting `closestTimestamp`, it doesn’t seem to work.

I think I’ve read the “@NQ” goes back to 2017, but is there some other way I should be accessing this historical market data (5m bars) as well as associated histograms?

Thanks for your help and I appreciate your clarification! Great API nonetheless

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [June 13, 2021, 5:25am UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/2 "2021-06-13T05:25:35Z")

</div>

You can get more historical data by changing `underlyingType` from `"MinuteBar"` to `"DailyBar"`. You can only get about 2 months of data using minute bars but you can get a great deal of historical data (back to 2015 using `@NQ`) if you look at `"DailyBar"`. Try using this data for your chart:

```auto
{
    "symbol": "@NQ",
    "chartDescription": {
        "underlyingType": "DailyBar",
        "elementSize": 1,
        "elementSizeUnit": 'UnderlyingUnits',
    },
    "timeRange": {
        "closestTimestamp": "2021-06-10T19:45:00.000Z",
        "asFarAsTimeStamp": "2017-12-01T19:45:00.000Z"
    }            
}

```

---

<div class="post-metadata">

**Author:** ![Benjamin\_Parrish](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@Benjamin\_Parrish](https://community.tradovate.com/u/Benjamin_Parrish)\
**Post date:** [June 13, 2021, 8:45pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/3 "2021-06-13T20:45:02Z")

</div>

i assume theres no available tick-by-tick data, right? I know that’s definitely a long shot but figured I’d ask. thanks!

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [June 14, 2021, 12:57am UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/4 "2021-06-14T00:57:30Z")

</div>

You can request tick data as well using a websocket for market data. Check this part of the API docs out:  
[https://api.tradovate.com/#section/Request-Reference/Cancel-Chart](https://api.tradovate.com/#section/Request-Reference/Cancel-Chart)

---

<div class="post-metadata">

**Author:** ![Boomerang](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Boomerang](https://community.tradovate.com/u/Boomerang)\
**Post date:** [June 20, 2021, 7:03pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/5 "2021-06-20T19:03:35Z")

</div>

@Alexander

I’m able to access live tick data, but is there a way to access historical? I vaguely remember reading somewhere we should be able to access 1 year of tick data?

Otherwise I need to record the data for a while before I can use this model I’m building.

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [June 21, 2021, 12:19pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/6 "2021-06-21T12:19:04Z")

</div>

Hello @Boomerang,

You can get up to 1 year of historical tick data if you have the Extended Data addon (currently $9.95/month). With no extended data subscription, you’ll get about two months of historical tick data.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Parrish](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@Benjamin\_Parrish](https://community.tradovate.com/u/Benjamin_Parrish)\
**Post date:** [August 19, 2021, 3:05pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/7 "2021-08-19T15:05:42Z")

</div>

@Alexander – is historical DOM data available as well?

---

<div class="post-metadata">

**Author:** ![biggy8133](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@biggy8133](https://community.tradovate.com/u/biggy8133)\
**Post date:** [August 22, 2021, 5:03pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/8 "2021-08-22T17:03:32Z")

</div>

@Alexander  
Can I access more than 1-2months of 1min intraday data (like 1-2 years), if I obtain the “Extended Data addon” or is the max historical data available for download via API for 1min data, set to about 1-2months?  
I just figured there has to be a way to get access more OHLC intraday 1 minute data than 1-2months worth, especially with continuous contracts.

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [August 23, 2021, 12:07pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/9 "2021-08-23T12:07:34Z")

</div>

@Benjamin_Parrish To an extent, yes. If you use Market Replay you can analyze historical DOM data for that replay session. @biggy8133, see my above comment. You can purchase the extended tick data add-on allowing you to access a year of historical data.

---

<div class="post-metadata">

**Author:** ![biggy8133](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@biggy8133](https://community.tradovate.com/u/biggy8133)\
**Post date:** [August 23, 2021, 4:35pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/10 "2021-08-23T16:35:29Z")

</div>

Thanks for the update @Alexander. I read the above comment you posted but it did not quite answer my question. My specific question relates to 1min and 30 second OHLC data. I need to get a hold of 1+ years of it. I do not need tick data. Right now when I create an API request for 1min data, it only sends me back about 1-2months of data(around 29k data points).  
I spoke with customer rep and they told me that when they pull up the continuous contract on the web version of Tradovate, that they can see much more than 1-2 months of 1minute data on the chart, yet when I pull the 1min data from API, I am still limited to 29k data points. Not sure why this is happening…?

Therefore, my question is,  
what exactly do I need to do in order to get 1+ years of 1minute data through the API?

Do I need to order the extended data add on in order to get 1+ years of 1min and 30 second data for products such as NQ and ES?

or

Has the API not been updated yet to send 1+ year of data for the 1minute timeframe?

Please advise on this. @Alexander@BWeis

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [August 24, 2021, 2:52pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/11 "2021-08-24T14:52:54Z")

</div>

For minute-based charts, you actually shouldn’t need to purchase the extended data - only for raw tick data. Can you please share your request parameters that you are using currently with the `getChart` endpoint?

---

<div class="post-metadata">

**Author:** ![Csaba\_Csaba](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Csaba\_Csaba](https://community.tradovate.com/u/Csaba_Csaba)\
**Post date:** [August 24, 2021, 5:07pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/12 "2021-08-24T17:07:33Z")

</div>

Hey @Alexander,

I am working on the same project with @biggy8133.  
So the end point is taken from the API example:  
“wss://md.tradovateapi.com/v1/websocket/md/getChart”

And the request params:

const body = {

```
symbol: "@NQ",

chartDescription: {

  underlyingType: "MinuteBar",

  elementSize: "UnderlyingUnits",

  elementSizeUnit: 1,

  withHistogram: false,

},

timeRange:

 {
        asMuchAsElements: 1000000,

 }

```

};

Is it possible it happens because of the Demo environment?

Also, I am using the real time chart subscription example, is there a way to get only historical chart data?

---

<div class="post-metadata">

**Author:** ![biggy8133](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@biggy8133](https://community.tradovate.com/u/biggy8133)\
**Post date:** [August 27, 2021, 11:06am UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/13 "2021-08-27T11:06:57Z")

</div>

Hello @Alexander ,  
@Csaba_Csaba has posted above what we have used as our request parameters to try to obtain the 1min data for 1 year from API, but we have not yet been successful with obtaining more than 1-2 months of it. Could you or @BWeis please advise us on a remedy for this situation. Thanks.

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [August 27, 2021, 12:48pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/14 "2021-08-27T12:48:01Z")

</div>

Hello @biggy8133, @Csaba_Csaba,

We do have limits on the amount of data we can send in one response, so to get all of that data you will likely need to composite multiple requests’ responses. You could ask for each month by using the `asFarAsTimestamp` field for the start date, and `closestTimestamp` for the end date. If you create a list of timestamps you could probably make the requests in an iterative fashion to minimize the code volume impact that many requests might have.

---

<div class="post-metadata">

**Author:** ![Csaba\_Csaba](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Csaba\_Csaba](https://community.tradovate.com/u/Csaba_Csaba)\
**Post date:** [August 27, 2021, 3:23pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/15 "2021-08-27T15:23:57Z")

</div>

@Alexander  
Is there a way to find the first date of the dataset?

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [August 27, 2021, 3:51pm UTC](https://community.tradovate.com/t/accessing-historical-data-histogram/2479/16 "2021-08-27T15:51:49Z")

</div>

For most products, our data goes back to January 1st 2017. Some contracts have been introduced since that date of course, these will obviously not start at January 1st 2017, but on the day that contract was introduced. If you’re dealing with NQ though, you should be able to get data back that far.
