# Bitbucket repositories API

Get Bitbucket Repositories data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, workspace, and retrieve structured data including queried Bitbucket workspace identifier, workspace and repository slug, public repository description, primary programming language, and configured main branch name for inventory organization codebases, filter by stack or project, and chain into detail queries.

Documentation: https://openany.si/bitbucket/bitbucket-repositories-api/b8f80d40-7a02-487d-beb7-c27abbbd842f/
API ID: b8f80d40-7a02-487d-beb7-c27abbbd842f
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/repositories
Page update time: 2026-12-03T02:55:00.334Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:54:59.490Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Bitbucket Repositories API

Provide workspace (the workspace slug or bitbucket.org link) and optionally filter with q (substring match on repository name), language, project key, sort (default -updated\_on), page and limit (1–100, default 25). Returned items list repository metadata and links.

## What You Can Build

- **Inventory organization codebases**: Enumerate public repositories under a Bitbucket workspace with main branches and update dates.
- **Filter by stack or project**: Combine language and project key filters to isolate relevant repositories inside large workspaces.
- **Chain into detail queries**: Feed returned full\_name values into the Bitbucket Repository, Pipelines or Source APIs.

## Returned Data

| Field | Meaning |
| --- | --- |
| `workspace` | Queried Bitbucket workspace identifier |
| `repositories[].full_name` | Workspace and repository slug |
| `repositories[].description` | Public repository description |
| `repositories[].language` | Primary programming language |
| `repositories[].mainbranch` | Configured main branch name |
| `repositories[].project.key` | Bitbucket project key |
| `repositories[].updated_at` | Last update timestamp |
| `repositories[].url` | Bitbucket repository web URL |
| `next_page` | Next page number, or null on the final page |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bitbucket repositories API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "workspace": {
          "type": "string",
          "description": "Workspace id (the first part of a bitbucket.org link) or a link."
        },
        "q": {
          "type": "string",
          "description": "Only repositories whose name contains this."
        },
        "language": {
          "type": "string",
          "description": "Only this language, e.g. java or python."
        },
        "project": {
          "type": "string",
          "description": "Only this project key (from `/bitbucket/v1/workspace`)."
        },
        "sort": {
          "type": "string",
          "description": "Sort order (default -updated_on).",
          "enum": [
            "-updated_on",
            "updated_on",
            "-created_on",
            "created_on",
            "name",
            "-name",
            "-size",
            "size"
          ]
        },
        "page": {
          "type": "integer",
          "description": "Page number (default 1). Pass `next_page` back as `page`; null on the last page."
        },
        "limit": {
          "type": "integer",
          "description": "Results per page, 1-100 (default 25)."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "workspace"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "applied_filters": {
      "type": "object",
      "properties": {
        "language": {
          "type": "null"
        },
        "project": {
          "type": "null"
        },
        "q": {
          "type": "null"
        },
        "sort": {
          "type": "string"
        }
      }
    },
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "next_page": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "repositories": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "avatar": {
                "type": "string"
              },
              "clone_urls": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "href": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              },
              "created_at": {
                "type": "string"
              },
              "description": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "fork_policy": {
                "type": "string"
              },
              "full_name": {
                "type": "string"
              },
              "has_issues": {
                "type": "boolean"
              },
              "has_wiki": {
                "type": "boolean"
              },
              "is_private": {
                "type": "boolean"
              },
              "language": {
                "type": "string"
              },
              "mainbranch": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "owner": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "type": "string"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "nickname": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "uuid": {
                    "type": "string"
                  }
                }
              },
              "parent": {
                "type": "null"
              },
              "project": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              "scm": {
                "type": "string"
              },
              "size_bytes": {
                "type": "integer"
              },
              "slug": {
                "type": "string"
              },
              "updated_at": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "uuid": {
                "type": "string"
              },
              "website": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "workspace": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "total": {
      "type": "integer"
    },
    "workspace": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/repositories?output=json&workspace=atlassian' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "applied_filters": {
    "language": null,
    "project": null,
    "q": null,
    "sort": "-updated_on"
  },
  "cached": false,
  "count": 25,
  "credits_used": 1,
  "next_page": 2,
  "page": 1,
  "repositories": [
    {
      "avatar": "https://bytebucket.org/ravatar/%7Ba99dd3ed-354c-4216-b725-78c7571df383%7D?ts=java",
      "clone_urls": [
        {
          "href": "https://bitbucket.org/atlassian/bamboo-specs.git",
          "name": "https"
        },
        {
          "href": "name@example.com:atlassian/bamboo-specs.git",
          "name": "ssh"
        }
      ],
      "created_at": "2017-03-06T14:42:41.710185+00:00",
      "description": null,
      "fork_policy": "allow_forks",
      "full_name": "atlassian/bamboo-specs",
      "has_issues": false,
      "has_wiki": false,
      "is_private": false,
      "language": "java",
      "mainbranch": "master",
      "name": "bamboo-specs",
      "owner": {
        "avatar": "https://bitbucket.org/account/atlassian/avatar/",
        "display_name": "Atlassian",
        "nickname": "atlassian",
        "type": "team",
        "url": "https://bitbucket.org/%7B02b941e3-cfaa-40f9-9a58-cec53e20bdc3%7D/",
        "uuid": "{02b941e3-cfaa-40f9-9a58-cec53e20bdc3}"
      },
      "parent": null,
      "project": {
        "key": "BAM",
        "name": "BAMBOO"
      },
      "scm": "git",
      "size_bytes": 11567673,
      "slug": "bamboo-specs",
      "updated_at": "2026-11-06T07:12:02.687645+00:00",
      "url": "https://bitbucket.org/atlassian/bamboo-specs",
      "uuid": "{a99dd3ed-354c-4216-b725-78c7571df383}",
      "website": "https://docs.atlassian.com/bamboo-specs-docs/latest/",
      "workspace": "atlassian"
    },
    {
      "avatar": "https://bytebucket.org/ravatar/%7B9a1dc830-b3e8-4cb1-bbf1-7bbc9a5d9c05%7D?ts=java",
      "clone_urls": [
        {
          "href": "https://bitbucket.org/atlassian/atlassian-selenium.git",
          "name": "https"
        },
        {
          "href": "name@example.com:atlassian/atlassian-selenium.git",
          "name": "ssh"
        }
      ],
      "created_at": "2012-10-13T05:50:51.853979+00:00",
      "description": "Common library to make writing Selenium tests easier\r\n\r\nhttps://ecosystem.atlassian.net/browse/SELENIUM",
      "fork_policy": "allow_forks",
      "full_name": "atlassian/atlassian-selenium",
      "has_issues": false,
      "has_wiki": false,
      "is_private": false,
      "language": "java",
      "mainbranch": "master",
      "name": "atlassian-selenium",
      "owner": {
        "avatar": "https://bitbucket.org/account/atlassian/avatar/",
        "display_name": "Atlassian",
        "nickname": "atlassian",
        "type": "team",
        "url": "https://bitbucket.org/%7B02b941e3-cfaa-40f9-9a58-cec53e20bdc3%7D/",
        "uuid": "{02b941e3-cfaa-40f9-9a58-cec53e20bdc3}"
      },
      "parent": null,
      "project": {
        "key": "SFP",
        "name": "DC Frontend Platform"
      },
      "scm": "git",
      "size_bytes": 10488715,
      "slug": "atlassian-selenium",
      "updated_at": "2026-11-06T07:04:44.140842+00:00",
      "url": "https://bitbucket.org/atlassian/atlassian-selenium",
      "uuid": "{9a1dc830-b3e8-4cb1-bbf1-7bbc9a5d9c05}",
      "website": null,
      "workspace": "atlassian"
    },
    "… 23 more"
  ],
  "total": 406,
  "workspace": "atlassian"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What does the q parameter search?
q filters to repositories whose name contains the provided string inside the chosen workspace.

### Where do I get a valid project key?
Pass the Bitbucket project key reported in workspace or repository metadata (for example from project.key).

### How are repositories sorted by default?
Results default to sort=-updated_on (most recently updated first).

### How do I paginate through a large workspace?
Use page (default 1) and limit (1–100, default 25), passing next_page back as page until it is null.

### Will this return private repositories in the workspace?
No. This operation lists public workspace repositories and does not accept buyer Bitbucket credentials.

### How do I skip cached results or reduce payload size?
Set fresh=1 to bypass the 24-hour cache, raw=0 to drop bulky raw blocks, or fields to pick specific keys.

## Available implementations
- apish: https://openany.si/bitbucket/bitbucket-repositories-api/b8f80d40-7a02-487d-beb7-c27abbbd842f/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
