@@ -0,0 +1,39 @@
4+ @website https://unsplash.com
5+ @provide-api yes (https://unsplash.com/developers)
8+ @results JSON (using search portal's infiniscroll API)
9+ @stable no (JSON format could change any time)
10+ @parse url, title, img_src, thumbnail_src
13+from searx.url_utils import urlencode
14+from json import loads
16+url = 'https://unsplash.com/'
17+search_url = url + 'napi/search/photos?'
18+categories = ['images']
23+def request(query, params):
24+ params['url'] = search_url + urlencode({'query': query, 'page': params['pageno'], 'per_page': page_size})
30+ json_data = loads(resp.text)
32+ for result in json_data['results']:
33+ results.append({'template': 'images.html',
34+ 'url': result['links']['html'],
35+ 'thumbnail_src': result['urls']['thumb'],
36+ 'img_src': result['urls']['full'],
37+ 'title': result['description'],