Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Confluence API. How get page content with Python?


I need to get the table from page in confluence and use it in Jupyter Notebook. I read the documentation and tried using examples.

But when I run request 

params = (
('expand', ''),
response = requests.get('', params=params, auth=('login', 'pass'))

I get empty response.

Can anyone help me?

3 answers

You may use the atlassian-python-api module from

use the confluence.get_page_by_id API (warning the html document has a typo for this API, it has no "self" parameter), make sure to set the expand parameter to ""

The API then returns d, a dictionary where the page view storage content is located in d['body']['storage']['value']

@Jerome Diard Thanks for pointing out the typo, was going crazy for a bit. : )

0 votes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Jan 26, 2023

@Jerome Diard was close but not right

here is code that works for you, if you want get body of page in confluence by python.


from atlassian import Confluence

= Confluence(
username = confluence_login,
password = confluence_password,
verify_ssl = False
page_html = confluence.get_page_by_id(page_id, "space,body.view,version,container")


0 votes
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 18, 2020

Hi @Oleg Gonshtein 

Welcome to the Atlassian Community :)

I'm not the best with Python coding, but I believe I can help you.

Since you are using the requests library, I'm assuming you already installed it using pip.

The below script should get you the page contents.

import requests

contentApiUrl = '/rest/api/content'
# Change these based on your instance
confluenceBaseUrl = 'http://localhost:6740/c740'
pageId = '3309573'
username = 'admin'
password = 'admin'

requestUrl = '{confluenceBaseUrl}{contentApiUrl}/{pageId}?'.format(confluenceBaseUrl = confluenceBaseUrl, contentApiUrl = contentApiUrl, pageId = pageId)
print requestUrl

requestResponse = requests.get(requestUrl, auth=(username, password))

print requestResponse.json()


A search for other Community posts will certainly find some more elaborated Python scripts, such as in this post.


I hope that helps.

Kind regards,
Thiago Masutti

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events