1073 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman
says

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

1447 posts
  • Had an item that was trending
  • Won a Most Wanted contest
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+8 more
greenline
says

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.

1073 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman
says

Thanks Greenline, I though as much, will see what I can come up with

by
by
by
by
by
by