---
title: Get the list of SPDX licenses
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Static Analysis
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get the list of SPDX licenses{% #get-the-list-of-spdx-licenses %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                               |
| ----------------- | -------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/static-analysis-sca/licenses/list |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/static-analysis-sca/licenses/list |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/static-analysis-sca/licenses/list      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/static-analysis-sca/licenses/list      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/static-analysis-sca/licenses/list  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/static-analysis-sca/licenses/list |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/static-analysis-sca/licenses/list     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/static-analysis-sca/licenses/list |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/static-analysis-sca/licenses/list |

### Overview



### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
The top-level response object returned by the licenses list endpoint, containing the array of supported SPDX licenses.

| Parent field | Field                          | Type     | Description                                                                           |
| ------------ | ------------------------------ | -------- | ------------------------------------------------------------------------------------- |
|              | data [*required*]         | object   | The data object in a licenses list response, containing the list of SPDX licenses.    |
| data         | attributes [*required*]   | object   | The attributes of the licenses list response, containing the array of SPDX licenses.  |
| attributes   | licenses [*required*]     | [object] | The list of SPDX licenses returned by the API.                                        |
| licenses     | display_name [*required*] | string   | The human-readable name of the license.                                               |
| licenses     | identifier [*required*]   | string   | The SPDX identifier of the license.                                                   |
| licenses     | short_name [*required*]   | string   | The short name of the license, typically matching the SPDX identifier.                |
| data         | id [*required*]           | string   | The unique identifier for this licenses list response.                                |
| data         | type [*required*]         | enum     | The type identifier for license list responses. Allowed enum values: `licenserequest` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "licenses": [
        {
          "display_name": "MIT License",
          "identifier": "MIT",
          "short_name": "MIT"
        }
      ]
    },
    "id": "0190a3d4-1234-7000-8000-000000000000",
    "type": "licenserequest"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/static-analysis-sca/licenses/list" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get the list of SPDX licenses returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi

configuration = Configuration()
configuration.unstable_operations["list_sca_licenses"] = True
with ApiClient(configuration) as api_client:
    api_instance = StaticAnalysisApi(api_client)
    response = api_instance.list_sca_licenses()

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get the list of SPDX licenses returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_sca_licenses".to_sym] = true
end
api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new
p api_instance.list_sca_licenses()
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get the list of SPDX licenses returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListSCALicenses", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewStaticAnalysisApi(apiClient)
	resp, r, err := api.ListSCALicenses(ctx)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.ListSCALicenses`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.ListSCALicenses`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get the list of SPDX licenses returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StaticAnalysisApi;
import com.datadog.api.client.v2.model.LicensesListResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listSCALicenses", true);
    StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);

    try {
      LicensesListResponse result = apiInstance.listSCALicenses();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling StaticAnalysisApi#listSCALicenses");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get the list of SPDX licenses returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_static_analysis::StaticAnalysisAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListSCALicenses", true);
    let api = StaticAnalysisAPI::with_config(configuration);
    let resp = api.list_sca_licenses().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get the list of SPDX licenses returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listSCALicenses"] = true;
const apiInstance = new v2.StaticAnalysisApi(configuration);

apiInstance
  .listSCALicenses()
  .then((data: v2.LicensesListResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
