Get repository content
Returns file metadata and Base64 content, or a directory listing. GitHub file-size and directory limits apply.
GET
/github/repos/{owner}/{repo}/contents/{path}No authentication requiredPath parameters3
| Name | Type | Description |
|---|---|---|
owner* | string | The repository owner login. The value is case-insensitive. |
repo* | string | The repository name without the .git suffix. The value is case-insensitive. |
path* | string | A file or directory path relative to the repository root. Nested paths are supported. |
Query parameters1
| Name | Type | Description |
|---|---|---|
ref | string | A commit, branch, or tag. Defaults to the default branch. |
Headers2
| Name | Type | Description |
|---|---|---|
If-None-Match | string | An ETag for conditional requests. |
If-Modified-Since | string | An HTTP date for conditional requests. |
Responses
application/jsonSchemaGithubContent | GithubContent[]
Must match exactly one schema
Schema 1object
Additional properties are allowed
Schema 2GithubContent[]
The original GitHub response.