What is the best way to search for artifacts?

JFrog Support
2016-10-06 13:38

Assuming that you are working with Artifactory 3.5 and above, the best and most flexible way for you to search for artifacts would be to use AQL via our REST API.


Using cURL, you would provide a command based on the following template:

curl -X POST “http://<artifactory url>:<artifactory port>[/artifactory]/api/search/aql” -T <aql json file> -u <admin-user>[:<password>]


Replacing all of the “<your content here>” sections with something that seems like actual content, your command might look something like this:

curl -X POST “http://artifactory.mycompany.com:8081/artifactory/api/search/aql” -T aql.json -u myadmin:myadminPassw0rd

This assumes the following:

    • You’re hosting artifactory at “artifactory.mycompany.com” on port 8081

    • Artifactory is accessible via “/artifactory” from the container root.

    • Your AQL json content is in a file named “aql.json”, located in the same directory where you are running the command

    • You have a user with administrative privileges named “myadmin”, with password “myadminPassw0rd”. It is possible to use AQL without an admin user, but the functionality is greatly reduced.

      • You do not actually have to provide the password in the command. You will be prompted for it if you do not include it as part of the command.


    Now then, the content of the “aql.json” file would look something like what you see in these examples. The simplest content would be a single line: “items.find()”, which returns all of your artifacts, with no filtering and no special content (like properties).

    We’ll leave it to you to look over the documentation and tinker with the various ways that AQL can be used to meet your needs. If you have specific questions/requirements, please ask us; AQL is relatively new and not all of it’s capabilities have been properly documented, so just because a particular type of search isn’t covered in the documentation doesn’t mean that it can’t be accomplished.  We hope this helps you obtain the results that you're looking for.