To use the widget, add a
<script> tag to the page and then add the
<istock-affiliate> tag in the HTML where the image list is desired.
<html> ... <script src="https://developers.gettyimages.com/libs/affiliate/1.0/istock.js"></script> ... <hr /> <istock-affiliate api-key="API_KEY" affiliate-id="AFFILIATE_ID" search-phrase="trees" item-count="6" orientation="horizontal" image-style="photography" /> <hr /> ... </html>
The above would produce this output:
vertical. Default is
vector. If left blank, results will be mixed. Optional
The affiliate widget supports multiple instances on the same page, with a few caveats:
item-countin each instance.
item-countvalue should be less than or equal to 20.
For example, if there are 2 instances of the widget on a page and the
item-count for each is set to 10, there will be no duplicate images displayed and both instances will display the desired number of images. However, if there are 3 instances of the widget on the page and
item-count is set to 8, the first and second instances of the widget would display 8 images each, but the third instance would only display 4.
If the Affiliate Widget does not meet your needs, we have two search API endpoints designed specifically for Affiliate Partners:
You can read the full documentation in the AffiliateSearch section of our Open API Documentation (Swagger).