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.

Productivity
1 credits/call

Pricing

1 credits/call
ConditionCharge
Each call1 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
refstringNoThe name of the commit/branch/tag. Default: the repository’s default branch.—
pathstringYespath parameter—
repostringYesThe name of the repository without the `.git` extension. The name is not case sensitive.—
ownerstringYesThe 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-Key
Request 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
JSONPartial content
{
  "_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.