.oO SearXNG Developer Documentation Oo.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
▼
.oO SearXNG Developer Documentation Oo.
Doxygen docs for searxng
►
Über SearXNG
►
Suchbegriffe
►
About SearXNG
►
Search syntax
►
درباره SearXNG
►
نحو جستجو
►
A propos de SearXNG
►
Syntaxe de recherche
►
Tentang SearXNG
►
Sintaks pencarian
►
Informazioni su SearXNG
►
Sintassi di ricerca
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
searxng
▼
searx
►
answerers
►
botdetection
►
data
►
enginelib
▼
engines
►
1337x.py
►
360search.py
►
360search_videos.py
►
9gag.py
►
__init__.py
►
acfun.py
►
adobe_stock.py
►
ahmia.py
►
alpinelinux.py
►
annas_archive.py
►
apkmirror.py
►
apple_app_store.py
►
apple_maps.py
►
archlinux.py
►
artic.py
►
arxiv.py
►
ask.py
►
astrophysics_data_system.py
►
baidu.py
►
bandcamp.py
►
base.py
►
bilibili.py
►
bing.py
►
bing_images.py
►
bing_news.py
►
bing_videos.py
►
bitchute.py
►
bpb.py
►
brave.py
►
bt4g.py
►
btdigg.py
►
ccc_media.py
►
chefkoch.py
►
chinaso.py
►
cloudflareai.py
►
command.py
►
core.py
►
cppreference.py
►
crates.py
►
crossref.py
►
currency_convert.py
►
dailymotion.py
►
deepl.py
►
deezer.py
►
demo_offline.py
►
demo_online.py
►
destatis.py
►
deviantart.py
►
dictzone.py
►
digbt.py
►
discourse.py
►
docker_hub.py
►
doku.py
►
duckduckgo.py
►
duckduckgo_definitions.py
►
duckduckgo_extra.py
►
duckduckgo_weather.py
►
duden.py
►
dummy-offline.py
►
dummy.py
►
ebay.py
►
elasticsearch.py
►
emojipedia.py
►
fdroid.py
►
findthatmeme.py
►
flickr.py
►
flickr_noapi.py
►
freesound.py
►
frinkiac.py
►
fyyd.py
►
geizhals.py
►
genius.py
►
gitea.py
►
github.py
►
gitlab.py
►
goodreads.py
►
google.py
►
google_images.py
►
google_news.py
►
google_play.py
►
google_scholar.py
►
google_videos.py
►
hackernews.py
►
hex.py
►
il_post.py
►
imdb.py
►
imgur.py
►
ina.py
►
invidious.py
►
ipernity.py
►
iqiyi.py
►
jisho.py
►
json_engine.py
►
kickass.py
►
lemmy.py
►
lib_rs.py
►
libretranslate.py
►
lingva.py
►
livespace.py
►
loc.py
►
mariadb_server.py
►
mastodon.py
►
material_icons.py
►
mediathekviewweb.py
►
mediawiki.py
►
meilisearch.py
►
metacpan.py
►
mixcloud.py
►
mojeek.py
►
mongodb.py
►
moviepilot.py
►
mozhi.py
►
mrs.py
►
mullvad_leta.py
►
mwmbl.py
►
mysql_server.py
►
niconico.py
►
npm.py
►
nyaa.py
►
odysee.py
►
ollama.py
►
open_meteo.py
►
openclipart.py
►
openlibrary.py
►
opensemantic.py
►
openstreetmap.py
►
openverse.py
►
pdbe.py
►
peertube.py
►
photon.py
►
pinterest.py
►
piped.py
►
piratebay.py
►
pixiv.py
►
pkg_go_dev.py
►
podcastindex.py
►
postgresql.py
►
presearch.py
►
public_domain_image_archive.py
►
pubmed.py
►
pypi.py
►
quark.py
►
qwant.py
►
radio_browser.py
►
recoll.py
►
reddit.py
►
redis_server.py
►
reuters.py
►
rottentomatoes.py
►
rumble.py
►
scanr_structures.py
►
searchcode_code.py
►
searx_engine.py
►
seekr.py
►
selfhst.py
►
semantic_scholar.py
►
sepiasearch.py
►
seznam.py
►
sogou.py
►
sogou_images.py
►
sogou_videos.py
►
sogou_wechat.py
►
solidtorrents.py
►
solr.py
►
soundcloud.py
►
spotify.py
►
springer.py
►
sqlite.py
►
stackexchange.py
►
startpage.py
►
stract.py
►
svgrepo.py
►
tagesschau.py
►
tineye.py
►
tokyotoshokan.py
►
tootfinder.py
►
torznab.py
►
translated.py
►
unsplash.py
►
vimeo.py
►
voidlinux.py
►
wallhaven.py
►
wikicommons.py
►
wikidata.py
►
wikipedia.py
►
wolframalpha_api.py
►
wolframalpha_noapi.py
►
wordnik.py
►
wttr.py
►
www1x.py
►
xpath.py
►
yacy.py
►
yahoo.py
►
yahoo_news.py
►
yandex.py
►
yandex_music.py
►
yep.py
►
youtube_api.py
►
youtube_noapi.py
►
yummly.py
►
zlibrary.py
►
favicons
►
infopage
►
metrics
►
network
►
plugins
►
result_types
►
search
►
__init__.py
►
autocomplete.py
►
babel_extract.py
►
compat.py
►
exceptions.py
►
extended_types.py
►
external_bang.py
►
external_urls.py
►
flaskfix.py
►
limiter.py
►
locales.py
►
openmetrics.py
►
preferences.py
►
query.py
►
redisdb.py
►
redislib.py
►
results.py
►
settings_defaults.py
►
settings_loader.py
►
sqlitedb.py
►
sxng_locales.py
►
unixthreadname.py
►
utils.py
►
version.py
►
webadapter.py
►
webapp.py
►
webutils.py
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
Loading...
Searching...
No Matches
currency_convert.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Currency convert (DuckDuckGo)
3
"""
4
5
import
json
6
7
# about
8
about = {
9
"website"
:
'https://duckduckgo.com/'
,
10
"wikidata_id"
:
'Q12805'
,
11
"official_api_documentation"
:
'https://duckduckgo.com/api'
,
12
"use_official_api"
:
False
,
13
"require_api_key"
:
False
,
14
"results"
:
'JSONP'
,
15
"description"
:
"Service from DuckDuckGo."
,
16
}
17
18
engine_type =
'online_currency'
19
categories = []
20
base_url =
'https://duckduckgo.com/js/spice/currency/1/{0}/{1}'
21
weight = 100
22
23
https_support =
True
24
25
26
def
request
(_query, params):
27
params[
'url'
] = base_url.format(params[
'from'
], params[
'to'
])
28
return
params
29
30
26
def
request
(_query, params):
…
31
def
response
(resp):
32
# remove first and last lines to get only json
33
json_resp = resp.text[resp.text.find(
'\n'
) + 1 : resp.text.rfind(
'\n'
) - 2]
34
try
:
35
conversion_rate = float(json.loads(json_resp)[
"to"
][0][
"mid"
])
36
except
IndexError:
37
return
[]
38
answer =
'{0} {1} = {2} {3}, 1 {1} ({5}) = {4} {3} ({6})'
.format(
39
resp.search_params[
'amount'
],
40
resp.search_params[
'from'
],
41
resp.search_params[
'amount'
] * conversion_rate,
42
resp.search_params[
'to'
],
43
conversion_rate,
44
resp.search_params[
'from_name'
],
45
resp.search_params[
'to_name'
],
46
)
47
48
url = f
"https://duckduckgo.com/?q={resp.search_params['from']}+to+{resp.search_params['to']}"
49
50
return
[{
"answer"
: answer,
"url"
: url}]
31
def
response
(resp):
…
searx.engines.currency_convert.request
request(_query, params)
Definition
currency_convert.py:26
searx.engines.currency_convert.response
response(resp)
Definition
currency_convert.py:31
searxng
searx
engines
currency_convert.py
Generated on Thu Apr 3 2025 20:32:58 for .oO SearXNG Developer Documentation Oo. by
1.13.2