# 2s.io GitHub Repository Branches

> 2s.io GitHub Repository Branches is a paid API for AI agents from 2s.io, paid per call via x402, $0.0025/call, status unknown (last checked 2026-09-14).

Returns all branches of a GitHub repository including branch name, head commit SHA, and branch protection status.

## Facts

- Endpoint: GET https://2s.io/api/github/branches
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-github-repository-branches-4f7b0771
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OdJ4vUGJaxqqbrr_Wz8Tz

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-io-github-repository-branches-4f7b0771
```

Example prompt: Can you list all the branches in the facebook/react GitHub repository, including their head commit SHAs and whether they're protected?

## When to prefer this

Use this endpoint when you need a quick, pay-per-call lookup of branch metadata (names, head SHAs, protection status) for any public GitHub repository without managing GitHub API credentials yourself. Ideal for AI agents that need to inspect repo structure on demand within a multi-step workflow.

## Known failure modes

- Invalid or non-existent owner/repo combination returns an error or empty result
- Rate limiting by upstream GitHub API may cause timeouts
- Missing required owner or repo query parameters returns a validation error
- Private repositories may not be accessible without additional authentication
- Page number out of range returns empty results

## How this service works

Branches of a repository: name, head commit sha, and protection flag. Read-only; no caller key needed.

## Output

A paginated list of branches for the specified repository, each entry containing the branch name, the SHA of the head commit, and a boolean protection flag indicating whether the branch has protection rules enabled.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "owner",
      "repo"
     ],
     "properties": {
      "page": {
       "type": "integer",
       "minimum": 1
      },
      "repo": {
       "type": "string",
       "maxLength": 120,
       "minLength": 1
      },
      "owner": {
       "type": "string",
       "maxLength": 100,
       "minLength": 1
      },
      "perPage": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-github-repository-branches-4f7b0771/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
