# Introducing the new API for OSI Approved Licenses®

**URL:** <https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169>\
**Category:** General\
**Created:** [June 19, 2025, 1:21pm UTC](https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169 "2025-06-19T13:21:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/opensource2/original/1X/bbbe5a4486e2aaa5bc9b1cfc7081eb62c46072a2.svg) [@system](https://discuss.opensource.org/u/system)\
**Post date:** [June 19, 2025, 1:21pm UTC](https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169/1 "2025-06-19T13:21:07Z")

</div>

Originally published at: [Introducing the new API for OSI Approved Licenses® – Open Source Initiative](https://opensource.org/blog/introducing-the-new-api-for-osi-approved-licenses)  
   
The Open Source Initiative (OSI) is excited to announce the availability of a new API service providing access to the canonical list of OSI Approved Licenses®. This service is fully public and free to use.

---

<div class="post-metadata">

**Author:** ![pmonks](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pmonks](https://discuss.opensource.org/u/pmonks)\
**Post date:** [June 20, 2025, 5:24pm UTC](https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169/2 "2025-06-20T17:24:35Z")

</div>

This is great - thanks for making this happen!

As discussed [starting here](https://sfba.social/@pmonks/114710492789148935), it would be fantastic if this API supported literal SPDX license identifiers in the API URLs e.g. `https://opensource.org/api/license/GPL-2.0`. Furthermore it would be ideal if the SPDX identifier portion of these URLs was case _in_sensitive, to align with the SPDX specification i.e. these API URLs should all resolve to the same endpoint:

- `https://opensource.org/api/license/GPL-2.0`
- `https://opensource.org/api/license/gpl-2.0`
- `https://opensource.org/api/license/gPl-2.0`

There’s a slightly tricky corner case around some of the deprecated SPDX identifiers for FSF-published licenses that end in `+` (e.g. `GPL-2.0+`) - it would be ideal if these identifiers were supported too, so that API clients aren’t forced to upgrade these deprecated identifiers to their non-deprecated equivalents (e.g. `GPL-2.0-or-later`) in order to use the API.

The SPDX project has stated that they will never add any new license identifiers that end in `+` (they consider this to have been a historical mistake), so the set of such identifiers is fixed and small (there are 6 of them).

---

<div class="post-metadata">

**Author:** ![nick](https://yyz1.discourse-cdn.com/flex011/user_avatar/discuss.opensource.org/nick/32/542_2.png) [@nick](https://discuss.opensource.org/u/nick)\
**Post date:** [June 23, 2025, 2:40pm UTC](https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169/3 "2025-06-23T14:40:33Z")

</div>

Initial documentation provided by Automattic developer ([Glynn Quelch](https://github.com/gin0115)) who led the project:

# OpenSource Licenses API Documentation

## Overview

The OpenSource Licenses API provides access to information about open source licenses approved by the Open Source Initiative (OSI). This RESTful API allows developers to retrieve license information, filter licenses by various criteria, and access detailed license metadata.

**Base URL:** `https://opensource.org/api`

## Authentication

No authentication is required for this API. All endpoints are publicly accessible.

## Endpoints

### 1. Get All Licenses

Retrieves a list of all public/published licenses.

**Endpoint:** `GET /licenses`

**Description:** Gets all the public/published licenses

**Response:** Array of license objects

**Example Request:**

```http
GET https://opensource.org/api/licenses

```

**Example Response:**

```json
[
  {
    "id": "mit",
    "name": "The MIT License",
    "spdx_id": "MIT",
    "version": "N/A",
    "submission_date": "",
    "submission_url": "",
    "submitter_name": "",
    "approved": false,
    "approval_date": "",
    "license_steward_version": "",
    "license_steward_url": "",
    "board_minutes": "",
    "stewards": [],
    "keywords": ["popular-strong-community"],
    "_links": {
      "self": {
        "href": "https://opensource.org/api/license/mit"
      },
      "html": {
        "href": "https://opensource.org/license/mit"
      },
      "collection": {
        "href": "https://opensource.org/api/licenses"
      }
    }
  }
]

```

### 2. Filter Licenses by Name

Filters licenses by name (partial match).

**Endpoint:** `GET /licenses?name={name}`

**Parameters:**

- `name` (string): Filter licenses whose name contains the specified text

**Description:** Filters any license whose name contains the specified text

**Example Request:**

```http
GET https://opensource.org/api/licenses?name=mit

```

**Example Response:**  
Returns licenses with names containing “mit”, such as:

- MIT No Attribution License
- MITRE Collaborative Virtual Workspace License
- The MIT License

### 3. Filter Licenses by Keywords

Filters licenses by specific keywords.

**Endpoint:** `GET /licenses?keyword={keyword}`

**Parameters:**

- `keyword` (string): Filter licenses by keyword

**Available Keywords:**

- `popular-strong-community`
- `international`
- `special-purpose`
- `non-reusable`
- `superseded`
- `voluntarily-retired`
- `redundant-with-more-popular`
- `other-miscellaneous`
- `uncategorized`

**Example Request:**

```http
GET https://opensource.org/api/licenses?keyword=popular-strong-community

```

**Example Response:**  
Returns popular licenses with strong community support, including:

- Apache License 2.0
- MIT License
- GNU GPL v2/v3
- BSD licenses
- Mozilla Public License 2.0

### 4. Filter Licenses by Steward

Filters licenses by their steward organization.

**Endpoint:** `GET /licenses?steward={steward}`

**Parameters:**

- `steward` (string): Filter licenses by steward organization

**Common Stewards:**

- `eclipse-foundation`
- `free-software-foundation`
- `mozilla-foundation`
- `apache-software-foundation`
- `python-software-foundation`

**Example Request:**

```http
GET https://opensource.org/api/licenses?steward=eclipse-foundation

```

**Example Response:**  
Returns licenses stewarded by the Eclipse Foundation:

- Eclipse Public License version 2.0
- Eclipse Public License v1.0

### 5. Filter Licenses by SPDX ID

Filters licenses by their SPDX identifier with wildcard support.

**Endpoint:** `GET /licenses?spdx={spdx_pattern}`

**Parameters:**

- `spdx` (string): Filter licenses by SPDX identifier (supports wildcards with `*`)

**Description:** Filters licenses by their SPDX identifier. Supports wildcard matching using the `*` character for flexible pattern matching.

**Wildcard Patterns:**

- `prefix*` - Find licenses that **start with** the prefix
- `*suffix` - Find licenses that **end with** the suffix
- `*contains*` - Find licenses that **contain** the text anywhere
- `exact` - Find licenses with **exact match** (no wildcards)

**Example Request:**

```http
GET https://opensource.org/api/licenses?spdx=gpl*

```

**Example Response:**  
Returns licenses with SPDX IDs starting with “gpl”, such as:

- GNU General Public License version 3 (GPL-3.0-only)
- GNU General Public License version 2 (GPL-2.0)

**Additional Examples:**

- `?spdx=mit*` - Find all that start with “mit”
- `?spdx=*bsd` - Find all that end in “bsd”
- `?spdx=*apache*` - Find any that contain “apache”
- `?spdx=mit` - Only an exact match for “mit”

## Response Schema

### License Object

Each license object contains the following fields:

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique identifier for the license |
| `name` | string | Full name of the license |
| `spdx_id` | string | SPDX identifier for the license |
| `version` | string | License version |
| `submission_date` | string | Date when license was submitted (YYYYMMDD format) |
| `submission_url` | string | URL of the original submission |
| `submitter_name` | string | Name of the person who submitted the license |
| `approved` | boolean | Whether the license is approved by OSI |
| `approval_date` | string | Date when license was approved (YYYYMMDD format) |
| `license_steward_version` | string | Version maintained by steward |
| `license_steward_url` | string | URL to steward’s license page |
| `board_minutes` | string | URL to board meeting minutes |
| `stewards` | array | Organizations that steward this license |
| `keywords` | array | Classification keywords for the license |
| `_links` | object | HATEOAS links for related resources |

### Links Object

The `_links` object contains:

| Field | Description |
| --- | --- |
| `self.href` | API endpoint for this specific license |
| `html.href` | Human-readable web page for this license |
| `collection.href` | API endpoint for the licenses collection |

## HTTP Status Codes

| Code | Description |
| --- | --- |
| 200 | OK - Request successful |
| 400 | Bad Request - Invalid parameters |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Server error |

## Rate Limiting

No specific rate limiting information is documented. Standard usage practices apply.

## Examples

### Get all MIT-related licenses

```bash
curl "https://opensource.org/api/licenses?name=mit"

```

### Get all popular licenses

```bash
curl "https://opensource.org/api/licenses?keyword=popular-strong-community"

```

### Get all GNU licenses

```bash
curl "https://opensource.org/api/licenses?steward=free-software-foundation"

```

### Get all GPL licenses using SPDX wildcard

```bash
curl "https://opensource.org/api/licenses?spdx=gpl*"

```

### Get all BSD licenses using SPDX wildcard

```bash
curl "https://opensource.org/api/licenses?spdx=bsd*"

```

## Notes

- All responses are in JSON format
- The API uses standard HTTP methods and status codes
- Responses include HATEOAS links for navigation
- Date fields use YYYYMMDD format
- Empty fields may be represented as empty strings rather than null values
- The `approved` field appears to be consistently `false` in the sample data, likely indicating a data formatting convention rather than actual approval status

## Support

For questions or issues with the API, please reach out to us. Thanks!

---

<div class="post-metadata">

**Author:** ![nick](https://yyz1.discourse-cdn.com/flex011/user_avatar/discuss.opensource.org/nick/32/542_2.png) [@nick](https://discuss.opensource.org/u/nick)\
**Post date:** [July 14, 2025, 4:46pm UTC](https://discuss.opensource.org/t/introducing-the-new-api-for-osi-approved-licenses/1169/4 "2025-07-14T16:46:49Z")

</div>

Thanks to [dineshr93](https://pypi.org/user/dineshr93/) for releasing [osilic: OSI License CLI & Python Package](https://pypi.org/project/osilic/)

> osilic is a Python package and command-line tool for listing, searching, and viewing details of OSI Approved Licenses®

## Features

- List all OSI Approved Licenses®
- View details for a specific license by SPDX ID
- Search licenses by name
- Automatic suggestions for similar licenses if a license is not found
- Usable as a standalone CLI or as a Python package

More details at: [Client Challenge](https://pypi.org/project/osilic/)
