# Alpaca get\_last\_trade price is delayed

**URL:** <https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798>\
**Category:** Alpaca Market Data\
**Created:** [March 5, 2021, 1:15am UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798 "2021-03-05T01:15:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeredbike](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mikeredbike/32/2221_2.png) [@mikeredbike](https://forum.alpaca.markets/u/mikeredbike)\
**Post date:** [March 5, 2021, 1:15am UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/1 "2021-03-05T01:15:14Z")

</div>

My algo has been collecting the Alpaca get\_last\_trade price every minute to make trade choices. After comparing that data to [twelvedata.com](http://twelvedata.com) time\_series close I’ve discovered the Alpaca data is delayed and has missing points. Check out the following graph:

 ![twelve_vs_Alpaca_get_last_trade](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/2/2a2a05f210abf5c25782d2c2b9d5ab79282a3887.jpeg)

---

<div class="post-metadata">

**Author:** ![SPECULARI\_FUND](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/speculari_fund/32/709_2.png) [@SPECULARI\_FUND](https://forum.alpaca.markets/u/SPECULARI_FUND)\
**Post date:** [April 22, 2021, 3:05pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/2 "2021-04-22T15:05:17Z")

</div>

Similiar issue - last trade shows that active symbol as TQQQ last trade was 5 minutes ago and not refreshing. Updating every minute too.

self.alpaca.get\_last\_trade(‘TQQQ’):

```
Trade({ 'cond1': 0,
    'cond2': 0,
    'cond3': 0,
    'cond4': 0,
    'exchange': 15,
    'price': 109.25,
    'size': 154,
    'timestamp': 1619103337389148773})
Trade({ 'cond1': 0,
    'cond2': 0,
    'cond3': 0,
    'cond4': 0,
    'exchange': 15,
    'price': 109.25,
    'size': 154,
    'timestamp': 1619103337389148773})
Trade({ 'cond1': 0,
    'cond2': 0,
    'cond3': 0,
    'cond4': 0,
    'exchange': 15,
    'price': 109.25,
    'size': 154,
    'timestamp': 1619103337389148773})
Trade({ 'cond1': 0,
    'cond2': 0,
    'cond3': 0,
    'cond4': 0,
    'exchange': 15,
    'price': 109.25,
    'size': 154,
    'timestamp': 1619103337389148773})
```

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [April 22, 2021, 3:57pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/3 "2021-04-22T15:57:56Z")

</div>

The `get_last_trade` method references a v1 data API. The [v1 data APIs](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v1/) only look at trades and quotes that were placed on the IEX exchange (notice exchange 15 in all the trades above). That is why it seems the data is ‘old’ or not being refreshed. There are generally newer trades and quotes occurring on other exchanges and trading venues.

The v1 data, along with the v2 ‘Free’ data, is really provided as an inexpensive way to test and debug ones program. To get full market data one would need to subscribe to the “Unlimited” data plan and use the v2 APIs. Unfortunately, as of the time this is being written, there isn’t a good v2 API to use to fetch the latest trade or quote. This is planned within the next several weeks so stay tuned.

As an aside, users are generally reporting latencies of 150-300ms between the participant\_timestamp (ie when a trade was executed) and when they receive the data using v2 data.

---

<div class="post-metadata">

**Author:** ![SPECULARI\_FUND](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/speculari_fund/32/709_2.png) [@SPECULARI\_FUND](https://forum.alpaca.markets/u/SPECULARI_FUND)\
**Post date:** [April 22, 2021, 4:29pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/4 "2021-04-22T16:29:50Z")

</div>

> [@Dan\_Whitnable\_Alpaca](#):
>
> The v1 data, along with the v2 ‘Free’ data, is really provided as an inexpensive way to test and debug ones program. To get full market data one would need to subscribe to the “Unlimited” data plan and use the v2 APIs. Unfortunately, as of the time this is being written, there isn’t a good v2 API to use to fetch the latest trade or quote. This is planned within the next several weeks so stay tuned.

Logs above using v2 API and with “Unlimited” plan. For `get_barset()` same issue.

---

<div class="post-metadata">

**Author:** ![SPECULARI\_FUND](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/speculari_fund/32/709_2.png) [@SPECULARI\_FUND](https://forum.alpaca.markets/u/SPECULARI_FUND)\
**Post date:** [April 22, 2021, 5:04pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/5 "2021-04-22T17:04:02Z")

</div>

Looks like only the Daily (1D) timeframe has updated data.

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [April 22, 2021, 8:37pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/6 "2021-04-22T20:37:57Z")

</div>

The `get_barset` method in the python SDK uses the [bars](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v1/bars/) API behind the scenes and references v1 data. The only APIs which reference the v2 data are those explicitly called out in the [v2 documentation](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/historical/). That is why, even though one may be signed up for the “Unlimited” data plan, unless one uses the v2 APIs the data will only be IEX data. That is why `get_barset` appears to not update as often as expected.

If using the python SDK, take a look at the [read\_me](https://github.com/alpacahq/alpaca-trade-api-python#readme) section in gethub. That has a bit more explanation of which methods to use to fetch v2 data and therefore get full market coverage if subscribed to the “Unlimited” data plan.

---

<div class="post-metadata">

**Author:** ![SPECULARI\_FUND](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/speculari_fund/32/709_2.png) [@SPECULARI\_FUND](https://forum.alpaca.markets/u/SPECULARI_FUND)\
**Post date:** [April 23, 2021, 1:58pm UTC](https://forum.alpaca.markets/t/alpaca-get-last-trade-price-is-delayed/4798/7 "2021-04-23T13:58:50Z")

</div>

Yeah, looks like need makes some updates. Thanks, will check!
