ARTIFACTORY: How to list the content of Artifactory Repositories

AuthorFullName__c
Jordan Tangy
articleNumber
000006140
FirstPublishedDate
2024-07-08T06:08:14Z
lastModifiedDate
2025-07-20

ARTIFACTORY: How to list the content of Artifactory Repositories

When working with Artifactory, a key task is managing and accessing the contents of your repositories. Efficiently listing the content of a repository is crucial for maintaining visibility, ensuring smooth workflows, and optimizing dependency management. In this article, we will explore two different methods to list the contents of an Artifactory repository. 

First Method: The File List REST API

The File List REST API allows you to get a flat (by default) or deep listing of the files and folders (not included by default) within a folder.
For deep listing you can specify an optional depth to limit the results.
The command below allows you to get a flat listing of the files in a repository:

curl -u<USERNAME>:<PASSWORD> https://<ARTF-DOMIAN-NAME>/artifactory/api/storage/<REPO-NAME>?list&deep=1


For example, to display the content of the ‘npm-local’ repository below:

User-added image

The above REST API call returns the following result:

User-added image

Please note that there is a possibility to list the content of a specific folder within a repository by adding the folder name after the repository name:

curl -u<USERNAME>:<PASSWORD> https://<ARTIFACTORY-DOMIAN-NAME>/artifactory/api/storage/<repo-name>/<folder-name>?list&deep=1
Second Method: AQL Queries

AQL runs on Local Repositories, Remote Repositories Caches, Smart Remote Repositories and Virtual Repositories.
To display the whole content of a repository, Artifactory Query Language can be used as follows (Please note that the below query might be resource-intensive for large repositories):

curl -u<USER>:<PASSWORD> -X POST -H 'Content-Type:text/plain' -i https://<ARTIFACTORY-DOMAIN-NAME>/artifactory/api/search/aql --data 'items.find({"repo":"<REPO-NAME>"})'


Additionally, AQL queries can be adjusted to include specific fields in the response, for example, the following request includes the ‘artifact.name’ and ‘artifact.sha1’ values:

curl -u<USER>:<PASSWORD> -X POST -H 'Content-Type:text/plain' -i https://<ARTIFACTORY-DOMAIN-NAME>/artifactory/api/search/aql --data 'items.find({"repo":"<REPO-NAME>"}).include("artifact.name","artifact.sha1")'


To display the content of a Smart Remote Repository, the 'transitive' tag must be added to the query. A Smart Remote Repository is a remote repository that proxies a local, remote, or Federated repository from another instance of Artifactory or an Edge node. Typically, Smart Remote repositories must point to another Artifactory instance. The following command allows to list the content of such repositories:

curl -u<USER>:<PASSWORD> -X POST -H 'Content-Type:text/plain' -i https://<ARTIFACTORY-DOMAIN-NAME>/artifactory/api/search/aql --data 'items.find({"repo":"<SMART-REPO-NAME>"}.transitive()'


More information on AQL queries can be found at this link.