Discontinued

This API no longer responds. Our last check on 2026-07-31 found no working endpoint — the service appears to have shut down or moved. The documentation, code samples and score below are kept for reference only; do not build against this API. See working Development APIs →

Overview

License-API is an unofficial REST wrapper around choosealicense.com that lets you fetch structured data about open-source licenses by their SPDX identifier. You can retrieve full license text, permissions, conditions, and limitations without scraping the website. It is a handy tool for code-hosting platforms, CLI tools, or IDEs that need to display or suggest licenses to developers.

Beginner Tip

No authentication is needed — just call the endpoint with a license ID such as "mit" or "apache-2.0". The base URL is https://choosealicense.com/licenses/ and License-API mirrors that structure as JSON. Start with GET /licenses to list all available licenses before fetching an individual one.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

License-API data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from License-API",
    "description": "Unofficial REST API for choosealicense.com",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

key The SPDX identifier for the license, e.g. "mit" or "apache-2.0".
name Human-readable name of the license, e.g. "MIT License".
body Full text of the license.
permissions List of what the license allows, such as commercial use, modification, or distribution.
conditions Requirements the user must follow, such as license-and-copyright-notice.
limitations Things the license does not permit, such as liability or warranty.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://github.com/cmccandless/license-api/blob/master/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

404 Not Found The license ID in the path does not match any known SPDX identifier (e.g. typos like "MIT" instead of "mit").
Use lowercase SPDX identifiers. Fetch GET /licenses first to get the full list of valid IDs.
Empty or HTML response instead of JSON The base URL points to GitHub README documentation, not the live API host.
Use the actual API host (e.g. https://choosealicense.cmccandless.com) documented in the README, not the GitHub page URL.
CORS error in browser The API does not send CORS headers, so browser-side fetch calls are blocked.
Route requests through a server-side proxy or use the API only in Node.js / backend scripts.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS NO
Category Development
Difficulty Beginner
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →