I need help with the Envato API, I am stuck on how to load the thumbnail for search items, I am using CURL to load the items which works fine except on the search
my code is:
<img class="img-responsive" src="',$json_data['search'][$i]['thumbnail'],'" alt="',$json_data['search'][$i]['description'],'" />
I know the rest of my code is fine as the URL and file title displays but won’t show the image (the image source is blank)
I use a similar code for new items e.g.
<img class="img-responsive" src="',$json_data['new-files'][$i]['thumbnail'],'" alt="',$json_data['new-files'][$i]['item'],'" />
Any help is appreciated
The search query does not return the thumbnail, only id and title and url, not the thumbnail, see here: http://marketplace.envato.com/api/edge/search:themeforest,site-templates,xml.json
To get the thumbnail too, you’ll need to first extract from the search the item id, then use that id to make a new query to item details using: http://marketplace.envato.com/api/edge/item:1234.json where 1234 is your item id. This will indeed return the thumbnail.
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.