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!


Bitbucket REST API does not return JSON format running cURL on Windows

Hi, I'm trying to get the list of repositories in Bitbucket Cloud running cURL on a Windows laptop. For testing, I type the following command in the command prompt:


And the output is just a long, unformatted text, not JSON formatted as shown in the documentations - see below.

What am I doing wrong? Thanks,

{"pagelen": 10, "values": [{"scm": "git", "has_wiki": false, "links": {"watchers": {"href": ""}, "branches": {"href": ""}, "tags": {"href": ""}, "commits": {"href": ""}, "clone": [{"href": "", "name": "https"}, {"href": "", "name": "ssh"}], "self": {"href": ""}, "source": {"href": ""}, "html": {"href": ""}, "avatar": {"href": ""}, "hooks": {"href": ""}, "forks": {"href": ""}, ...
"next": ""}


2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 09, 2022

Hi @Eduardo Velasquez,

The curl command you are using is going to return all public repositories in Bitbucket Cloud. Is this what you are trying to do?

If you want to get all repositories of a certain workspace instead, including private ones, you will need to include the workspace-id in the URL and also authentication details.

curl -u BitbucketUsername:AppPassword

BitbucketUsername replace with your Bitbucket username
AppPassword replace with an app password for your account
WORKSPACE-ID replace with the workspace id of the workspace that you want to get repos for

The output you posted here seems to be only part of the output, and I see 3 dots before the field "next"

, ... "next":

Is this how the output shows in your command line application? Or did you remove part of the output when copying-pasting it here?

If the output gets truncated, as a workaround you can try using the option -o in order to write the output in a file and inspect it there

curl -o myFile.txt

Kind regards,

Hi @Theodora Boudale, thanks for your comments. All I want is to test the command using cURL on my Windows laptop that's why I'm accessing the public repositories and yes, I just copied a portion of the output here, to show that the output is not JSON formatted as shown in the documentation. I also tested the same cURL command in a LINUX server and the result is the same, the output is not JSON formatted.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 11, 2022

Hi @Eduardo Velasquez,

Apologies, I misunderstood your question.

Curl does not format its output. If you want the output to be displayed formatted, you can use another tool that does that, e.g. jq:

If you install jq on your machine, you can run from command prompt

curl | jq .

and the output will be formatted.

Kind regards,

Thanks @Theodora Boudale worked like a charm!

Too bad we have to use an additional software to format the output. Other software such as ArtiFactory and Jenkins REST API outputs are JSON formatted using curl and I was expecting the same using Bitbucket Cloud REST API.

Oh well, maybe in a future release.

Thanks again. Have a great day!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 18, 2022

Hi Eduardo,

You are very welcome, it's good to hear that this worked!

I created a feature request in our issue tracker for the Bitbucket API to return the output JSON formatted:

You can add your vote to that ticket (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

Have a great day too! Please feel free to reach out if you ever need anything else!

Kind regards,

Like Eduardo Velasquez likes this

Thank you Theodora! You got my vote!

Like Theodora Boudale likes this

Hi @Theodora Boudale and @Eduardo Velasquez you might find my notes on an earlier thread helpful. They address to some mistakes in the support document related to Windows.

Also, when using the SSH method of authentication, you need to use the ssh:// protocol. For example, simply setting the url like this will do the trick:

git remote set-url origin ssh://<workspace-id>/<repo-name>

Hi @Paul Sherman, unfortunately your observations are not related with the reported issue but I do appreciate your time. A feature request has been created by @Theodora Boudale to address it. Thanks,

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events