.oO SearXNG Developer Documentation Oo.
|
Functions | |
is_broken_text (text) | |
result_to_text (text, htmlResult) | |
request (query, params) | |
response (resp) | |
unit_to_str (unit) | |
area_to_str (area) | |
Variables | |
logging | logger .Logger |
dict | about |
bool | send_accept_language_header = True |
str | URL = 'https://api.duckduckgo.com/' + '?{query}&format=json&pretty=0&no_redirect=1&d=1' |
list | WIKIDATA_PREFIX = ['http://www.wikidata.org/entity/', 'https://www.wikidata.org/entity/'] |
replace_http_by_https = get_string_replaces_function({'http:': 'https:'}) | |
DuckDuckGo Instant Answer API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `DDG-API <https://duckduckgo.com/api>`__ is no longer documented but from reverse engineering we can see that some services (e.g. instant answers) still in use from the DDG search engine. As far we can say the *instant answers* API does not support languages, or at least we could not find out how language support should work. It seems that most of the features are based on English terms.
searx.engines.duckduckgo_definitions.area_to_str | ( | area | ) |
parse ``{'unit': 'https://www.wikidata.org/entity/Q712226', 'amount': '+20.99'}``
Definition at line 248 of file duckduckgo_definitions.py.
References searx.format, and searx.engines.duckduckgo_definitions.unit_to_str().
Referenced by searx.engines.duckduckgo_definitions.response().
searx.engines.duckduckgo_definitions.is_broken_text | ( | text | ) |
duckduckgo may return something like ``<a href="xxxx">http://somewhere Related website<a/>`` The href URL is broken, the "Related website" may contains some HTML. The best solution seems to ignore these results.
Definition at line 49 of file duckduckgo_definitions.py.
Referenced by searx.engines.duckduckgo_definitions.response(), and searx.engines.duckduckgo_definitions.result_to_text().
searx.engines.duckduckgo_definitions.request | ( | query, | |
params ) |
Definition at line 73 of file duckduckgo_definitions.py.
searx.engines.duckduckgo_definitions.response | ( | resp | ) |
Definition at line 78 of file duckduckgo_definitions.py.
References searx.engines.duckduckgo_definitions.area_to_str(), searx.engines.duckduckgo_definitions.is_broken_text(), searx.engines.duckduckgo_definitions.replace_http_by_https, and searx.engines.duckduckgo_definitions.result_to_text().
searx.engines.duckduckgo_definitions.result_to_text | ( | text, | |
htmlResult ) |
Definition at line 59 of file duckduckgo_definitions.py.
References searx.engines.duckduckgo_definitions.is_broken_text().
Referenced by searx.engines.duckduckgo_definitions.response().
searx.engines.duckduckgo_definitions.unit_to_str | ( | unit | ) |
Definition at line 237 of file duckduckgo_definitions.py.
Referenced by searx.engines.duckduckgo_definitions.area_to_str().
dict searx.engines.duckduckgo_definitions.about |
Definition at line 31 of file duckduckgo_definitions.py.
logging searx.engines.duckduckgo_definitions.logger .Logger |
Definition at line 28 of file duckduckgo_definitions.py.
searx.engines.duckduckgo_definitions.replace_http_by_https = get_string_replaces_function({'http:': 'https:'}) |
Definition at line 46 of file duckduckgo_definitions.py.
Referenced by searx.engines.duckduckgo_definitions.response().
bool searx.engines.duckduckgo_definitions.send_accept_language_header = True |
Definition at line 40 of file duckduckgo_definitions.py.
str searx.engines.duckduckgo_definitions.URL = 'https://api.duckduckgo.com/' + '?{query}&format=json&pretty=0&no_redirect=1&d=1' |
Definition at line 42 of file duckduckgo_definitions.py.
list searx.engines.duckduckgo_definitions.WIKIDATA_PREFIX = ['http://www.wikidata.org/entity/', 'https://www.wikidata.org/entity/'] |
Definition at line 44 of file duckduckgo_definitions.py.