GitHub v3 REST API

Get all commonly used licenses

get
{protocol}://{hostname}/api/v3/licenses

Query Parameters

featuredboolean
per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

License Simple

keystringrequired

Example:mit

namestringrequired

Example:MIT License

urlstring | null(uri)required

Example:https://api.github.com/licenses/mit

spdx_idstring | nullrequired

Example:MIT

node_idstringrequired

Example:MDc6TGljZW5zZW1pdA==

html_urlstring(uri)
get/licenses
 
application/json

Get a license

get
{protocol}://{hostname}/api/v3/licenses/{license}

Path Parameters

licensestringrequired

Response

application/json

Response

License

License

keystringrequired

Example:mit

namestringrequired

Example:MIT License

spdx_idstring | nullrequired

Example:MIT

urlstring | null(uri)required

Example:https://api.github.com/licenses/mit

node_idstringrequired

Example:MDc6TGljZW5zZW1pdA==

html_urlstring(uri)required

Example:http://choosealicense.com/licenses/mit/

descriptionstringrequired

Example:A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.

implementationstringrequired

Example:Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders.

permissionsarray[string]required

Example:["commercial-use","modifications","distribution","sublicense","private-use"]

conditionsarray[string]required

Example:["include-copyright"]

limitationsarray[string]required

Example:["no-liability"]

bodystringrequired

Example: The MIT License (MIT) Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

featuredbooleanrequired

Example:true

get/licenses/{license}
 
application/json

Get the license for a repository

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

Similar to Get repository content, this method also supports custom media types for retrieving the raw license content or rendered license HTML.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/license

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

License Content

License Content

namestringrequired
pathstringrequired
shastringrequired
sizeintegerrequired
urlstring(uri)required
html_urlstring | null(uri)required
git_urlstring | null(uri)required
download_urlstring | null(uri)required
typestringrequired
contentstringrequired
encodingstringrequired
_linksobjectrequired
Show Child Parameters
licenseobject | nullrequired

License Simple

Show Child Parameters
get/repos/{owner}/{repo}/license
 
200 application/json

Render a Markdown document

post
{protocol}://{hostname}/api/v3/markdown

Body

application/json
textstringrequired

The Markdown text to render in HTML.

modestring

The rendering mode. Can be either markdown or gfm.

Allowed values:markdowngfm

Default:markdown

Example:markdown

contextstring

The repository context to use when creating references in gfm mode. For example, setting context to octo-org/octo-repo will change the text #42 into an HTML link to issue 42 in the octo-org/octo-repo repository.

Response

text/html

Response

string
post/markdown

Body

{ "text": "text" }
 
text/html

Render a Markdown document in raw mode

You must send Markdown as plain text (using a Content-Type header of text/plain or text/x-markdown) to this endpoint, rather than using JSON format. In raw mode, GitHub Flavored Markdown is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.

post
{protocol}://{hostname}/api/v3/markdown/raw

Body

string

Response

text/html

Response

string
post/markdown/raw

Body

{}
 
text/html