BYTETOOLS

Bitbucket REST API

Read public Bitbucket repositories, commits and pull requests as JSON without authenticating. 60 anonymous requests per hour, exposed in response headers.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Bitbucket REST API?

Bitbucket Cloud's REST API serves public data anonymously. `GET https://api.bitbucket.org/2.0/repositories/{workspace}?pagelen=2` lists a workspace's public repositories with links, timestamps and metadata. Anonymous callers get 60 requests per hour, reported in `X-RateLimit-*` headers.

Bitbucket is the forge people forget has an open API. Public repositories, commits, branches, tags and pull requests are all readable without a token, which makes it easy to build multi-forge tooling that treats Bitbucket alongside GitHub and GitLab. The catch is the allowance: our probe saw `x-ratelimit-limit: 60, 60;w=3600`, so 60 requests an hour anonymously, an order of magnitude tighter than GitHub's anonymous limit.

The response style is HAL-influenced and link-heavy. Every object carries a `links` map with prepared URLs for its commits, pull requests, branches, tags, downloads and source tree, so you can navigate the API by following links instead of assembling paths. Paging is cursor-based: read `next` from the response rather than incrementing a page number, because `pagelen` alone will not get you to the second page.

Quick facts

Base URL
https://api.bitbucket.org/2.0
Authentication
Public repositories are readable anonymously. Private data, writes and higher rate limits need an app password or OAuth token.
Rate limit
Observed as 60 requests per hour for anonymous callers, reported in `x-ratelimit-limit`, `x-ratelimit-remaining` and `x-ratelimit-reset`.
Pricing
Free for public data. Bitbucket Cloud plans cover private repositories.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Bitbucket REST API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. List a workspace's public repositories

GET https://api.bitbucket.org/2.0/repositories/atlassian?pagelen=2

curl
curl 'https://api.bitbucket.org/2.0/repositories/atlassian?pagelen=2'
JavaScript (fetch)
const res = await fetch("https://api.bitbucket.org/2.0/repositories/atlassian?pagelen=2");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.bitbucket.org/2.0/repositories/atlassian?pagelen=2", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "values": [
    {
      "type": "repository",
      "full_name": "atlassian/atlassian-event",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event"
        },
        "html": {
          "href": "https://bitbucket.org/atlassian/atlassian-event"
        },
        "avatar": {
          "href": "https://bytebucket.org/ravatar/%7B3d76c1e2-d4bb-4baf-a957-ad7ba71f88c2%7D?ts=default"
        },
        "pullrequests": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/pullrequests"
        },
        "commits": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/commits"
        },
        "forks": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/forks"
        },
        "watchers": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/watchers"
        },
        "branches": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/refs/branches"
        },
        "tags": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/refs/tags"
        },
        "downloads": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/downloads"
        },
        "source": {
          "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-event/src"
        },
        "clone": [
          {
            "name": "https",
            "href": "https://

Parameters

ParameterTypeRequiredDescription
{workspace}pathRequiredWorkspace or user slug, such as `atlassian`. atlassian
pagelenintegerOptionalResults per page, up to 100. 2
qstringOptionalBitbucket's own query language for filtering, e.g. `language="python"`. language="python"
sortstringOptionalField to sort on; prefix with `-` for descending. -updated_on
fieldsstringOptionalPartial response selector. `-values.links` strips the bulky link maps. -values.links

Response fields

valuesarray
The page of results. `pagelen`, `size`, `page` and `next` sit alongside it, though `size` is omitted on large collections for performance.
values[].full_namestring
`workspace/repo`, which is the identifier you use everywhere else in the API.
values[].linksobject
Prepared URLs for `self`, `html`, `avatar`, `commits`, `pullrequests`, `branches`, `tags`, `downloads`, `source` and `clone`. Navigate by following these.
values[].links.clonearray
Clone URLs as objects with `name` of `https` or `ssh`, not a plain string. Pick by name rather than by index.
nextstring
Cursor URL for the next page. Paging is cursor-based; do not construct page numbers yourself.
x-ratelimit-remainingheader
Anonymous requests left in the current hour. Watch it, because 60 disappears quickly during development.

What you can build with the Bitbucket REST API

  • Add Bitbucket support to a tool that already reads GitHub and GitLab
  • Mirror the list of a workspace's public repositories into an internal catalogue
  • Fetch recent commits or open pull requests for a dashboard
  • Check clone URLs programmatically during repository onboarding
  • Audit which public repositories an organisation exposes

Common errors and how to fix them

429

The 60-per-hour anonymous allowance is exhausted.

Fix: Check `x-ratelimit-remaining` and cache aggressively. An app password lifts the limit substantially and is easy to add.

404 on a private repository

Anonymous callers cannot see private data, and Bitbucket returns 404 rather than 403 to avoid leaking existence.

Fix: Authenticate with an app password or OAuth token if the repository is private.

Paging stops after one page

You incremented `page` instead of following the cursor.

Fix: Follow the `next` URL exactly as returned; it contains an opaque cursor.

Bitbucket REST API — frequently asked questions

Can I use the Bitbucket API without authentication?

Yes, for public repositories. Anonymous access is capped at 60 requests per hour, which our probe confirmed from the rate-limit headers.

How does the anonymous limit compare with GitHub?

It is much tighter. GitHub allows 60 per hour per IP as well, but its responses are richer per call; Bitbucket's link-heavy objects mean you often need more requests for the same information. Use the `fields` parameter to cut payloads and round trips.

How do I page through results?

Follow the `next` URL in each response. Bitbucket uses cursor paging, so incrementing a page number will not work reliably on large collections.

Why is size missing from some responses?

Bitbucket omits total counts on large collections because computing them is expensive. Page until `next` is absent instead of relying on a total.

Tools that pair with this API

Bitbucket REST API is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.