Sample - GitHub REST API
GET/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}

Get a CodeQL database for a repository

Gets a CodeQL database for a language in a repository.

By default this endpoint returns JSON metadata about the CodeQL database. To download the CodeQL database binary content, set the Accept header of the request to application/zip, and make sure your HTTP client is configured to follow redirects or use the Location header to make a second request to get the redirect URL.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
languagestringrequired
The language of the CodeQL database.

5 status codes
200Response
idintegerrequired
The ID of the CodeQL database.
namestringrequired
The name of the CodeQL database.
languagestringrequired
The language of the CodeQL database.
uploaderobjectrequired
A GitHub user.
content_typestringrequired
The MIME type of the CodeQL database file.
sizeintegerrequired
The size of the CodeQL database file in bytes.
created_atstringrequired
The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
updated_atstringrequired
The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
urlstringrequired
The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property.
commit_oidstringoptional
The commit SHA of the repository at the time the CodeQL database was created.
302Found
403Response if GitHub Advanced Security is not enabled for this repository
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
503Service unavailable
codestringoptional
messagestringoptional
documentation_urlstringoptional

Error handling

A 403 is returned: Response if GitHub Advanced Security is not enabled for this repository. A 404 is returned: Resource not found. A 503 is returned: Service unavailable.