SPB Git

About · API

Machine-readable, by default

Everything shown on this site is available as JSON, as raw files or over git itself. Reads are public and need no key; writes require the owner's personal access token.

Git over HTTPS

Every repository is served with the Git smart HTTP protocol. Clone and fetch are anonymous; push uses HTTP Basic with the user spb and a personal access token as the password.

$git clone https://git.spboucher.ai/admin-ka.git
$git ls-remote https://git.spboucher.ai/admin-ka.git

Read endpoints

Base URL https://git.spboucher.ai/api/v1. Responses are JSON; errors use the envelope {"error": {"code", "message"}}.

MethodPathReturns
GET/api/v1/reposEvery repository with its overview (description, topics, languages, counts, last push).
GET/api/v1/repos/:nameOne repository overview.
GET/api/v1/repos/:name/languagesBytes and percentages per language at HEAD.
GET/api/v1/repos/:name/commits?ref=&page=Commit history, 40 per page, with diff statistics.
GET/api/v1/repos/:name/tree?ref=&path=One directory level of the tree at a ref.
GET/api/v1/repos/:name/releasesTags with their attached release assets and checksums.
GET/api/v1/search?q=&scope=&repo=&limit=Scoped search: all, repos, files, commits, branches or readmes.
GET/api/v1/statsSite totals: repositories, commits, streaks, languages.
GET/healthzVersion, uptime, repository count, cache footprint.

Files, archives, feeds

MethodPathReturns
GET/raw/:repo/:ref/:pathThe file as stored, streamed. HTML is served as plain text.
GET/archive/:repo/:ref.zipA zip snapshot of the tree at a branch, tag or commit.
GET/archive/:repo/:ref.tar.gzThe same snapshot as a gzipped tarball.
GET/releases/:repo/:tag/:assetA release asset; the sha256 is in the X-Checksum-Sha256 header.
GET/feed.atomAtom feed of the latest pushes and tags.
GET/sitemap.xmlSitemap of every repository page.
GET/og/:repo.pngThe social card of a repository.

Write endpoints

Owner only: send Authorization: Bearer <token>. The spbgit command line wraps all of them.

MethodPathDoes
POST/api/v1/reposCreate a repository.
PATCH/api/v1/repos/:nameUpdate description, topics, homepage, pinned, research, default branch.
DELETE/api/v1/repos/:nameSoft-delete a repository (recoverable).
PUT/api/v1/repos/:name/releases/:tag/assets/:assetUpload a release asset (streamed to disk).
DELETE/api/v1/repos/:name/releases/:tag/assets/:assetRemove a release asset.
POST/api/v1/tokensMint a personal access token.
GET/api/v1/tokensList tokens (labels and last use, never the secret).
DELETE/api/v1/tokens/:idRevoke a token.
GET/api/v1/whoamiCheck that a token is valid.

Limits and errors

  • Public endpoints are limited to 200 requests per minute per IP address; beyond that the answer is 429 with the code rate_limited.
  • Search queries are capped at 120 characters and limit at 50 results per group.
  • Unknown repositories and refs answer 404 with not_found or ref_not_found.
  • Definitions of every count returned by /api/v1/stats are on the metrics page.
Menu

Theme