1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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

1486 posts
  • Trendsetter
  • Most Wanted Winner
  • Author Level 5
  • Collector Level 3
+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.

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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