You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
We're introducing a new[license API](/v3/licenses) preview to support[open source license usage on GitHub.com](https://github.com/blog/1964-license-usage-on-github-com).
9
+
10
+
To access the API during the preview period, you must provide a custom[media type](/v3/media) in the`Accept` header:
11
+
12
+
application/vnd.github.drax-preview+json
13
+
14
+
This will then expose two new API endpoints. You can get a list of all known licenses:
15
+
16
+
GET /licenses
17
+
18
+
Or get information about a particular license:
19
+
20
+
GET /licenses/mit
21
+
22
+
When the preview media type is passed, the repository api will also return information about a repository's license file when you get an individual repository:
23
+
24
+
GET /repos/github/hubot
25
+
26
+
For more information, see the[licenses API documentation](/v3/licenses/), and if you have any questions or feedback, please[let us know](https://github.com/contact?form%5Bsubject%5D=Licenses+API).
The Licenses API is currently available for developers to preview.
15
+
During the preview period, the API may change without advance notice.
16
+
Please see the[blog post][https://github.com/blog/1964-open-source-license-usage-on-github-com] for full details.
17
+
18
+
To access the API during the preview period, you must provide a custom[media type](/v3/media) in the`Accept` header:
19
+
20
+
application/vnd.github.drax-preview+json
21
+
22
+
{{/tip}}
23
+
24
+
The Licenses API returns metadata about popular open source licenses and information about a particular project's license file. The license key and name conforms to the[SPDX specification](https://spdx.org/).
25
+
26
+
{{#warning}}
27
+
28
+
GitHub is a lot of things, but it’s not a law firm. As such, GitHub does not provide legal advice. Using the Licenses API or sending us an email about it does not constitute legal advice nor does it create an attorney-client relationship. If you have any questions about what you can and can't do with a particular license, you should consult with your own legal counsel before moving forward. In fact, you should always consult with your own lawyer before making any decisions that might have legal ramifications or that may impact your legal rights.
29
+
30
+
GitHub created the License API to help users get information about open source licenses and the projects that use them. We hope it helps, but please keep in mind that we’re not lawyers (at least not most of us aren't) and that we make mistakes like everyone else. For that reason, GitHub provides the API on an “as-is” basis and makes no warranties regarding any information or licenses provided on or through it, and disclaims liability for damages resulting from using the API.
31
+
32
+
{{/warning}}
33
+
34
+
##List all licenses
35
+
36
+
GET /licenses
37
+
38
+
###Response
39
+
40
+
<%= headers 200 %>
41
+
<%= json(:licenses) %>
42
+
43
+
##Get an individual license
44
+
45
+
GET /licenses/mit
46
+
47
+
###Response
48
+
49
+
<%= headers 200 %>
50
+
<%= json(:mit) %>
51
+
52
+
##Get a repository's license
53
+
54
+
When passed the preview media type, requests to get a repository will also return the repository's license, if it can be detected from the repository's license file.
55
+
56
+
It's important to note that the API simply attempts to identity the project's license by the contents of the a`LICENSE` file, if any, and does not take into account the licenses of project dependencies or other means of documenting a project's license such as references in the documentation.
"description"=>"A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.",
2336
+
"category"=>"MIT",
2337
+
"implementation"=>
2338
+
"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.",
"\n\nThe MIT License (MIT)\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the\"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED\"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"