Skip to main content
GET
/
repositories
/
{repository_id}
/
github-tree
Get GitHub tree structure
curl --request GET \
  --url https://apigcp.trynia.ai/v2/repositories/{repository_id}/github-tree \
  --header 'Authorization: Bearer <token>'
{
  "repository": "<string>",
  "branch": "<string>",
  "tree": [
    {
      "path": "<string>",
      "type": "file",
      "sha": "<string>"
    }
  ],
  "stats": {
    "total_files": 123,
    "total_directories": 123
  },
  "formatted_tree": "<string>"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Path Parameters

repository_id
string
required

Repository identifier in owner/repo format

Query Parameters

branch
string

Branch name (defaults to repository's default branch)

include_paths
string[]

Only show files in these paths (e.g., "src/,lib/")

exclude_paths
string[]

Hide files in these paths (e.g., "node_modules/,dist/")

file_extensions
string[]

Only show these file types (e.g., ".py,.js,.ts")

exclude_extensions
string[]

Hide these file types (e.g., ".md,.lock,.json")

show_full_paths
boolean
default:false

Show full paths instead of tree structure

Response

GitHub tree retrieved successfully

repository
string

Repository identifier

branch
string

Branch name

tree
object[]
stats
object
formatted_tree
string

Text representation of the tree structure