How can I generate a list of the spaces on my Confluence Cloud site and sort that by space size?
Asked by Juan Leon:

The question as stated pretty much says it all.

The context is:

I know the size of spaces when they are created from my templates.

For administrative purposes, I'd like to be able to quickly identify all spaces across the site that have had no pages or attachments added to them since their initial creation.

I hope I can be pointed to an existing report or 3rd party add-on that can provide this information--or other information that can be used to achieve the same result--distinguishing used from never-been-used spaces on my site.

Thank you for any pointers,

Juan


Answers:
author: Aron Gombas _Midori_
body: [@Juan Leon](/t5/user/viewprofilepage/user-id/16878) You can use the Site dashboard provided by the [Better Content Archiving](https://marketplace.atlassian.com/apps/123/better-content-archiving-for-confluence?hosting=cloud&tab=overview) app for this.

Although this report is more focused on the content count per status values, the "Contents" column displays the total number of pages plus blogs per space:

![Home-Confluence.png](https://community.atlassian.com/t5/image/serverpage/image-id/314536i5961F1A8EF517D00/image-size/large?v=v2&px=999 "Home-Confluence.png")

*(Discl. it is a paid and supported app developed by our team. Free for 10 users.)*


author: Jonathan Muse
body: Hi [@Juan Leon](/t5/user/viewprofilepage/user-id/16878) , I use the [Confluence Command Line Interface (CLI)](https://marketplace.atlassian.com/apps/284/confluence-command-line-interface-cli?hosting=cloud&tab=overview) tool for this exact same thing all the time. I find it entertaining because despite working with many other admins, no one knows how I get the data and I end up needing to send the file to everyone.  

I am not exactly sure what you mean by space size. I assume it means the number of pages in the space?  

Getting a basic space list is pretty straight forward:

```
--action getSpaceList --file C:/ACLI/spacelist.csv
```

As you might guess it exports the list into a CSV file with basic info like name, id, home page, and some other data.  

If you are after the number of pages in each space I use something like this:

```
--action runFromSpaceList --common "--action getPageList --cql \"type=page AND space=@space@\" --file C:/ACLI/allPages.csv --append"
```

Then, in Excel, I use a pivot table to show how many pages are under each space. It can take some time to run but I have successfully run this for a site that has 45k pages in it.

comments: author: Juan Leon
body: Hello, Jonathan.

Yes. Space size in terms of pages would be perfect.

As for these scripts, the first one works like a charm. It created the 'spacelist.csv' file and populated it with the attributes of my spaces.

The second script returns an error I am not sure how to debug, though:

Run: --action getPageList --cql "type=page AND space=2024Course12Wktemplate" --file C:/ACLI/allPages.csv --append

**Remote error:** com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql :  
Client error: 1 actions failed

Is there a syntax error that would be obvious to your more experienced eye? Does it matter that my acli client is running on a Windows 11 PC?

Thanks for any light you can shed.

- juan


author: Trudy Claspill
body: Hello [@Juan Leon](/t5/user/viewprofilepage/user-id/16878)

Searching the Atlassian Marketplace for "space size", filtering for Confluence Cloud, revealed this app. I have never used it.

[Site statistics for Confluence](https://marketplace.atlassian.com/apps/1229447/site-statistics-for-confluence-cloud?hosting=cloud&tab=overview)

comments: author: Juan Leon
body: Thank you, Trudy. I wasn't able to get this app to display statistics for a site as a whole, or sort by space size.


Tags: cloud

confluence-cloud

report

size

space