# Bitbucket repository API

Get Bitbucket Repository data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, repo, and retrieve structured data including workspace and repository slug, bitbucket repository UUID, public repository description, primary programming language, and configured main branch name to verify repository metadata, enrich software catalogs, and prepare source or ci calls.

Documentation: https://openany.si/bitbucket/bitbucket-repository-api/e42f8591-dae0-484b-b9e1-76b2a0f1ae65/
API ID: e42f8591-dae0-484b-b9e1-76b2a0f1ae65
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/repository
Page update time: 2026-12-03T02:55:00.345Z
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.541Z. 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 Repository API

Send repo (workspace/repo or bitbucket.org link) in the query string, with optional raw=0, fields and fresh=1. The response returns repository identifiers, owner and project metadata, mainbranch, size\_bytes, fork\_count, watcher\_count and clone\_urls.

## What You Can Build

- **Verify repository metadata**: Confirm UUID, SCM type, main branch and fork policy before integrating a Bitbucket project.
- **Enrich software catalogs**: Attach language, project key, description and clone URLs to a workspace/repo reference.
- **Prepare source or CI calls**: Read mainbranch before querying the Bitbucket Repository Source or Pipelines APIs.

## Returned Data

| Field | Meaning |
| --- | --- |
| `full_name` | Workspace and repository slug |
| `uuid` | Bitbucket repository UUID |
| `description` | Public repository description |
| `language` | Primary programming language |
| `mainbranch` | Configured main branch name |
| `scm` | Source control system type |
| `fork_count` | Repository fork count |
| `watcher_count` | Repository watcher count |
| `clone_urls[].href` | Repository clone URL |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bitbucket repository 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": {
        "repo": {
          "type": "string",
          "description": "Repository as workspace/repo, or a bitbucket.org link."
        },
        "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": [
        "repo"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "avatar": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "clone_urls": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "created_at": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "description": {
      "type": "string"
    },
    "fork_count": {
      "type": "integer"
    },
    "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"
    },
    "watcher_count": {
      "type": "integer"
    },
    "website": {
      "type": "string"
    },
    "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/repository?output=json&repo=atlassian%2Faui' \
  -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
{
  "avatar": "https://bytebucket.org/ravatar/%7B585074de-7b60-4fd1-81ed-e0bc7fafbda5%7D?ts=86317",
  "cached": false,
  "clone_urls": [
    {
      "href": "https://bitbucket.org/atlassian/aui.git",
      "name": "https"
    },
    {
      "href": "name@example.com:atlassian/aui.git",
      "name": "ssh"
    }
  ],
  "created_at": "2011-10-20T03:33:16.840807+00:00",
  "credits_used": 1,
  "description": "AUI - Atlassian User Interface library.",
  "fork_count": 0,
  "fork_policy": "allow_forks",
  "full_name": "atlassian/aui",
  "has_issues": false,
  "has_wiki": false,
  "is_private": false,
  "language": "javascript",
  "mainbranch": "master",
  "name": "aui",
  "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": 155031915,
  "slug": "aui",
  "updated_at": "2026-11-05T09:23:39.322632+00:00",
  "url": "https://bitbucket.org/atlassian/aui",
  "uuid": "{585074de-7b60-4fd1-81ed-e0bc7fafbda5}",
  "watcher_count": 4,
  "website": "http://docs.atlassian.com/aui/latest/",
  "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 inputs identify the repository?
Pass workspace/repo such as atlassian/aui, or pass a full bitbucket.org repository URL in repo.

### Does this endpoint return repository files or pull requests?
No. It returns repository-level metadata. Use the Bitbucket Repository Source API or Pull Request API for files and PRs.

### What clone protocols appear in clone_urls?
clone_urls lists available clone endpoints with their protocol name and href URL as reported by the source.

### Are fork_count and watcher_count quality scores?
No. They are raw platform counts that reflect public repository activity at retrieval time.

### How do I get fresh data instead of a cached response?
Pass fresh=1 to bypass the 24-hour cache; add raw=0 to omit bulky raw source blocks.

### Are CSV or NDJSON formats available?
No. This OpenAny product returns JSON only; omit output or use output=json.

## Available implementations
- apish: https://openany.si/bitbucket/bitbucket-repository-api/e42f8591-dae0-484b-b9e1-76b2a0f1ae65/

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