Skip to content

Commit f6e1442

Browse files
authored
Merge pull request freqtrade#12257 from stash86/main-stash
Update API docs
2 parents 314cd10 + 5ff95db commit f6e1442

File tree

1 file changed

+54
-49
lines changed

1 file changed

+54
-49
lines changed

docs/rest-api.md

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ This method will work for all arguments - check the "show" command for a list of
140140
# Get the status of the bot
141141
ping = client.ping()
142142
print(ping)
143+
144+
# Add pairs to blacklist
145+
client.blacklist("BTC/USDT", "ETH/USDT")
146+
# Add pairs to blacklist by supplying a list
147+
client.blacklist(*listPairs)
143148
# ...
144149
```
145150

@@ -155,63 +160,63 @@ freqtrade-client help
155160
Possible commands:
156161
157162
available_pairs
158-
Return available pair (backtest data) based on timeframe / stake_currency selection
163+
Return available pair (backtest data) based on timeframe / stake_currency selection
159164
160165
:param timeframe: Only pairs with this timeframe available.
161166
:param stake_currency: Only pairs that include this timeframe
162167
163168
balance
164-
Get the account balance.
169+
Get the account balance.
165170
166171
blacklist
167-
Show the current blacklist.
172+
Show the current blacklist.
168173
169174
:param add: List of coins to add (example: "BNB/BTC")
170175
171176
cancel_open_order
172-
Cancel open order for trade.
177+
Cancel open order for trade.
173178
174179
:param trade_id: Cancels open orders for this trade.
175180
176181
count
177-
Return the amount of open trades.
182+
Return the amount of open trades.
178183
179184
daily
180-
Return the profits for each day, and amount of trades.
185+
Return the profits for each day, and amount of trades.
181186
182187
delete_lock
183-
Delete (disable) lock from the database.
188+
Delete (disable) lock from the database.
184189
185190
:param lock_id: ID for the lock to delete
186191
187192
delete_trade
188-
Delete trade from the database.
193+
Delete trade from the database.
189194
Tries to close open orders. Requires manual handling of this asset on the exchange.
190195
191196
:param trade_id: Deletes the trade with this ID from the database.
192197
193198
forcebuy
194-
Buy an asset.
199+
Buy an asset.
195200
196201
:param pair: Pair to buy (ETH/BTC)
197202
:param price: Optional - price to buy
198203
199204
forceenter
200-
Force entering a trade
205+
Force entering a trade
201206
202207
:param pair: Pair to buy (ETH/BTC)
203208
:param side: 'long' or 'short'
204209
:param price: Optional - price to buy
205210
206211
forceexit
207-
Force-exit a trade.
212+
Force-exit a trade.
208213
209214
:param tradeid: Id of the trade (can be received via status command)
210215
:param ordertype: Order type to use (must be market or limit)
211216
:param amount: Amount to sell. Full sell if not given
212217
213218
health
214-
Provides a quick health check of the running bot.
219+
Provides a quick health check of the running bot.
215220
216221
lock_add
217222
Manually lock a specific pair
@@ -222,82 +227,82 @@ lock_add
222227
:param reason: Reason for the lock
223228
224229
locks
225-
Return current locks
230+
Return current locks
226231
227232
logs
228-
Show latest logs.
233+
Show latest logs.
229234
230235
:param limit: Limits log messages to the last <limit> logs. No limit to get the entire log.
231236
232237
pair_candles
233-
Return live dataframe for <pair><timeframe>.
238+
Return live dataframe for <pair><timeframe>.
234239
235240
:param pair: Pair to get data for
236241
:param timeframe: Only pairs with this timeframe available.
237242
:param limit: Limit result to the last n candles.
238243
239244
pair_history
240-
Return historic, analyzed dataframe
245+
Return historic, analyzed dataframe
241246
242247
:param pair: Pair to get data for
243248
:param timeframe: Only pairs with this timeframe available.
244249
:param strategy: Strategy to analyze and get values for
245250
:param timerange: Timerange to get data for (same format than --timerange endpoints)
246251
247252
performance
248-
Return the performance of the different coins.
253+
Return the performance of the different coins.
249254
250255
ping
251-
simple ping
256+
simple ping
252257
253258
plot_config
254-
Return plot configuration if the strategy defines one.
259+
Return plot configuration if the strategy defines one.
255260
256261
profit
257-
Return the profit summary.
262+
Return the profit summary.
258263
259264
reload_config
260-
Reload configuration.
265+
Reload configuration.
261266
262267
show_config
263-
Returns part of the configuration, relevant for trading operations.
268+
Returns part of the configuration, relevant for trading operations.
264269
265270
start
266-
Start the bot if it's in the stopped state.
271+
Start the bot if it's in the stopped state.
267272
268273
pause
269-
Pause the bot if it's in the running state. If triggered on stopped state will handle open positions.
274+
Pause the bot if it's in the running state. If triggered on stopped state will handle open positions.
270275
271276
stats
272-
Return the stats report (durations, sell-reasons).
277+
Return the stats report (durations, sell-reasons).
273278
274279
status
275-
Get the status of open trades.
280+
Get the status of open trades.
276281
277282
stop
278-
Stop the bot. Use `start` to restart.
283+
Stop the bot. Use `start` to restart.
279284

280285
stopbuy
281-
Stop buying (but handle sells gracefully). Use `reload_config` to reset.
286+
Stop buying (but handle sells gracefully). Use `reload_config` to reset.
282287

283288
strategies
284-
Lists available strategies
289+
Lists available strategies
285290

286291
strategy
287-
Get strategy details
292+
Get strategy details
288293

289294
:param strategy: Strategy class name
290295

291296
sysinfo
292-
Provides system information (CPU, RAM usage)
297+
Provides system information (CPU, RAM usage)
293298

294299
trade
295-
Return specific trade
300+
Return specific trade
296301

297302
:param trade_id: Specify which trade to get.
298303

299304
trades
300-
Return trades history, sorted by id
305+
Return trades history, sorted by id
301306

302307
:param limit: Limits trades to the X last trades. Max 500 trades.
303308
:param offset: Offset by this amount of trades.
@@ -316,10 +321,10 @@ list_custom_data
316321
:param key: str, optional - Key of the custom-data
317322

318323
version
319-
Return the version of the bot.
324+
Return the version of the bot.
320325

321326
whitelist
322-
Show the current whitelist.
327+
Show the current whitelist.
323328

324329

325330
```
@@ -339,32 +344,32 @@ All endpoints in the below table need to be prefixed with the base URL of the AP
339344
| `/reload_config` | POST | Reloads the configuration file.
340345
| `/trades` | GET | List last trades. Limited to 500 trades per call.
341346
| `/trade/<tradeid>` | GET | Get specific trade.<br/>*Params:*<br/>- `tradeid` (`int`)
342-
| `/trades/<tradeid>` | DELETE | Remove trade from the database. Tries to close open orders. Requires manual handling of this trade on the exchange.<br/>*Params:*<br/>- `tradeid` (`int`)
343-
| `/trades/<tradeid>/open-order` | DELETE | Cancel open order for this trade.<br/>*Params:*<br/>- `tradeid` (`int`)
344-
| `/trades/<tradeid>/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.<br/>*Params:*<br/>- `tradeid` (`int`)
347+
| `/trades/<tradeid>` | DELETE | Remove trade from the database. Tries to close open orders. Requires manual handling of this trade on the exchange.<br/>*Params:*<br/>- `tradeid` (`int`)
348+
| `/trades/<tradeid>/open-order` | DELETE | Cancel open order for this trade.<br/>*Params:*<br/>- `tradeid` (`int`)
349+
| `/trades/<tradeid>/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.<br/>*Params:*<br/>- `tradeid` (`int`)
345350
| `/show_config` | GET | Shows part of the current configuration with relevant settings to operation.
346351
| `/logs` | GET | Shows last log messages.
347352
| `/status` | GET | Lists all open trades.
348353
| `/count` | GET | Displays number of trades used and available.
349-
| `/entries` | GET | Shows profit statistics for each enter tags for given pair (or all pairs if pair isn't given). Pair is optional.<br/>*Params:*<br/>- `pair` (`str`)
350-
| `/exits` | GET | Shows profit statistics for each exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.<br/>*Params:*<br/>- `pair` (`str`)
351-
| `/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.<br/>*Params:*<br/>- `pair` (`str`)
354+
| `/entries` | GET | Shows profit statistics for each enter tags for given pair (or all pairs if pair isn't given). Pair is optional.<br/>*Params:*<br/>- `pair` (`str`)
355+
| `/exits` | GET | Shows profit statistics for each exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.<br/>*Params:*<br/>- `pair` (`str`)
356+
| `/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.<br/>*Params:*<br/>- `pair` (`str`)
352357
| `/locks` | GET | Displays currently locked pairs.
353-
| `/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.<br/>*Params:*<br/>- `<pair>` (`str`)<br/>- `<until>` (`datetime`)<br/>- `[side]` (`str`)<br/>- `[reason]` (`str`)
354-
| `/locks/<lockid>` | DELETE | Deletes (disables) the lock by id.<br/>*Params:*<br/>- `lockid` (`int`)
358+
| `/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.<br/>*Params:*<br/>- `<pair>` (`str`)<br/>- `<until>` (`datetime`)<br/>- `[side]` (`str`)<br/>- `[reason]` (`str`)
359+
| `/locks/<lockid>` | DELETE | Deletes (disables) the lock by id.<br/>*Params:*<br/>- `lockid` (`int`)
355360
| `/profit` | GET | Display a summary of your profit/loss from close trades and some stats about your performance.
356361
| `/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.<br/>*Params:*<br/>- `<tradeid>` (`int` or `str`)<br/>- `<ordertype>` (`str`)<br/>- `[amount]` (`float`)
357362
| `/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)<br/>*Params:*<br/>- `<pair>` (`str`)<br/>- `<side>` (`str`)<br/>- `[rate]` (`float`)
358363
| `/performance` | GET | Show performance of each finished trade grouped by pair.
359364
| `/balance` | GET | Show account balance per currency.
360-
| `/daily` | GET | Shows profit or loss per day, over the last n days (n defaults to 7).<br/>*Params:*<br/>- `<n>` (`int`)
361-
| `/weekly` | GET | Shows profit or loss per week, over the last n days (n defaults to 4).<br/>*Params:*<br/>- `<n>` (`int`)
362-
| `/monthly` | GET | Shows profit or loss per month, over the last n days (n defaults to 3).<br/>*Params:*<br/>- `<n>` (`int`)
365+
| `/daily` | GET | Shows profit or loss per day, over the last n days (n defaults to 7).<br/>*Params:*<br/>- `timescale` (`int`)
366+
| `/weekly` | GET | Shows profit or loss per week, over the last n days (n defaults to 4).<br/>*Params:*<br/>- `timescale` (`int`)
367+
| `/monthly` | GET | Shows profit or loss per month, over the last n days (n defaults to 3).<br/>*Params:*<br/>- `timescale` (`int`)
363368
| `/stats` | GET | Display a summary of profit / loss reasons as well as average holding times.
364369
| `/whitelist` | GET | Show the current whitelist.
365370
| `/blacklist` | GET | Show the current blacklist.
366-
| `/blacklist` | POST | Adds the specified pair to the blacklist.<br/>*Params:*<br/>- `pair` (`str`)
367-
| `/blacklist` | DELETE | Deletes the specified list of pairs from the blacklist.<br/>*Params:*<br/>- `[pair,pair]` (`list[str]`)
371+
| `/blacklist` | POST | Adds the specified pair to the blacklist.<br/>*Params:*<br/>- `blacklist` (`str`)
372+
| `/blacklist` | DELETE | Deletes the specified list of pairs from the blacklist.<br/>*Params:*<br/>- `[pair,pair]` (`list[str]`)
368373
| `/pair_candles` | GET | Returns dataframe for a pair / timeframe combination while the bot is running. **Alpha**
369374
| `/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**<br/>*Params:*<br/>- `<column_list>` (`list[str]`)
370375
| `/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
488493
### OpenAPI interface
489494

490495
To enable the builtin openAPI interface (Swagger UI), specify `"enable_openapi": true` in the api_server configuration.
491-
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.
496+
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.
492497

493498
### Advanced API usage using JWT tokens
494499

0 commit comments

Comments
 (0)