TL;DR
Many companies use Atlassian products. It starts with JIRA, and at some point, Confluence becomes a place for documentation. After some time, you will need to know how big is your Confluence repository. We provide a solution in this blog post.
Confluence Wiki
Confluence is a Wiki repository. Users create documentation as HTML pages with the help of markup language. For example, in the markup, you use the following syntax to create a link:
[I'm an inline-style link](https://www.google.com)
.
Wiki has a number of pages, so size is determined by the number of pages. How to count the number of pages for your Confluence Wiki?
Confluence REST API.
For that, you can use Confluence REST API. But first, you need to create your API key that is valid for all Atlassian products.
- Log in to https://id.atlassian.com/manage/api-tokens.
- Click ‘Create API token.’
- From the dialog that appears, enter a memorable and concise ‘Label’ for your token and click ‘Create.’
- Use ‘Copy to clipboard.
Confluence Size
Find out your Confluence Wiki size using the following curl
request:
curl -sGLu your_atlassian_registration_email:api_token "https://${INSTANCE_HOST}/wiki/rest/api/search" --data-urlencode 'cql=type IN (blogpost, page)' --data-urlencode 'limit=0'
INSTANCE_HOST is your_org.atlassian.net
As the result, field totalSize
contains the number of pages.