cURL
curl --request POST \ --url https://apigcp.trynia.ai/v2/github/read \ --header 'Content-Type: application/json' \ --data ' { "repository": "<string>", "path": "<string>", "ref": "HEAD", "start_line": 2, "end_line": 2 } '
{ "detail": [ { "loc": [ "<string>" ], "msg": "<string>", "type": "<string>" } ] }
Read a file from a GitHub repository with optional line range.
Repository in owner/repo format
File path within the repository
Branch, tag, or commit SHA
1-based start line
x >= 1
1-based end line (inclusive)
Successful Response
Was this page helpful?