API Directory › 🛠️ Developer Tools › Bitbucket API
OAuthHTTPSCORS

Bitbucket API

Manage repositories, pull requests and pipelines on Bitbucket.

Auth
OAuth
HTTPS
Yes
CORS
Yes
Open Bitbucket API docs ↗

What it does

The Bitbucket Cloud REST API (v2.0) manages repositories, pull requests, commits, branches, pipelines, webhooks, snippets and workspace membership on bitbucket.org. Responses are JSON with cursor-style pagination.

Base URL

https://api.bitbucket.org/2.0

Authentication

Use an API token or repository/workspace Access Token as a Bearer token (Authorization: Bearer …), or OAuth 2.0 for apps acting on behalf of users. Older app passwords with HTTP Basic still work but are being phased out. Public repos allow some unauthenticated reads.

Code examples

curl
curl -H "Authorization: Bearer $BITBUCKET_TOKEN" \
  "https://api.bitbucket.org/2.0/repositories/atlassian?pagelen=5"
Python
import requests

url = "https://api.bitbucket.org/2.0/repositories/myworkspace"
while url:
    r = requests.get(url, headers={"Authorization": f"Bearer {TOKEN}"}, timeout=10)
    page = r.json()
    for repo in page["values"]:
        print(repo["full_name"])
    url = page.get("next")  # cursor pagination

Rate limits & quotas

Rate limits are per authenticated user (and per IP for anonymous traffic) — on the order of 1,000 requests/hour for most endpoints, lower for anonymous. Over the limit returns HTTP 429 with a Retry-After header.

Key response fields

values[]The current page of results
nextFull URL of the next page, or absent on the last page
pagelen / sizePage size and (sometimes) total count
full_nameworkspace/repo

Common errors

401Missing/expired token or app password.
403Token scope or workspace permission insufficient.
404Private resource without access, or wrong workspace slug.
429Rate limited — wait Retry-After seconds.

When to use it (and alternatives)

Use it for Bitbucket Cloud automation. If you also touch Jira or Confluence, the same Atlassian account and OAuth app can cover all three. For GitHub or GitLab hosting see their APIs.

FAQ

Are app passwords still supported?

They work for now but Atlassian is deprecating them in favour of API tokens and scoped access tokens. New integrations should use tokens with a Bearer header.

How does pagination work?

Follow the next field in each response, which is a complete URL for the following page. Stop when it is missing. Control page size with pagelen.

Can I filter results server-side?

Yes — many endpoints accept a q parameter with Bitbucket’s query language and sort for ordering, which is far cheaper than paging through everything.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON FormatterJWT DecoderBase64

Related Developer Tools APIs

← Back

More Developer Tools APIs · All 196 APIs