From 79719bbe82ef41d9ecb4eb30fea07626f066049a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 30 Mar 2024 09:29:09 +0100 Subject: [PATCH] Add freqtrade-client programmatic use sample --- docs/rest-api.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/rest-api.md b/docs/rest-api.md index 3baff8506..69a0f31f5 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -125,6 +125,24 @@ By default, the script assumes `127.0.0.1` (localhost) and port `8080` to be use freqtrade-client --config rest_config.json [optional parameters] ``` +??? Note "Programmatic use" + The `freqtrade-client` package (installable independent of freqtrade) can be used in your own scripts to interact with the freqtrade API. + to do so, please use the following: + + ``` python + from freqtrade_client import FtRestClient + + + client = FtRestClient(server_url, username, password) + + # Get the status of the bot + ping = client.ping() + print(ping) + # ... + ``` + + For a full list of available commands, please refer to the list below. + ### Available endpoints | Command | Description |