Skip to main content
New Participant
December 26, 2024
Answered

Adobe Stock Api Filters

  • December 26, 2024
  • 2 replies
  • 459 views

Hi,

 

Currently working on the implementation to import the adobe stock images to aem dam. For that we would like to include the condition to filter the specific content_type and date range for the licensed assets.

I am looking for the help, is there any way to directly filter the content_type and date range from the curl command or using the query? When hitting this command https://stock.adobe.io/Rest/Libraries/1/Member/LicenseHistory?locale=en_US&search_parameters[limit]=1&search_parameters[offset]=0 i am getting the following result. 

{
"nb_results":,
"files": [
{
"license": "Extended",
"license_date": "12/24/24, 5:39 AM",
"download_url": "",
"id":,
"title": "",
"creator_name": "",
"creator_id":,
"content_url": "",
"media_type_id": 2,
"vector_type": null,
"content_type": "image/jpeg",
"height": 3072,
"width": 5120,
"details_url": ""
}
] from the result i want to check the content_type is image/jpeg and would like to check the date range also. I checked the documentation and got the below curl "https://stock.adobe.io/Rest/Media/1/Search/Files?locale=en_US
&search_parameters%5Bwords%5D=dogs&search_parameters%5Blimit%5D=1&search_parameters%5Bfilters%5D%5Bcontent_type%3Aphoto%5D=1&search_parameters%5Border%5D=nb_downloads&result_columns%5B%5D=title&result_columns%5B%5D=details_url&result_columns%5B%5D=thumbnail_1000_url" \
-H "x-api-key: YourApiKeyHere" \
-H "x-product: MySampleApp/1.0" . But here content_type is specified as photo., means i am getting all the types of photos. 
 
If anyone knows the way how to sort this using a query, please let me know here. Thanks in advance!
 
 
 
Regards,
Bhavani Bharanidharan.
Correct answer CFS the Stock API Guy

Hi Bhavani,

 

It is not possible to filter the response from the License History API. You would need to fetch each page of the history (a JSON array) and apply some application logic to find only assets with the fields you need. Both content type and license date should be in the response. After you have created this filtered list, then you can download the files with the URLs also provided in the response. 

 

Net, the flow would be 1) fetch license history > 2) filter the JSON response > 3) download assets. The API returns the newest assets first, so after this one-time effort to pull down all of the history, you can then run this process only on new assets. But there is no way using the API to fetch only one asset from a particular date. For that finer-grained control, you would need to use the License History on the Stock website.

 

If you have additional questions, please email stockapis@adobe.com.

 

Thanks,

Christopher

Thanks for the mention, @Abambo. Happy New Year! 🥳

2 replies

CFS the Stock API GuyCorrect answer
Adobe Employee
January 2, 2025

Hi Bhavani,

 

It is not possible to filter the response from the License History API. You would need to fetch each page of the history (a JSON array) and apply some application logic to find only assets with the fields you need. Both content type and license date should be in the response. After you have created this filtered list, then you can download the files with the URLs also provided in the response. 

 

Net, the flow would be 1) fetch license history > 2) filter the JSON response > 3) download assets. The API returns the newest assets first, so after this one-time effort to pull down all of the history, you can then run this process only on new assets. But there is no way using the API to fetch only one asset from a particular date. For that finer-grained control, you would need to use the License History on the Stock website.

 

If you have additional questions, please email stockapis@adobe.com.

 

Thanks,

Christopher

Thanks for the mention, @Abambo. Happy New Year! 🥳

Abambo
Adobe Expert
January 2, 2025
quoteThanks for the mention, @Abambo. Happy New Year! 🥳

By @CFS the Stock API Guy

You're welcome and a Happy New Year. 

ABAMBO | Hard- and Software Engineer | Photographer
Abambo
Adobe Expert
January 1, 2025
ABAMBO | Hard- and Software Engineer | Photographer