+1 (888) 674-2299

30,949,497 Royalty Free Stock Photos

How to use the Fotolia API

Method: getSearchResults

This methods makes possible to search media in fotolia image bank. Full search capabilities are available through the API.

Authentication

This method does not require authentication.

Arguments

Argument Type Element (array) Valid Values Default Value Detail
api_key string Valid Values none you need a valid api key to use the API
search_parameters array see below
search_parameters[language_id] Int
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 11
2
  • French
  • English US
  • English UK
  • German
  • Spanish
  • Italian
  • Portuguese PT
  • Portuguese BR
  • Japanese
  • Polish
search_parameters[words] string list of words none keyword search
words can also be media_id using # to search for some media ( ex : #20 #21 #22)
search_parameters[creator_id] int valid creator id none Search by creator
search_parameters[cat1_id] int valid category1 id none Search by representative category
get valid categories1 ids width getCategories1
search_parameters[cat2_id] int valid category2 id none Search by conceptual category
get valid valid category2 id's width getCategories2
search_parameters[gallery_id] int valid gallery id none Search by gallery
get valid galleries id's with getGalleries
search_parameters[color_name] string valid color name none Search by color
get valid color names with getColors
search_parameters[country_id] int valid country id none Search by country
get valid country id's with getCountries
search_parameters[media_id] int existing media id none Search by media id
search_parameters[model_id] int existing media id none Search by same model
search_parameters[serie_id] int existing media id none Search by same serie
search_parameters[similia_id] int existing media id none Search by similar media (similia)
search_parameters[filters] array
  • content_type:photo
  • content_type:illustration
  • content_type:vector
  • content_type:video
  • content_type:all
  • offensive:2
  • isolated :on
  • panoramic:on
  • license_L:on
  • license_XL:on
  • license_XXL:on
  • license_V_HD1080:on
  • license_V_HD720:on
  • license_X:on
  • licence_E:on
  • orientation
  • age
  • video_duration
  • max_price_xs
  • max_price_x
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • 0 - 1
  • horizontal
  • vertical
  • all
  • 1w
  • 1m
  • 6m
  • 1y
  • 2y
  • all
  • all
  • 0
  • 10
  • 20
  • 30
  • all
  • 1
  • 2
  • 0
  • 0
  • 0
  • 1
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • all
  • all
  • all
  • all
  • Search for photos
  • Search for illustration (jpg)
  • Search for illustration (svg)
  • Search for all (default)
  • Explicit/Charm/Nudity/Violence excluded
  • Isolated contents
  • Panoramic images
  • L size available
  • XL size available
  • XXL size available
  • Extended licence availble
  • Exclusive buy out available
  • only horizontal image
  • only vertical image
  • all images (default)
  • only images 1 week old
  • only images 1 month old
  • only images 6 months old
  • only images 1 year old
  • only images 2 year old
  • all images (default)
  • all videos (default)
  • 0 - 10 seconds
  • 10 - 20 seconds
  • 20 - 30 seconds
  • more than 30 seconds
  • all prices (default)
  • XS price = 1
  • XS price <= 2
  • X price <= value you defined
search_parameters[order] string
  • relevance
  • price_1
  • creation
  • nb_views
  • nb_downloads
relevance
  • Relevance
  • price ASC
  • creation date DESC
  • number of views DESC
  • number of downloads DESC
search_parameters[limit] Int 1 to 64 32 maximum number of media returned
search_parameters[offset] int 0 to max results 0 Start position in query
search_parameters[thumbnail_size] int
  • 30
  • 110
  • 400
110
  • Small (30px)
  • Medium (110px)
  • Large (400px - watermarked)
search_parameters[detail_level] int
  • 1
none When this parameter is sent and set to 1, the method will return for each content :
  • nb_downloads
  • nb_views
search_parameters[secure_urls] Int 0 Returns HTTPS urls
result_columns array
  • nb_results
  • id
  • title
  • creator_name
  • creator_id
  • thumbnail_url
  • thumbnail_html_tag
  • thumbnail_width
  • thumbnail_height
  • affiliation_link
  • thumbnail_30_url
  • thumbnail_30_width
  • thumbnail_30_height
  • thumbnail_110_url
  • thumbnail_110_width
  • thumbnail_110_height
  • thumbnail_400_url
  • thumbnail_400_width
  • thumbnail_400_height
  • flv_url
  • media_type_id
  • cat1
  • cat1_hierarchy
  • cat2
  • cat2_hierarchy
  • nb_views
  • nb_downloads
  • creation_date
  • keywords
  • licenses
  • available_for_subscription
One of more items of this list
  • nb_results
  • id
  • title
  • creator_name
  • creator_id
  • thumbnail_url
  • thumbnail_html_tag
  • thumbnail_width
  • thumbnail_height
  • affiliation_link
  • thumbnail_110_url
  • thumbnail_110_width
  • thumbnail_110_height
  • creation_date
  • media_type_id
  • flv_url
  • licenses
Fields you want to have included in the answer

Returned Values

Element (path) Name Type Description
/ nb_results int total number of result
/[n]/ id int media unique ID
/[n]/ title string media title (used for title tag)
/[n]/ creator_id int media creator unique id
/[n]/ creator_name string media creator name
/[n]/ thumbnail_url string media thumbnail url
/[n]/ thumbnail_html_tag string media thumbnail html tag
/[n]/ thumbnail_width int media thumbnail width (px)
/[n]/ thumbnail_height int media thumbnail height(px)
/[n]/licenses/[n]/ name string media license name
/[n]/licenses/[n]/ price int media license price (credit)
When detail_level=1 only :
/[n]/ nb_views int media views number
/[n]/ nb_downloads int media downloads number
/[n]/ keywords string Media keywords, comma separated

Example Query


<?xml version="1.0" encoding="utf-8"?>
<methodCall>
	<methodName>xmlrpc.getSearchResults</methodName>
	<params>
		<param>
			<value>
				<string>YOUR_API_KEY</string>
			</value>
		</param>
		<param>
			<value>
				<struct>
					<member>
						<name>words</name>
						<value>
							<string>test</string>
						</value>
					</member>
					<member>
						<name>language_id</name>
						<value>
							<string>2</string>
						</value>
					</member>
					<member>
						<name>limit</name>
						<value>
							<string>2</string>
						</value>
					</member>
				</struct>
			</value>
		</param>
	</params>
</methodCall>

Example Response


<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>nb_results</name>
            <value>
              <int>459</int>
            </value>
          </member>
          <member>
            <name>0</name>
            <value>
              <struct>
                <member>
                  <name>id</name>
                  <value>
                    <int>1384045</int>
                  </value>
                </member>
                <member>
                  <name>title</name>
                  <value>
                    <string>scientist with test tube radiant gradient bg</string>
                  </value>
                </member>
                <member>
                  <name>creator_name</name>
                  <value>
                    <string>Jose Gil</string>
                  </value>
                </member>
                <member>
                  <name>creator_id</name>
                  <value>
                    <int>6537</int>
                  </value>
                </member>
                <member>
                  <name>thumbnail_url</name>
                  <value>
                    <string>http://static-p1.fotolia.com/jpg/00/01/38/40/110_F_1384045_waKUmRkPuVSQSK9T4lDNc5YvkqSp4x.jpg</string>
                  </value>
                </member>
                <member>
                  <name>thumbnail_html_tag</name>
                  <value>
                    <string><img src="http://static-p1.fotolia.com/jpg/00/01/38/40/110_F_1384045_waKUmRkPuVSQSK9T4lDNc5YvkqSp4x.jpg" alt="scientist with test tube radiant gradient bg" title="scientist with test tube radiant gradient bg" width="81" height="110" /></string>
                  </value>
                </member>
                <member>
                  <name>thumbnail_width</name>
                  <value>
                    <double>81</double>
                  </value>
                </member>
                <member>
                  <name>thumbnail_height</name>
                  <value>
                    <int>110</int>
                  </value>
                </member>
                <member>
                  <name>licences</name>
                  <value>
                    <array>
                      <data>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>M</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>1</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>L</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>2</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>X</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>50</int>

                              </value>
                            </member>
                          </struct>
                        </value>
                      </data>
                    </array>
                  </value>
                </member>
              </struct>
            </value>
          </member>
          <member>
            <name>1</name>
            <value>
              <struct>
                <member>
                  <name>id</name>
                  <value>
                    <int>1247723</int>
                  </value>
                </member>
                <member>
                  <name>title</name>
                  <value>
                    <string>antique tube tester</string>
                  </value>
                </member>
                <member>
                  <name>creator_name</name>
                  <value>
                    <string>James Steidl</string>
                  </value>
                </member>
                <member>
                  <name>creator_id</name>
                  <value>
                    <int>140159</int>
                  </value>
                </member>
                <member>
                  <name>thumbnail_url</name>
                  <value>
                    <string>http://static-p2.fotolia.com/jpg/00/01/24/77/110_F_1247723_MB9BPAu0TMbhI2UEUNCQKCRpvXdEyR.jpg</string>
                  </value>
                </member>
                <member>
                  <name>thumbnail_html_tag</name>
                  <value>
                    <string><img src="http://static-p2.fotolia.com/jpg/00/01/24/77/110_F_1247723_MB9BPAu0TMbhI2UEUNCQKCRpvXdEyR.jpg" alt="antique tube tester" title="antique tube tester" width="74" height="110" /></string>
                  </value>
                </member>
                <member>
                  <name>thumbnail_width</name>
                  <value>
                    <double>74</double>
                  </value>
                </member>
                <member>
                  <name>thumbnail_height</name>
                  <value>
                    <int>110</int>
                  </value>
                </member>
                <member>
                  <name>licences</name>
                  <value>
                    <array>
                      <data>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>M</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>1</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>L</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>2</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>XL</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>3</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                        <value>
                          <struct>
                            <member>
                              <name>name</name>
                              <value>
                                <string>X</string>
                              </value>
                            </member>
                            <member>
                              <name>price</name>
                              <value>
                                <int>20</int>
                              </value>
                            </member>
                          </struct>
                        </value>
                      </data>
                    </array>
                  </value>
                </member>
              </struct>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

Error Codes

001: Service currently unavailable
The requested service is temporarily unavailable.
002: Failed to parse request
The XML-RPC request document could not be parsed.
010: Missing API Key
The API key passed is missing.
011: Invalid API Key
The API key passed is not valid or has expired.
031: Invalid Method
This method does not exist in the method list.
032: Method not Available
This method is not available for this API Key.
2001: Invalid Language ID
The language ID passed is not valid or doesn't exist in the fotolia available language list.
2101: Invalid Thumbnail Size
The thumbnail size passed is not valid or doesn't exist in the fotolia available thumbnail size list.