# Ansible Tower list of hosts - License

**URL:** <https://forum.ansible.com/t/ansible-tower-list-of-hosts-license/37387>\
**Category:** AWX Project\
**Created:** [November 25, 2022, 3:27pm UTC](https://forum.ansible.com/t/ansible-tower-list-of-hosts-license/37387 "2022-11-25T15:27:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alberto\_Cortes](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Alberto\_Cortes](https://forum.ansible.com/u/Alberto_Cortes)\
**Post date:** [November 25, 2022, 3:27pm UTC](https://forum.ansible.com/t/ansible-tower-list-of-hosts-license/37387/1 "2022-11-25T15:27:16Z")

</div>

Hello,

I am looking for a way to extract a spreadsheet from Tower API with the list of hosts, so I can see what inventory includes each host, organizations using it, and when was the last time it was used. This will help to verify if the number of lines in this list matches the license consumed in Ansible Tower. This will help to report and plan any cleanup for unused hosts in inventories.

Thanks,

Alberto

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [December 2, 2022, 6:47pm UTC](https://forum.ansible.com/t/ansible-tower-list-of-hosts-license/37387/2 "2022-12-02T18:47:56Z")

</div>

The best way to do this is to make GET requests to the api/v2/hosts endpoint, then parse that json to get he relevant fields/data and write them to a .csv

You can also do this with awx collection, which can also output to json

Try that out and let us know if you run into problems along the way, happy to help further

AWX Team
