GitHubFolder API

GitHubFolder has a free, CORS-open JSON API for scripting. Hit one GET endpoint with a GitHub folder URL and get back folder metadata — file list, sizes, branch — plus a deep_link back into the tool. It does not return a server-generated ZIP: zipping happens client-side by design, so this endpoint never proxies or stores your file contents.

The endpoint is GET https://githubfolder.getinfotoyou.com/api.php?url={encoded GitHub folder URL}. In this version it supports GitHub only — not GitLab or Bitbucket, even though the main tool handles all three. It's rate-limited to 30 requests per hour per IP, and every response includes Access-Control-Allow-Origin: *, so you can call it directly from browser JavaScript on any origin, not just from a server.

Example request

curl "https://githubfolder.getinfotoyou.com/api.php?url=https://github.com/octocat/Hello-World"

Example response

{
  "ok": true,
  "input_url": "https://github.com/octocat/Hello-World",
  "host": "github",
  "owner": "octocat",
  "repo": "Hello-World",
  "branch": "master",
  "path": "",
  "file_count": 2,
  "total_size_bytes": 913,
  "truncated": false,
  "files": [
    { "path": "README", "size": 44 },
    { "path": "CONTRIBUTING.md", "size": 869 }
  ],
  "deep_link": "https://githubfolder.getinfotoyou.com/?url=https%3A%2F%2Fgithub.com%2Foctocat%2FHello-World&filename=Hello-World-Hello-World.zip"
}

Query parameters

  • url (required) — a GitHub repo or folder URL, URL-encoded. Accepts plain repo root URLs as well as /tree/branch/path folder URLs.

Response fields

  • oktrue on success, false on error.
  • input_url — the exact url value you passed in, echoed back.
  • host — always "github" in this version.
  • owner — the GitHub username or organization that owns the repo.
  • repo — the repository name (with any trailing .git stripped).
  • branch — the branch (or other ref) the folder was resolved against.
  • path — the subfolder path within the repo; an empty string means the repo root.
  • file_count — number of files (blobs, not subfolders) found under that path.
  • total_size_bytes — sum of the size of every file listed.
  • truncatedtrue if the repository is large enough that some deeply nested files may be missing from files.
  • files[] — array of { "path": string, "size": number } objects, one per file.
  • deep_link — a URL back into the GitHubFolder tool, pre-filled with the same folder and a suggested filename, that builds the actual ZIP client-side.

Error responses

On failure, ok is false and the HTTP status reflects the error:

{
  "ok": false,
  "error_code": "REPO_NOT_FOUND",
  "message": "That repository does not exist or is private."
}

Possible error_code values:

  • INVALID_URL — the url parameter was missing, empty, or not a recognizable GitHub URL (400).
  • REPO_NOT_FOUND — the owner/repo does not exist or is private (404).
  • BRANCH_NOT_FOUND — the branch or ref in the URL doesn't exist on that repo (404).
  • PATH_NOT_FOUND — the branch exists but the folder path inside it does not (404).
  • POOL_EXHAUSTED — the server-side GitHub token pool is temporarily out of quota; includes a wait_seconds field (429).
  • LOCAL_RATE_LIMITED — you've exceeded 30 requests/hour from this IP; includes a wait_seconds field (429).

This API does not build ZIPs

This API does not generate a ZIP file for you — it returns metadata and a deep_link back into the GitHubFolder tool, where the actual ZIP is built in the visitor's browser. This keeps the architecture honest: we never proxy or store your file contents server-side.

Rate limits and heavier usage

The public endpoint is capped at 30 requests per hour per IP, which is meant for occasional scripted lookups, curl one-liners, and embedding in third-party directories or tools — not bulk crawling. If you need to pull many folders programmatically on a regular basis, a plain git clone with a sparse-checkout is a better fit than hammering this API; see the git sparse-checkout guide for the command-line method.

Related