It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to use BitBucket Server API in Python Edited

I am new to BitBucket Server and I have a lot of problems now with playing around its API.

I have searched on Internet how to use BitBucket Server API in Python and some told me to use Stash. However, when I try this in Python, I keep get 503 Service Unavailable.


import stashy

stash = stashy.connect("http://localhost:7990/stash", "USERNAME", "PASSWORD")

Traceback (most recent call last):
File "/PATH/", line 5, in <module>
File "/PATH/miniconda3/lib/python3.6/site-packages/stashy/", line 124, in list
return list(self.all(filter))
File "/PATH/miniconda3/lib/python3.6/site-packages/stashy/", line 74, in paginate
File "/PATH/miniconda3/lib/python3.6/site-packages/stashy/", line 50, in maybe_throw
raise e
stashy.errors.GenericException: Unknown error: 503(Service Unavailable)

Does anyone have any ideas on what's happening here? Many thanks.

BTW, my ultimate goal is to issue comments on pull request in BitBucket Server using Python.

2 answers

1 accepted

0 votes
Answer accepted
Ana_Retamal Atlassian Team Jan 05, 2018

Hi Jekyll, looks like you're using Stashy, which is a Python API client for the Atlassian Stash REST API created by a third party.

In their documentation it says that Stashy supports Python 2.6, 2.7 and 3.3 but it seems like you're using Python 3.6, can you confirm this?

If you're already following the documentation at and using the supported versions and you still get errors, I'd recommend you to contact the author directly at

Hope that helps!


Oh, thank you so much. I can't believe I should overlook that.

Ana_Retamal Atlassian Team Jan 08, 2018

No worries, glad I could help! Have a good day :)


@Jiuwu95  @Ana_Retamal  : Do you have any Pull request example  in stashy ? 

0 votes
Radek Janata Community Leader May 04, 2018

When I tried stashy recently, it works well with Python 3.6. When I installed it via

pip install stashy

I got version 0.5 installed and it works.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Bitbucket Server 7.0 is here!

Hello Community, I’m Anton Genkin, a product manager on the Bitbucket Server and Data Center team and am excited to share that Bitbucket Server 7.0 is now available! It's a platform release, one th...

1,089 views 6 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you