Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get page information about a Confluence page via REST API: page metadata and links

Stan Ry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2019

Howdy,

I want to gather page information about every page in my space programmatically. I am planning to do so through Python. 

There's a metadata information called Page information for every page in Confluence. And this information is accessiable via URLs like:

https://example.net/wiki/pages/viewinfo.action?pageId=774671260

The page provides following metadata that describes page links, authors:

  • Title
  • Author
  • Last Changed by
  • Tiny Link
  • Incoming Links
  • Outgoing Links
  • Labels
  • Hot Referrers (what are these?)

Is there any way I could collect this info via a Python script and REST API? I have scanned https://example.net/wiki/plugins/servlet/restbrowser#/ REST Browser but haven't found any matching API that would nail this task.

I would be happy to hear some recommendations or examples of scripts -- Python or JavaScript -- that solve this. Every input is appreciated.

Thank you in advance.
 

2 answers

1 vote
Deleted user May 23, 2019

You can use the REST API, assuming your version of Confluence supports the following call:

 

Using requests library in Python or however you want, you can hit this endpoint: {Confluence Base URL}/rest/api/space/{Space Key}/content

 

This will give you the pages in a space and some information. You could then programmatically expand each page and grab the information you're looking for.  

0 votes
Luana Premoli
Contributor
April 3, 2023

HI @Stan Ry 

Could you do a search in Python?

I have the same job.

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events