# API calls from timestamp to timestamp

**URL:** <https://community.piwik.pro/t/api-calls-from-timestamp-to-timestamp/2607>\
**Category:** API & integrations\
**Created:** [July 17, 2023, 3:41pm UTC](https://community.piwik.pro/t/api-calls-from-timestamp-to-timestamp/2607 "2023-07-17T15:41:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Aboy](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/alejandro_aboy/32/1576_2.png) [@Alejandro\_Aboy](https://community.piwik.pro/u/Alejandro_Aboy)\
**Post date:** [July 17, 2023, 3:41pm UTC](https://community.piwik.pro/t/api-calls-from-timestamp-to-timestamp/2607/1 "2023-07-17T15:41:36Z")

</div>

Hey, we are currently ingesting Piwik’s raw sessions/events on a daily basis to our data warehouse.

We wanted to adapt it to our other systems and ingest it 4 times a day. Our approach would need to call the API to grab data after a specific timestamp (last extraction) until now.

Is this something possible?

Thanks

---

<div class="post-metadata">

**Author:** ![gonerator](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/gonerator/32/3549_2.png) [@gonerator](https://community.piwik.pro/u/gonerator)\
**Post date:** [July 17, 2023, 11:20pm UTC](https://community.piwik.pro/t/api-calls-from-timestamp-to-timestamp/2607/2 "2023-07-17T23:20:39Z")

</div>

The timestamp in the query is precise down to a day, so I’d suggest to try using the offset parameter to achieve that. Then with each run you have to store the count of the records downloaded and use the sum of records from previous downloads as offset for the next one. I assume those should not overlap if you use “order\_by” on session\_id.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Aboy](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/alejandro_aboy/32/1576_2.png) [@Alejandro\_Aboy](https://community.piwik.pro/u/Alejandro_Aboy)\
**Post date:** [July 18, 2023, 7:15am UTC](https://community.piwik.pro/t/api-calls-from-timestamp-to-timestamp/2607/3 "2023-07-18T07:15:51Z")

</div>

Thanks! We will try this out and see how that goes.
