# Timestamp Script

**URL:** https://community.netbeez.net/t/timestamp-script/105
**Category:** APIs & Developer Support
**Tags:** api
**Created:** [August 23, 2023, 3:05pm UTC](https://community.netbeez.net/t/timestamp-script/105 "2023-08-23T15:05:42Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![panickos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.netbeez.net/panickos/32/8_2.png) [@panickos](https://community.netbeez.net/u/panickos)
#### Post date: [August 23, 2023, 6:42pm UTC](https://community.netbeez.net/t/timestamp-script/105/2 "2023-08-23T18:42:27Z")

</div>

Hi Sebastian,

first of all, welcome to the community! We are always happy to receive and respond to your questions.

Based on what you are asking I wrote a comprehensive guide on how to retrieve results from the API in python, using the pagination features and write them into a CSV for further processing by other tools here:

> [@Fetching Ping Results from a Specific Agent using NetBeez API into a CSV file](https://community.netbeez.net/t/fetching-ping-results-from-a-specific-agent-using-netbeez-api-into-a-csv-file/106):
>
> In this guide, we’ll demonstrate how to write a Python script to fetch all ping results from a specific agent within a given time range, using NetBeez’s API. The results will be saved in a CSV file, with each timestamp parsed into a human-readable date/time. Prerequisites Python 3.x A valid Bearer token for NetBeez’s API Installation First, install the requests library to handle HTTP requests: pip install requests Step 1: import the necessary libraries: import requests import csv import ti…

To specifically answer your question notice the line which converts the epoch timestamp in milliseconds into a human readable timestamp here:

```python
'ts': datetime.fromtimestamp(result['attributes']['ts'] / 1000).strftime('%Y-%m-%d %H:%M:%S'),

```

Let me know if you have any other questions regarding this or the API in general.

Thanks,  
Panickos

---

_[View the full topic](https://community.netbeez.net/t/timestamp-script/105)._
