> ## Documentation Index
> Fetch the complete documentation index at: https://condor.hummingbot.org/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete REST API reference for Hummingbot API

## What is Hummingbot API?

**Hummingbot API** is a RESTful API server that provides programmatic access to all [Hummingbot](https://hummingbot.org) exchange connectors and trading strategies. It serves as the deterministic execution layer for Condor, handling:

* **Data collection**: Standardized access to order books, candles, balances, and positions across 50+ exchanges
* **Market access**: Connectors to spot, perpetual, and AMM exchanges, along with Solana and EVM networks
* **Trade execution**: Place orders, manage positions, and track fills
* **Bot management**: Deploy and manage containerized bots for long-running strategies

## Base URL

```
http://localhost:8000
```

For remote deployments, replace `localhost` with your server's address.

## Authentication

All endpoints require HTTP Basic Authentication:

```bash theme={null}
curl -u admin:admin http://localhost:8000/accounts
```

## API Routers

### Accounts

Manage trading accounts and exchange credentials.

| Endpoint                                                      | Method | Description                               |
| ------------------------------------------------------------- | ------ | ----------------------------------------- |
| `/accounts`                                                   | GET    | List all account names                    |
| `/accounts/{account_name}/credentials`                        | GET    | List configured connectors for an account |
| `/accounts/add-account`                                       | POST   | Create a new account                      |
| `/accounts/delete-account`                                    | POST   | Delete an account                         |
| `/accounts/add-credential/{account_name}/{connector_name}`    | POST   | Add exchange credentials                  |
| `/accounts/delete-credential/{account_name}/{connector_name}` | POST   | Remove exchange credentials               |

### Portfolio

Real-time balances and portfolio analytics.

| Endpoint           | Method | Description                                               |
| ------------------ | ------ | --------------------------------------------------------- |
| `/portfolio/state` | POST   | Get portfolio balances across all accounts and connectors |

### Trading

Execute orders and manage positions.

| Endpoint                                                            | Method | Description                    |
| ------------------------------------------------------------------- | ------ | ------------------------------ |
| `/trading/orders`                                                   | POST   | Place a new order              |
| `/trading/orders/active`                                            | POST   | Get active orders              |
| `/trading/{account_name}/{connector_name}/orders/{order_id}/cancel` | POST   | Cancel an order                |
| `/trading/positions`                                                | POST   | Get open positions (perpetual) |

### Connectors

Exchange connector information and trading rules.

| Endpoint                                     | Method | Description                    |
| -------------------------------------------- | ------ | ------------------------------ |
| `/connectors`                                | GET    | List available connectors      |
| `/connectors/{connector_name}/config-map`    | GET    | Get required credential fields |
| `/connectors/{connector_name}/trading-rules` | GET    | Get trading rules for pairs    |

### Market Data

Prices, candles, order books, and funding rates.

| Endpoint                     | Method | Description                 |
| ---------------------------- | ------ | --------------------------- |
| `/market-data/candles`       | POST   | Get historical candles      |
| `/market-data/order-book`    | POST   | Get order book snapshot     |
| `/market-data/prices`        | POST   | Get current prices          |
| `/market-data/funding-rates` | POST   | Get perpetual funding rates |

### Rate Oracle

Cross-exchange price feeds and conversion rates.

| Endpoint               | Method | Description                        |
| ---------------------- | ------ | ---------------------------------- |
| `/rate-oracle/sources` | GET    | List available price sources       |
| `/rate-oracle/rate`    | GET    | Get conversion rate between assets |

### Executors

Create and manage trading executors.

| Endpoint                          | Method | Description           |
| --------------------------------- | ------ | --------------------- |
| `/executors`                      | GET    | List active executors |
| `/executors`                      | POST   | Create a new executor |
| `/executors/{executor_id}`        | DELETE | Stop an executor      |
| `/executors/{executor_id}/status` | GET    | Get executor status   |

### Bot Orchestration

Deploy and manage Hummingbot trading bots.

| Endpoint                            | Method | Description            |
| ----------------------------------- | ------ | ---------------------- |
| `/bot-orchestration/status`         | GET    | Get status of all bots |
| `/bot-orchestration/deploy`         | POST   | Deploy a new bot       |
| `/bot-orchestration/{bot_id}/start` | POST   | Start a bot            |
| `/bot-orchestration/{bot_id}/stop`  | POST   | Stop a bot             |
| `/bot-orchestration/{bot_id}/logs`  | GET    | Get bot logs           |

### Controllers

V2 strategy controller management.

| Endpoint                                | Method | Description                         |
| --------------------------------------- | ------ | ----------------------------------- |
| `/controllers`                          | GET    | List available controllers          |
| `/controllers/{controller_name}/config` | GET    | Get controller configuration schema |

### Scripts

V1 script management.

| Endpoint   | Method | Description            |
| ---------- | ------ | ---------------------- |
| `/scripts` | GET    | List available scripts |

### Gateway

DEX infrastructure via Hummingbot Gateway.

| Endpoint              | Method | Description             |
| --------------------- | ------ | ----------------------- |
| `/gateway/status`     | GET    | Get Gateway status      |
| `/gateway/connectors` | GET    | List Gateway connectors |
| `/gateway/wallets`    | GET    | List configured wallets |
| `/gateway/networks`   | GET    | List supported networks |

### Gateway Swaps

DEX token swaps.

| Endpoint                 | Method | Description    |
| ------------------------ | ------ | -------------- |
| `/gateway/swaps/quote`   | POST   | Get swap quote |
| `/gateway/swaps/execute` | POST   | Execute a swap |

### Gateway CLMM

Concentrated liquidity positions.

| Endpoint                        | Method | Description                      |
| ------------------------------- | ------ | -------------------------------- |
| `/gateway/clmm/pools`           | GET    | List available pools             |
| `/gateway/clmm/positions_owned` | POST   | Get LP positions owned in a pool |
| `/gateway/clmm/open`            | POST   | Open a new position              |
| `/gateway/clmm/add`             | POST   | Add liquidity to a position      |
| `/gateway/clmm/remove`          | POST   | Remove liquidity from a position |
| `/gateway/clmm/collect-fees`    | POST   | Collect accumulated fees         |

### Backtesting

Strategy backtesting.

| Endpoint                             | Method | Description          |
| ------------------------------------ | ------ | -------------------- |
| `/backtesting/run`                   | POST   | Run a backtest       |
| `/backtesting/results/{backtest_id}` | GET    | Get backtest results |

### Archived Bots

Historical bot performance data.

| Endpoint                                | Method | Description                 |
| --------------------------------------- | ------ | --------------------------- |
| `/archived-bots/databases`              | GET    | List archived bot databases |
| `/archived-bots/{database}/performance` | GET    | Get historical performance  |

### Docker

Container lifecycle management.

| Endpoint             | Method | Description                |
| -------------------- | ------ | -------------------------- |
| `/docker/status`     | GET    | Check if Docker is running |
| `/docker/containers` | GET    | List containers            |

## Response Format

**Success responses** return the requested data:

```json theme={null}
["master_account"]
```

**Error responses** include a `detail` field:

```json theme={null}
{
  "detail": "Account not found"
}
```

## Interactive Playground

Each endpoint page includes an interactive playground where you can test API calls directly. Enter your credentials and server URL to make live requests.

## Resources

<CardGroup cols={3}>
  <Card title="Condor GitHub" icon="github" href="https://github.com/hummingbot/condor">
    Condor source code
  </Card>

  <Card title="API GitHub" icon="github" href="https://github.com/hummingbot/hummingbot-api">
    Hummingbot API source code
  </Card>

  <Card title="Discord" icon="discord" href="https://discord.gg/hummingbot">
    Community support
  </Card>
</CardGroup>
