← All tags

Licenses API Reference

View various OSS licenses.

3 endpoints tagged licenses, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

Get all commonly used licenses

GET /licenses

Lists the most commonly used licenses on GitHub. For more information, see "Licensing a repository ."

Parameters

NameInRequiredDescription
featuredqueryno
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
304Not modifiedno

Get a license

GET /licenses/{license}

Gets information about a specific license. For more information, see "Licensing a repository ."

Parameters

NameInRequiredDescription
licensepathyes

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
404Resource not foundyes
304Not modifiedno

Get the license for a repository

GET /repos/{owner}/{repo}/license

This method returns the contents of the repository's license file, if one is detected.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
refquerynoThe Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes