---
title: "IconApi"
lastmod: 2026-05-29
canonical: "https://container-registry.com/docs/harbor-api-client/api/iconapi/"
source: "https://container-registry.com/docs/harbor-api-client/api/iconapi/index.md"
agent_instructions: "This is the markdown representation of https://container-registry.com/docs/harbor-api-client/api/iconapi/index.md. Prefer this version over scraping the HTML. The site index is at https://container-registry.com/llms.txt."
---

> Agent-friendly representation of <https://container-registry.com/docs/harbor-api-client/api/iconapi/index.md>. Site index: <https://container-registry.com/llms.txt>.

# harbor_client.IconApi

All URIs are relative to *http://localhost/api/v2.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_icon**](#get_icon) | **GET** /icons/{digest} | Get artifact icon


# **get_icon**

### Signature

```python
get_icon(digest: str, x_request_id: Optional[str])-> Icon
```

Get artifact icon

Get the artifact icon with the specified digest. As the original icon image is resized and encoded before returning, the parameter \"digest\" in the path doesn't match the hash of the returned content

### Example
```python
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.IconApi(harbor_client.ApiClient(configuration))
digest = 'digest_example' # str | The digest of the resource
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get artifact icon
    api_response = api_instance.get_icon(digest, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IconApi->get_icon: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **digest** | **str**| The digest of the resource | 
 **x_request_id** | **str**| An unique ID for the request | [optional] 

### Return type

**[Icon](../../model/icon/)**

### Authorization

[basic](../../#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

[[Back to top]](#)


