   "https://pixabay.com/api/?key=#{apiKey}" \
     + (if code > 1 then '&response_group=high_resolution' else '') \
     + "&id=#{id}"
+
+
+# Builds a search URL for downloading image information.
+#
+# @param [String] apiKey the API key to use for the request
+# @param [Number] term the search term to use to query the API
+# @param [Number] resolution the resolution code to perform the search at
+#
+buildSearchUrl = (apiKey, term, resolution) ->
+  code = humanResolutionToCode resolution
+  "https://pixabay.com/api/?key=#{apiKey}" \
+    + (if code > 1 then '&response_group=high_resolution' else '') \
+    + "&q=#{term}"
 
 
 # Translates a resolution code to an API resolution.

    url: url
    json: true
  request options, callback


# Downloads an image.

          when 'install' then install() # Install assets.
          when 'add' then add process.argv # Add asset.
          when 'remove' then remove process.argv # Remove asset.
          when 'test' then idToHashId '195893', (err, id) -> console.log id
      else
        # Workspace needs setting up first.
        log.error "Couldn't load workspace for above reason. Terminating."
