# History API returning data in reverse order

**URL:** <https://community.delta.exchange/t/history-api-returning-data-in-reverse-order/959>\
**Category:** Crypto Markets Discussion\
**Created:** [March 24, 2025, 10:03am UTC](https://community.delta.exchange/t/history-api-returning-data-in-reverse-order/959 "2025-03-24T10:03:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipgupta1986](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@dipgupta1986](https://community.delta.exchange/u/dipgupta1986)\
**Post date:** [March 24, 2025, 10:03am UTC](https://community.delta.exchange/t/history-api-returning-data-in-reverse-order/959/1 "2025-03-24T10:03:24Z")

</div>

Here is the url formed for DOTUSD  
[[https://api.india.delta.exchange/v2/history/candles?symbol=DOTUSD&start=1742083200&end=1742803200&resolution=1h](https://api.india.delta.exchange/v2/history/candles?symbol=DOTUSD&start=1742083200&end=1742803200&resolution=1h)] (API URL)

This returns the data in reverse order , i mean the first object in the array is the latest one and last object in the array is the first one.  
Just open the link in the browser and check the response.

---

<div class="post-metadata">

**Author:** ![hash](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@hash](https://community.delta.exchange/u/hash)\
**Post date:** [March 24, 2025, 11:01am UTC](https://community.delta.exchange/t/history-api-returning-data-in-reverse-order/959/2 "2025-03-24T11:01:01Z")

</div>

Welcome to the community Dilip !

API is designed to return the candle data starting with the most recent candle (i.e., the newest entry is first in the array). If you prefer to process the data chronologically from oldest to newest, you can simply reverse the array or sort the entries by their timestamps in ascending order.

Please let me know if you have any other questions or need further assistance!

---

<div class="post-metadata">

**Author:** ![dipgupta1986](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@dipgupta1986](https://community.delta.exchange/u/dipgupta1986)\
**Post date:** [March 24, 2025, 12:18pm UTC](https://community.delta.exchange/t/history-api-returning-data-in-reverse-order/959/3 "2025-03-24T12:18:32Z")

</div>

Thanks for the quick response.
