GitHub Repos Get Content
1 credits/call
ae_github_repos_get_content
View or download files, directories, or documentation (like READMEs) from a GitHub repository without cloning it.
1 credits/call
Pricing
1 credits/call
| Condition | Charge |
|---|---|
| Each call | 1 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
ref | string | No | The name of the commit/branch/tag. Default: the repository’s default branch. | — |
path | string | Yes | path parameter | — |
repo | string | Yes | The name of the repository without the `.git` extension. The name is not case sensitive. | — |
owner | string | Yes | The account owner of the repository. The name is not case sensitive. | — |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeyRequest coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_github_repos_get_content' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"owner": "tochris",
"path": "pts_calibrator.py",
"repo": "pts-uncertainty"
}
}'Response exampleresponse.json
{
"_links": {
"git": "https://api.github.com/repos/tochris/pts-uncertainty/git/blobs/cb64ea7e08c2dc42b2e4df46f74fefb73761eef5",
"html": "https://github.com/tochris/pts-uncertainty/blob/main/pts_calibrator.py",
"self": "https://api.github.com/repos/tochris/pts-uncertainty/contents/pts_calibrator.py?ref=main"
},
"content": "aW1wb3J0IG9zCmltcG9ydCB0ZW5zb3JmbG93IGFzIHRmCmltcG9ydCBudW1w\neSBhcyBucAoKY2xhc3MgUFRTX2NhbGlicmF0b3IoKToKICAgICIiIkNsYXNz\nIGZvciBQYXJhbWV0ZXJpemVkIFRlbXBlcmF0dXJlIFNjYWxpbmcgKFBUUyki\nIiIKICAgIGRlZiBfX2luaXRfXygKICAgICAgICBzZWxmLAogICAgICAgIGVw\nb2NocywKICAg",
"download_url": "https://raw.githubusercontent.com/tochris/pts-uncertainty/main/pts_calibrator.py",
"name": "pts_calibrator.py",
"type": "file",
"url": "https://api.github.com/repos/tochris/pts-uncertainty/contents/pts_calibrator.py?ref=main"
}This example shows part of the response. Copied content is valid JSON.

