ARTIFACTORY: How to retrieve information about artifacts?

AuthorFullName__c
Andrey Granovsky
articleNumber
000005539
FirstPublishedDate
2023-01-05T17:02:53Z
lastModifiedDate
2025-07-20

ARTIFACTORY: How to retrieve information about artifacts?

In addition to the ability of uploading & downloading artifacts, Artifactory also stores a lot of information and metadata on each and every artifact. This information can be useful for different purposes, and below you will find examples of the available information and how to retrieve it.

Most of the information, such as properties, statistics, last modified date or additional information, can be retrieved using REST APIs. In addition to the REST APIs, GraphQL and AQL can also provide valuable information.

For the examples below we will use the following sample variables:
Repository - "generic-local"
File Name - "test.zip"
Username - "admin"

Please note that the examples below are simplified, more information about each REST API can be found in the links below.

File Info - Retrieves information about an item

Example of use:
 

curl -u admin "$JFROG_URL/artifactory/api/storage/generic-local/test.zip"


Sample Output:
 

{
  "repo" : "generic-local",
  "path" : "/test.zip",
  "created" : "2023-01-03T12:44:40.588Z",
  "createdBy" : "admin@test.com",
  "lastModified" : "2023-01-03T12:44:38.061Z",
  "modifiedBy" : "admin@test.com",
  "lastUpdated" : "2023-01-03T12:44:40.589Z",
  "downloadUri" : "$JFROG_URL/artifactory/generic-local/test.zip",
  "mimeType" : "application/zip",
  "size" : "176",
  "checksums" : {
    "sha1" : "5dfaf15eaa22fe0bfe8b7a2f89da3dee08e4663e",
    "md5" : "4b819b4144645153558212e8cf03b01e",
    "sha256" : "6d99ff215c0cc721fd054c1df63e27ce735d04c75af71c9e619e9207c12133f3"
  },
  "originalChecksums" : {
    "sha1" : "5dfaf15eaa22fe0bfe8b7a2f89da3dee08e4663e",
    "md5" : "4b819b4144645153558212e8cf03b01e",
    "sha256" : "6d99ff215c0cc721fd054c1df63e27ce735d04c75af71c9e619e9207c12133f3"
  },
  "uri" : "$JFROG_URL/artifactory/api/storage/generic-local/test.zip"
}


Folder Info - Retrieves folder information 

Example of use:

curl -u admin "$JFROG_URL/artifactory/api/storage/generic-local"


Sample Output:
 

{
  "repo" : "generic-local",
  "path" : "/",
  "created" : "2021-04-29T12:37:59.404Z",
  "lastModified" : "2021-04-29T12:37:59.404Z",
  "lastUpdated" : "2021-04-29T12:37:59.404Z",
  "children" : [ {
    "uri" : "/example-test-folder",
    "folder" : true
  }, {
    "uri" : "/test.rar",
    "folder" : false
  }, {
    "uri" : "/test.zip",
    "folder" : false
  } ],
  "uri" : "$JFROG_URL/artifactory/api/storage/generic-local"
}


Item Last Modified - Retrieves the last modified item at the given path

Example of use:
 

curl -u admin "$JFROG_URL/artifactory/api/storage/generic-local/test.zip\?lastModified"


Sample Output:
 

{
  "uri" : "$JFROG_URL/artifactory/api/storage/generic-local/test.zip",
  "lastModified" : "2023-01-03T13:15:01.584+0000"
}


File Statistics -  Retrieves item statistics

Example of use:
 

curl -u admin "$JFROG_URL/artifactory/api/storage/generic-local/test.zip?stats"


Sample Output:
 

{
  "uri" : "$JFROG_URL/artifactory/generic-local/test.zip",
  "downloadCount" : 3,
  "lastDownloaded" : 1672752674260,
  "lastDownloadedBy" : "admin@test.com",
  "remoteDownloadCount" : 0,
  "remoteLastDownloaded" : 0
}


Item Properties - Retrieves item properties 

Example of use:
 

curl -u admin "$JFROG_URL/artifactory/api/storage/generic-local/test.zip?properties"


Sample Output:
 

{
  "properties" : {
    "example" : [ "1" ],
    "test" : [ "2" ]
  },
  "uri" : "$JFROG_URL/artifactory/api/storage/generic-local/test.zip"
}


It is also possible to retrieve metadata of packages in Artifactory using GraphQL.
Note that to use GraphQL, you will need a scoped token for Artifactory in order to query the metadata server.

The following sample query will:

  1. Search for NPM and Docker packages only
  2. Filter packages that contain "table" in their name
  3. Return these fields:  id, name, description, created, packageType, versionsCount
  4. Show the first 5 results
  5. Order by package name
curl -H "Authorization: Bearer <SCOPEDToken>" -XPOST $JFROG_URL/metadata/api/v1/query -d '{"query": "{ packages( filter: { name:  \"*table*\", packageTypeIn: [NPM, DOCKER]  },first: 5, orderBy: { field: NAME, direction: DESC   }) { edges { node { id name description created modified packageType versionsCount}}}}"}' | jq


Sample Output:
 

{
  "data": {
    "packages": {
      "edges": [
        {
          "node": {
            "id": "npm://text-table",
            "name": "text-table",
            "description": "borderless text tables with alignment",
            "created": "2022-08-01T10:59:00.314Z",
            "modified": "2018-05-27T19:16:52Z",
            "packageType": "npm",
            "versionsCount": 1
          }
        },
        {
          "node": {
            "id": "npm://json-stable-stringify-without-jsonify",
            "name": "json-stable-stringify-without-jsonify",
            "description": "deterministic json.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies",
            "created": "2022-08-01T10:58:58.118Z",
            "modified": "2018-05-27T05:40:58Z",
            "packageType": "npm",
            "versionsCount": 1
          }
        },
        {
          "node": {
            "id": "npm://immutable",
            "name": "immutable",
            "description": "immutable data collections",
            "created": "2022-08-01T10:58:56.614Z",
            "modified": "2022-05-23T19:04:50Z",
            "packageType": "npm",
            "versionsCount": 1
          }
        },
        {
          "node": {
            "id": "npm://fast-json-stable-stringify",
            "name": "fast-json-stable-stringify",
            "description": "deterministic `json.stringify()` - a faster version of substack's json-stable-strigify without jsonify",
            "created": "2022-08-01T10:59:00.228Z",
            "modified": "2019-12-14T16:18:01Z",
            "packageType": "npm",
            "versionsCount": 1}}]}}}


In addition to the above, we can also use Artifactory Query Language to retrieve data related to artifacts and builds stored in Artifactory.

The following example lists all the items from the “generic-local” repository and will display the fields for each of the artifacts that are provided in the include section of the query:
 

curl -X POST "$JFROG_URL/artifactory/api/search/aql" -u admin -H "Content-Type: text/plain" -d 'items.find({"repo":"generic-local"}).include("repo","name","path","created","modified","sha256","size")'


Sample Output:
 

{
"results" : [ {
  "repo" : "generic-local",
  "path" : ".",
  "name" : "test.rar",
  "size" : 18,
  "created" : "2022-09-15T13:11:45.880Z",
  "modified" : "2022-09-15T13:11:45.791Z",
  "sha256" : "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},{
  "repo" : "generic-local",
  "path" : ".",
  "name" : "test.zip",
  "size" : 176,
  "created" : "2023-01-03T12:44:40.588Z",
  "modified" : "2023-01-03T13:15:01.584Z",
  "sha256" : "6d99ff215c0cc721fd054c1df63e27ce735d04c75af71c9e619e9207c12133f3"
} ],
"range" : {
  "start_pos" : 0,
  "end_pos" : 2,
  "total" : 2
}
}


Additional examples and available filters can be found in the Artifactory Query Language documentation.