RESTful Web Service to get the text of well-known licenses

The licensius site provides technologies to support smart licensing.

Licensius includes a set of HTTP RESTful Web Services. One of them retrieves programmatically the text of 179 well-known licenses.
You can read the full documentation in the testeable swagger.
Nevertheless this post comments the steps towards getting the text of a license.

1. Get the available licenses in the RDFLicense dataset

You may want first a query to see all the licenses we have in the RDFLicense dataset (see our paper at JURIX2014). If you query...

http://www.licensius.com/api/license/list

And you will get a JSON list of URIs of valid RDFLicenses.

[ "http://purl.org/NET/rdflicense/gpl2.0", 
  "http://purl.org/NET/rdflicense/cc-by-nc-nd3.0cn", 
  "http://purl.org/NET/rdflicense/cc-by-sa3.0es", 
  "http://purl.org/NET/rdflicense/IBM1.0", 
  "http://purl.org/NET/rdflicense/cc-by3.0", 
  "http://purl.org/NET/rdflicense/cc-by3.0nl",
etc.

2. Get the languages for which the licenses text is available

You may want to query for the first of the licenses, http://purl.org/NET/rdflicense/gpl2.0, like this:

http://www.licensius.com/api/license/getlicensetext?uri=http%3A%2F%2Fpurl.org%2FNET%2Frdflicense%2Fgpl2.0

Getting as a result:

["en", ]

3. Get the license text

And finally, the service getlicensetext with two parameters (uri of a RDFLicense and a ISO 639-1 language code). From the previous call, we learnt that an English version was available...

http://www.licensius.com/api/license/getlicensetext?uri=http%3A%2F%2Fpurl.org%2FNET%2Frdflicense%2Fgpl2.0&lan=en

The result is plain text:

GNU GENERAL PUBLIC LICENSE Version 2, June 1991 
Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 

Preamble 
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software
etc.

Have fun!