28def response(resp) -> EngineResults:
29 results = EngineResults()
30 search_results = resp.json()
31
32 for item in search_results.get('items', []):
33 app_id = item.get('id')
34
35 currency = item.get('price', {}).get('currency', 'USD')
36 price = item.get('price', {}).get('final', 0) / 100
37
38 platforms = ', '.join([platform for platform, supported in item.get('platforms', {}).items() if supported])
39
40 content = [f'Price: {price:.2f} {currency}', f'Platforms: {platforms}']
41
42 results.add(
43 MainResult(
44 title=item.get('name'),
45 content=html_to_text(' | '.join(content)),
46 url=f'{base_url}/app/{app_id}',
47 thumbnail=item.get('tiny_image', ''),
48 )
49 )
50
51 return results