Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!

Get a file from a repository

GET
/repos/{owner}/{repo}/raw/{filepath}
curl --request GET \
--url https://gitea.com/api/v1/repos/example/example/raw/example \
--header 'Authorization: Basic <credentials>'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

filepath
required
string

Path of the file to get, it should be “{ref}/{filepath}”. If there is no ref could be inferred, it will be treated as the default branch

ref
string

The name of the commit/branch/tag. Default to the repository’s default branch

Returns raw file content.

Media typeapplication/octet-stream
string format: binary

APINotFound is a not found empty response