Work in progress
This documentation page is currently work in progress.
Not all existing DecAPI endpoints are documented here yet. For the currently active documentation, please visit docs.decapi.me.
Convert currency
Convert currency from one currency to another.
Currency rates are cached for up to 24 hours, so don't expect the precise latest rates.
Regular currencies follow the ISO 4217 standard.
Some cryptocurrencies are also supported.
You can see a list of supported currencies/cryptocurrencies here: https://decapi.me/misc/currency?list
Endpoint URL
https://decapi.me/misc/currency?from=EUR&to=NOK&value=1
Query parameters
from
- Required - The currency to convert from.to
- Required - The currency to convert to.value
- Required - The amount offrom
you wish to convert.round
- Optional - Round to the specified number of decimal places.- If specified with 0 or below, or with no value, the result will be rounded to the nearest whole number.
list
- Optional - If specified, will return a list of supported currencies.- ⚠ This will prevent any other parameters from being used. Only use this parameter by itself when you wish to see what currencies are available.
Examples
- Convert from 1 EUR (Euro), to NOK (Norwegian Krone): https://decapi.me/misc/currency?from=EUR&to=NOK&value=1
- Convert from 15 USD (US Dollar), to NOK (Norwegian Krone) and round to 2 decimal places: https://decapi.me/misc/currency?from=USD&to=NOK&value=15&round=2
Examples for bots
Nightbot
Note: Nightbot will automatically convert variables, such as$(channel)
or $(touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
$(urlfetch https://decapi.me/misc/currency?from=EUR&to=NOK&value=$(querystring))
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
$(urlfetch https://decapi.me/misc/currency?from=EUR&to=NOK&value=$(querystring)&round=2)
Fossabot
Note: Fossabot will automatically convert variables, such as$(channel)
or $(user.login)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
$(customapi https://decapi.me/misc/currency?from=EUR&to=NOK&value=$(querystring))
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
$(customapi https://decapi.me/misc/currency?from=EUR&to=NOK&value=$(querystring)&round=2)
StreamElements
Note: StreamElements will automatically convert variables, such as${channel}
or ${touser}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
${customapi.https://decapi.me/misc/currency?from=EUR&to=NOK&value=${queryescape ${1:}}}
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
${customapi.https://decapi.me/misc/currency?from=EUR&to=NOK&value=${queryescape ${1:}}&round=2}
Streamlabs Chat Bot
Note: Streamlabs Chat Bot will automatically convert variables, such as$mychannel
or $touserid
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
$readapi(https://decapi.me/misc/currency?from=EUR&to=NOK&value=$msg)
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
$readapi(https://decapi.me/misc/currency?from=EUR&to=NOK&value=$msg&round=2)
Streamlabs Cloudbot
Note: Streamlabs Cloudbot will automatically convert variables, such as{channel.name}
or {touser.name}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
{readapi.https://decapi.me/misc/currency?from=EUR&to=NOK&value={1:100}}
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
{readapi.https://decapi.me/misc/currency?from=EUR&to=NOK&value={1:100}&round=2}
Deepbot
Note: Deepbot will automatically convert variables, such as@stream@
or @user@
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
@customapi@[https://decapi.me/misc/currency?from=EUR&to=NOK&value=@target@]
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
@customapi@[https://decapi.me/misc/currency?from=EUR&to=NOK&value=@target@&round=2]
PhantomBot
Note: PhantomBot will automatically convert variables, such as(channelname)
or (touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone):
(customapi https://decapi.me/misc/currency?from=EUR&to=NOK&value=(echo))
-
Convert from user specified number of EUR (euros) to NOK (Norwegian Krone), round to 2 decimal places:
(customapi https://decapi.me/misc/currency?from=EUR&to=NOK&value=(echo)&round=2)