# Query to list all Tags

**URL:** <https://forum.genieacs.com/t/query-to-list-all-tags/5083>\
**Category:** Uncategorized\
**Created:** [February 13, 2024, 2:43pm UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083 "2024-02-13T14:43:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anthony](https://forum.genieacs.com/u/anthony)\
**Post date:** [February 13, 2024, 2:43pm UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083/1 "2024-02-13T14:43:39Z")

</div>

Hello ALL

I search to create querry in order to do list all Tags

Do you know how I do ?

Best Regards

Anthony

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [February 13, 2024, 5:36pm UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083/2 "2024-02-13T17:36:57Z")

</div>

What are you trying to do?

---

<div class="post-metadata">

**Author:** ![anthony](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anthony](https://forum.genieacs.com/u/anthony)\
**Post date:** [February 14, 2024, 9:16am UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083/3 "2024-02-14T09:16:46Z")

</div>

I’m in the process of creating a php router management page using the GenieACS API.  
I’m looking to create a search box with a select to filter out routers with a specific tag.  
I also need to retrieve the complete list of existing tags.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/7a9ba28b33f39fa14d97f71030f1e73a42e33f65.png)

can you help me

Best Regards

Anthony

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [February 14, 2024, 9:46pm UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083/4 "2024-02-14T21:46:01Z")

</div>

I don’t believe there is an existing mechanism to get a list of all the tags on devices.

There are two ways you can accomplish your goal. You can query the NBI for all devices, and use a [projection](https://docs.genieacs.com/en/latest/api-reference.html?highlight=projection#examples) to only return the tags, then do some filtering.

This curl command will show you whats possible: `curl https://your-ip-or-fqdn:7557/devices?projection=_tags`:

```auto
...
{"_id":"404A03-VMG4927%2DB50A-S200Z37001282","_tags":["BaseConfig","Managed","HasACLs","IsProvisioned","Provisioned","EnableOnboardWiFi"]},
{"_id":"404A03-EX5510%2DB0-S220Z41014080","_tags":["BaseConfig","HasACLs","Managed","Provisioned","IsProvisioned"]},
{"_id":"404A03-EX3510%2DB1-S223W40007106","_tags":["BaseConfig","Managed","HasACLs","IsProvisioned","Provisioned"]},
...

```

The other option is to connect to the MongoDB instance and do your querying/distinct/projection using MongoDB.

---

<div class="post-metadata">

**Author:** ![anthony](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anthony](https://forum.genieacs.com/u/anthony)\
**Post date:** [February 28, 2024, 8:28am UTC](https://forum.genieacs.com/t/query-to-list-all-tags/5083/5 "2024-02-28T08:28:27Z")

</div>

Hello all,  
Thank you

Its work

Best Regards

Anthony
