# Bitbucket repository source entries API

Get Bitbucket Repository Source 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 queried workspace/repo identifier, returned resource type, and repository-relative entry path to explore repository folders, read specific source files, and audit files across commits.

Documentation: https://openany.si/bitbucket/bitbucket-repository-source-entries-api/ff1e55c0-43d6-4819-a417-3c8662c561eb/
API ID: ff1e55c0-43d6-4819-a417-3c8662c561eb
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/source
Page update time: 2026-12-03T02:55:00.358Z
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.575Z. 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 Source API

Supply repo plus optional ref (defaulting to the main branch) and path (defaulting to repository root). Folder requests return entries\[\] with next\_cursor for continuation, whereas pointing path at a file returns that file's available text up to 500 KB.

## What You Can Build

- **Explore repository folders**: List root or subdirectory entries at a branch or tag to locate configuration files and documentation.
- **Read specific source files**: Point path at a file to inspect its text content (up to 500 KB) without cloning the repository.
- **Audit files across commits**: Pass a commit SHA or tag in ref to compare directory layouts or file text across revisions.

## Returned Data

| Field | Meaning |
| --- | --- |
| `repo` | Queried workspace/repo identifier |
| `ref` | Branch, tag or commit queried |
| `path` | Requested folder or file path |
| `type` | Returned resource type (directory or file) |
| `entries[].name` | Entry file or folder name |
| `entries[].path` | Repository-relative entry path |
| `entries[].type` | Entry kind reported by Bitbucket |
| `entries[].size_bytes` | Reported file size in bytes |
| `next_cursor` | Continuation cursor for folder listings |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bitbucket repository source entries 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."
        },
        "ref": {
          "type": "string",
          "description": "Branch, tag or commit (default: the main branch)."
        },
        "path": {
          "type": "string",
          "description": "Folder or file path (default: the root folder)."
        },
        "cursor": {
          "type": "string",
          "description": "`next_cursor` from the previous page of a folder listing."
        },
        "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": {
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "entries": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "mimetype": {
                "type": "null"
              },
              "name": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "size_bytes": {
                "type": "null"
              },
              "type": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "next_cursor": {
      "type": "null"
    },
    "path": {
      "type": "string"
    },
    "ref": {
      "type": "string"
    },
    "repo": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/bitbucket/v1/source?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
{
  "cached": false,
  "count": 41,
  "credits_used": 1,
  "entries": [
    {
      "mimetype": null,
      "name": ".bitbucket",
      "path": ".bitbucket",
      "size_bytes": null,
      "type": "dir"
    },
    {
      "mimetype": null,
      "name": ".mvn",
      "path": ".mvn",
      "size_bytes": null,
      "type": "dir"
    },
    "… 39 more"
  ],
  "next_cursor": null,
  "path": "",
  "ref": "master",
  "repo": "atlassian/aui",
  "type": "dir"
}
```

## 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
### How does this endpoint handle folders versus files?
Pointing path at a directory (or omitting it for root) returns paginated entries[]; pointing path at a file returns that file's available text.

### What is the file text size limit?
Returned file text is limited to 500 KB.

### When should I use the cursor parameter?
Use cursor with the returned next_cursor value only when paging through folder listings; single-file retrieval is not paginated.

### What branch is queried if ref is omitted?
When ref is omitted, the operation defaults to the repository's main branch.

### Can I pass a Bitbucket URL in repo?
Yes. repo accepts either workspace/repo or a bitbucket.org repository link.

### How do I fetch live source changes?
Pass fresh=1 to skip the 24-hour cache, and raw=0 to omit bulky raw source blocks.

## Available implementations
- apish: https://openany.si/bitbucket/bitbucket-repository-source-entries-api/ff1e55c0-43d6-4819-a417-3c8662c561eb/

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