GitHub v3 REST API

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
http://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

markdown

Render GitHub flavored markdown

Render a Markdown document

post
http://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
http://HOSTNAME/api/v3/markdown/raw

Body

string

Response

text/html

Response

string
post/markdown/raw

Body

{}
 
text/html

meta

Endpoints that give information about the API.