.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.stract Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['general']
 
bool paging = True
 
str search_url = "https://stract.com/beta/api/search"
 

Detailed Description

Stract is an independent open source search engine.  At this state, it's
still in beta and hence this implementation will need to be updated once beta
ends.

Function Documentation

◆ request()

searx.engines.stract.request ( query,
params )

Definition at line 24 of file stract.py.

24def request(query, params):
25 params['url'] = search_url
26 params['method'] = "POST"
27 params['headers'] = {
28 'Accept': 'application/json',
29 'Content-Type': 'application/json',
30 'User-Agent': searx_useragent(),
31 }
32 params['data'] = dumps({'query': query, 'page': params['pageno'] - 1})
33
34 return params
35
36

◆ response()

searx.engines.stract.response ( resp)

Definition at line 37 of file stract.py.

37def response(resp):
38 results = []
39
40 for result in resp.json()["webpages"]:
41 results.append(
42 {
43 'url': result['url'],
44 'title': result['title'],
45 'content': ''.join(fragment['text'] for fragment in result['snippet']['text']['fragments']),
46 }
47 )
48
49 return results

Variable Documentation

◆ about

dict searx.engines.stract.about
Initial value:
1= {
2 "website": "https://stract.com/",
3 "use_official_api": True,
4 "official_api_documentation": "https://stract.com/beta/api/docs/#/search/api",
5 "require_api_key": False,
6 "results": "JSON",
7}

Definition at line 11 of file stract.py.

◆ categories

list searx.engines.stract.categories = ['general']

Definition at line 18 of file stract.py.

◆ paging

bool searx.engines.stract.paging = True

Definition at line 19 of file stract.py.

◆ search_url

str searx.engines.stract.search_url = "https://stract.com/beta/api/search"

Definition at line 21 of file stract.py.