# Getting all tags in a historical tag provider

**URL:** <https://forum.inductiveautomation.com/t/getting-all-tags-in-a-historical-tag-provider/88469>\
**Category:** Module Development\
**Created:** [April 6, 2024, 7:04pm UTC](https://forum.inductiveautomation.com/t/getting-all-tags-in-a-historical-tag-provider/88469 "2024-04-06T19:04:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asjal\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Asjal\_Ahmad](https://forum.inductiveautomation.com/u/Asjal_Ahmad)\
**Post date:** [April 6, 2024, 7:04pm UTC](https://forum.inductiveautomation.com/t/getting-all-tags-in-a-historical-tag-provider/88469/1 "2024-04-06T19:04:21Z")

</div>

How do I get all tags in the tag history provider?

```auto
    @Override
    public void setup(GatewayContext gatewayContext) {
        this.context = gatewayContext;

        try {
            GatewayTagHistoryManager tagHistoryManager = context.getTagHistoryManager();
            TagHistoryProvider tagHistoryProvider = tagHistoryManager.getTagHistoryProvider("Test Provider");

            if (tagHistoryProvider != null) {
                Date startDate = new Date(System.currentTimeMillis() - 86400000); // 24 hours ago
                Date endDate = new Date();                
                //what should I do here?
                //tagHistoryProvider.queryDensity();
            } else {
                logger.error("Tag History Provider not found.");
            }
        } catch (Exception e) {
            logger.error("Error while accessing Tag History Provider.", e);
        }
    }

```
