diff --git a/docs/rest-api.md b/docs/rest-api.md index 35a7af75a..796f84c4f 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -140,6 +140,11 @@ This method will work for all arguments - check the "show" command for a list of # Get the status of the bot ping = client.ping() print(ping) + + # Add pairs to blacklist + client.blacklist("BTC/USDT", "ETH/USDT") + # Add pairs to blacklist by supplying a list + client.blacklist(*listPairs) # ... ``` @@ -155,63 +160,63 @@ freqtrade-client help Possible commands: available_pairs - Return available pair (backtest data) based on timeframe / stake_currency selection + Return available pair (backtest data) based on timeframe / stake_currency selection :param timeframe: Only pairs with this timeframe available. :param stake_currency: Only pairs that include this timeframe balance - Get the account balance. + Get the account balance. blacklist - Show the current blacklist. + Show the current blacklist. :param add: List of coins to add (example: "BNB/BTC") cancel_open_order - Cancel open order for trade. + Cancel open order for trade. :param trade_id: Cancels open orders for this trade. count - Return the amount of open trades. + Return the amount of open trades. daily - Return the profits for each day, and amount of trades. + Return the profits for each day, and amount of trades. delete_lock - Delete (disable) lock from the database. + Delete (disable) lock from the database. :param lock_id: ID for the lock to delete delete_trade - Delete trade from the database. + Delete trade from the database. Tries to close open orders. Requires manual handling of this asset on the exchange. :param trade_id: Deletes the trade with this ID from the database. forcebuy - Buy an asset. + Buy an asset. :param pair: Pair to buy (ETH/BTC) :param price: Optional - price to buy forceenter - Force entering a trade + Force entering a trade :param pair: Pair to buy (ETH/BTC) :param side: 'long' or 'short' :param price: Optional - price to buy forceexit - Force-exit a trade. + Force-exit a trade. :param tradeid: Id of the trade (can be received via status command) :param ordertype: Order type to use (must be market or limit) :param amount: Amount to sell. Full sell if not given health - Provides a quick health check of the running bot. + Provides a quick health check of the running bot. lock_add Manually lock a specific pair @@ -222,22 +227,22 @@ lock_add :param reason: Reason for the lock locks - Return current locks + Return current locks logs - Show latest logs. + Show latest logs. :param limit: Limits log messages to the last logs. No limit to get the entire log. pair_candles - Return live dataframe for . + Return live dataframe for . :param pair: Pair to get data for :param timeframe: Only pairs with this timeframe available. :param limit: Limit result to the last n candles. pair_history - Return historic, analyzed dataframe + Return historic, analyzed dataframe :param pair: Pair to get data for :param timeframe: Only pairs with this timeframe available. @@ -245,59 +250,59 @@ pair_history :param timerange: Timerange to get data for (same format than --timerange endpoints) performance - Return the performance of the different coins. + Return the performance of the different coins. ping - simple ping + simple ping plot_config - Return plot configuration if the strategy defines one. + Return plot configuration if the strategy defines one. profit - Return the profit summary. + Return the profit summary. reload_config - Reload configuration. + Reload configuration. show_config - Returns part of the configuration, relevant for trading operations. + Returns part of the configuration, relevant for trading operations. start - Start the bot if it's in the stopped state. + Start the bot if it's in the stopped state. pause - Pause the bot if it's in the running state. If triggered on stopped state will handle open positions. + Pause the bot if it's in the running state. If triggered on stopped state will handle open positions. stats - Return the stats report (durations, sell-reasons). + Return the stats report (durations, sell-reasons). status - Get the status of open trades. + Get the status of open trades. stop - Stop the bot. Use `start` to restart. + Stop the bot. Use `start` to restart. stopbuy - Stop buying (but handle sells gracefully). Use `reload_config` to reset. + Stop buying (but handle sells gracefully). Use `reload_config` to reset. strategies - Lists available strategies + Lists available strategies strategy - Get strategy details + Get strategy details :param strategy: Strategy class name sysinfo - Provides system information (CPU, RAM usage) + Provides system information (CPU, RAM usage) trade - Return specific trade + Return specific trade :param trade_id: Specify which trade to get. trades - Return trades history, sorted by id + Return trades history, sorted by id :param limit: Limits trades to the X last trades. Max 500 trades. :param offset: Offset by this amount of trades. @@ -316,10 +321,10 @@ list_custom_data :param key: str, optional - Key of the custom-data version - Return the version of the bot. + Return the version of the bot. whitelist - Show the current whitelist. + Show the current whitelist. ``` @@ -339,32 +344,32 @@ All endpoints in the below table need to be prefixed with the base URL of the AP | `/reload_config` | POST | Reloads the configuration file. | `/trades` | GET | List last trades. Limited to 500 trades per call. | `/trade/` | GET | Get specific trade.
*Params:*
- `tradeid` (`int`) -| `/trades/` | DELETE | Remove trade from the database. Tries to close open orders. Requires manual handling of this trade on the exchange.
*Params:*
- `tradeid` (`int`) -| `/trades//open-order` | DELETE | Cancel open order for this trade.
*Params:*
- `tradeid` (`int`) -| `/trades//reload` | POST | Reload a trade from the Exchange. Only works in live, and can potentially help recover a trade that was manually sold on the exchange.
*Params:*
- `tradeid` (`int`) +| `/trades/` | DELETE | Remove trade from the database. Tries to close open orders. Requires manual handling of this trade on the exchange.
*Params:*
- `tradeid` (`int`) +| `/trades//open-order` | DELETE | Cancel open order for this trade.
*Params:*
- `tradeid` (`int`) +| `/trades//reload` | POST | Reload a trade from the Exchange. Only works in live, and can potentially help recover a trade that was manually sold on the exchange.
*Params:*
- `tradeid` (`int`) | `/show_config` | GET | Shows part of the current configuration with relevant settings to operation. | `/logs` | GET | Shows last log messages. | `/status` | GET | Lists all open trades. | `/count` | GET | Displays number of trades used and available. -| `/entries` | GET | Shows profit statistics for each enter tags for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) -| `/exits` | GET | Shows profit statistics for each exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) -| `/mix_tags` | GET | Shows profit statistics for each combinations of enter tag + exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) +| `/entries` | GET | Shows profit statistics for each enter tags for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) +| `/exits` | GET | Shows profit statistics for each exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) +| `/mix_tags` | GET | Shows profit statistics for each combinations of enter tag + exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
*Params:*
- `pair` (`str`) | `/locks` | GET | Displays currently locked pairs. -| `/locks` | POST | Locks a pair until "until". (Until will be rounded up to the nearest timeframe). Side is optional and is either `long` or `short` (default is `long`). Reason is optional.
*Params:*
- `` (`str`)
- `` (`datetime`)
- `[side]` (`str`)
- `[reason]` (`str`) -| `/locks/` | DELETE | Deletes (disables) the lock by id.
*Params:*
- `lockid` (`int`) +| `/locks` | POST | Locks a pair until "until". (Until will be rounded up to the nearest timeframe). Side is optional and is either `long` or `short` (default is `long`). Reason is optional.
*Params:*
- `` (`str`)
- `` (`datetime`)
- `[side]` (`str`)
- `[reason]` (`str`) +| `/locks/` | DELETE | Deletes (disables) the lock by id.
*Params:*
- `lockid` (`int`) | `/profit` | GET | Display a summary of your profit/loss from close trades and some stats about your performance. | `/forceexit` | POST | Instantly exits the given trade (ignoring `minimum_roi`), using the given order type ("market" or "limit", uses your config setting if not specified), and the chosen amount (full sell if not specified). If `all` is supplied as the `tradeid`, then all currently open trades will be forced to exit.
*Params:*
- `` (`int` or `str`)
- `` (`str`)
- `[amount]` (`float`) | `/forceenter` | POST | Instantly enters the given pair. Side is optional and is either `long` or `short` (default is `long`). Rate is optional. (`force_entry_enable` must be set to True)
*Params:*
- `` (`str`)
- `` (`str`)
- `[rate]` (`float`) | `/performance` | GET | Show performance of each finished trade grouped by pair. | `/balance` | GET | Show account balance per currency. -| `/daily` | GET | Shows profit or loss per day, over the last n days (n defaults to 7).
*Params:*
- `` (`int`) -| `/weekly` | GET | Shows profit or loss per week, over the last n days (n defaults to 4).
*Params:*
- `` (`int`) -| `/monthly` | GET | Shows profit or loss per month, over the last n days (n defaults to 3).
*Params:*
- `` (`int`) +| `/daily` | GET | Shows profit or loss per day, over the last n days (n defaults to 7).
*Params:*
- `timescale` (`int`) +| `/weekly` | GET | Shows profit or loss per week, over the last n days (n defaults to 4).
*Params:*
- `timescale` (`int`) +| `/monthly` | GET | Shows profit or loss per month, over the last n days (n defaults to 3).
*Params:*
- `timescale` (`int`) | `/stats` | GET | Display a summary of profit / loss reasons as well as average holding times. | `/whitelist` | GET | Show the current whitelist. | `/blacklist` | GET | Show the current blacklist. -| `/blacklist` | POST | Adds the specified pair to the blacklist.
*Params:*
- `pair` (`str`) -| `/blacklist` | DELETE | Deletes the specified list of pairs from the blacklist.
*Params:*
- `[pair,pair]` (`list[str]`) +| `/blacklist` | POST | Adds the specified pair to the blacklist.
*Params:*
- `blacklist` (`str`) +| `/blacklist` | DELETE | Deletes the specified list of pairs from the blacklist.
*Params:*
- `[pair,pair]` (`list[str]`) | `/pair_candles` | GET | Returns dataframe for a pair / timeframe combination while the bot is running. **Alpha** | `/pair_candles` | POST | Returns dataframe for a pair / timeframe combination while the bot is running, filtered by a provided list of columns to return. **Alpha**
*Params:*
- `` (`list[str]`) | `/pair_history` | GET | Returns an analyzed dataframe for a given timerange, analyzed by a given strategy. **Alpha** @@ -488,7 +493,7 @@ To properly configure your reverse proxy (securely), please consult it's documen ### OpenAPI interface To enable the builtin openAPI interface (Swagger UI), specify `"enable_openapi": true` in the api_server configuration. -This will enable the Swagger UI at the `/docs` endpoint. By default, that's running at http://localhost:8080/docs - but it'll depend on your settings. +This will enable the Swagger UI at the `/docs` endpoint. By default, that's running at - but it'll depend on your settings. ### Advanced API usage using JWT tokens