title: Artifactory API - List all artifacts for a package version
body: <p>What's the best way to list all assets for a given package via the Artifactory API?</p>
  <p>I'm trying to write a script to get the assets for a package and I'd like for it to work with multiple repository types, like Maven and PyPI. I know I could use the Folder Info API to get what I need, but that relies on the repository layout, so it wouldn't work across repository types.</p>
  <p>I'm currently using this AQL search:</p>
  <pre><code>curl -u user:password -X POST http://&lt;artifactory_url&gt;/artifactory/api/search/aql \
  -H &quot;Content-Type: text/plain&quot; \
  -d 'items.find({&quot;repo&quot;: &quot;libs-release-local&quot;}, {&quot;artifact.module.name&quot;: &quot;com.foo.bar:fizz-buzz:1.2&quot;})'
  </code></pre>
  <p>The response is almost what I want, but it seems to be including some assets from a different version of the package I'm searching for:</p>
  <pre><code>{
  &quot;results&quot; : [ {
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.0&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.0.properties&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 790,
    &quot;created&quot; : &quot;2020-09-29T15:35:59.233Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-29T15:35:59.181Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-29T15:35:59.233Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.1&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.1.properties&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 790,
    &quot;created&quot; : &quot;2020-09-29T15:42:34.982Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-29T15:42:34.931Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-29T15:42:34.983Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2-javadoc.jar&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 391843,
    &quot;created&quot; : &quot;2020-09-30T18:54:41.599Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:40.650Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:41.600Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2-sources.jar&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 1089,
    &quot;created&quot; : &quot;2020-09-30T18:54:41.764Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:41.710Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:41.765Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2.jar&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 1410,
    &quot;created&quot; : &quot;2020-09-30T18:54:41.902Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:41.844Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:41.903Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2.module&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 3481,
    &quot;created&quot; : &quot;2020-09-30T18:54:42.015Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:41.962Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:42.015Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2.pom&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 781,
    &quot;created&quot; : &quot;2020-09-30T18:54:42.238Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:42.190Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:42.238Z&quot;
  },{
    &quot;repo&quot; : &quot;libs-release-local&quot;,
    &quot;path&quot; : &quot;com/foo/bar/fizz-buzz/1.2&quot;,
    &quot;name&quot; : &quot;fizz-buzz-1.2.properties&quot;,
    &quot;type&quot; : &quot;file&quot;,
    &quot;size&quot; : 790,
    &quot;created&quot; : &quot;2020-09-30T18:54:42.124Z&quot;,
    &quot;created_by&quot; : &quot;user&quot;,
    &quot;modified&quot; : &quot;2020-09-30T18:54:42.078Z&quot;,
    &quot;modified_by&quot; : &quot;user&quot;,
    &quot;updated&quot; : &quot;2020-09-30T18:54:42.125Z&quot;
  } ],
  &quot;range&quot; : {
    &quot;start_pos&quot; : 0,
    &quot;end_pos&quot; : 8,
    &quot;total&quot; : 8
  }
  }
  </code></pre>
  <p>Notice how it's including the properties file for fizz-buzz 1.0 and 1.1, even though I specified 1.2 in my search.</p>
  <p>Is there a better way to get the information I'm looking for?</p>