828 posts
  • Has been part of the Envato Community for over 4 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

1101 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+6 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.

828 posts
  • Has been part of the Envato Community for over 4 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

Helpful Information

  • 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.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by