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

# Quickstart

> Get up and running with River Markets in 5 minutes

## 1. Create an Account

Sign up at [app.rivermarkets.com](https://app.rivermarkets.com) to create your account.

## 2. Generate an API Key

1. Log in to your dashboard
2. Navigate to **Settings → API Keys**
3. Click **Create API Key**
4. Copy the **key\_id** and **private\_key** — the private key is shown only once

The private key signs every request locally (Ed25519). The server only stores
the public key, so it never sees your secret.

## 3. Install the SDK

```python theme={null}
pip install rivermarkets
```

<Tip>
  The SDK handles request signing for you. If you'd rather implement signing
  yourself (other languages, raw HTTP), see
  [Authentication](/api-reference/authentication) for the canonical-string spec.
</Tip>

## 4. Make Your First Request

Test your credentials by searching for markets. We support ticker search (Kalshi ticker, Polymarket condition\_id/slug, river\_id) and fuzzy search ("bitcoin", "fed rates").

```python theme={null}
from datetime import datetime
from rivermarkets import RiverMarkets

client = RiverMarkets(
    key_id="<uuid from Settings → API Keys>",
    private_key="<base64 private key shown once at creation>",
)

# Search for shutdown related markets on Kalshi.
# Filter to active markets that haven't expired yet so the results are tradeable —
# apply both `status=active` and `expiration_date_start` (now) for any exchange.
results = client.markets.search_markets(
    q="shutdown",
    exchange_name="KALSHI",
    expiration_date_start=datetime.now(),
    status="active",
)
for market in results.results:
    print(f"River ID: {market.river_id}, Ticker: {market.ticker}")
```

## 5. Set Up a Subaccount

Subaccounts let you organize trading activity into separate containers — useful for segregating strategies, clients, or portfolios.

You can create them via the UI at **Settings → Subaccounts** or programmatically:

```python theme={null}
subaccount = client.subaccounts.create_subaccount(name="My Trading Account")
subaccount_id = subaccount.subaccount_id
```

<Tip>
  Watch the [video walkthrough](https://www.loom.com/embed/9b49e269c09e436d98b72f3cb55d7691) to see how to create a subaccount, add a Polymarket account, and place your first trade.
</Tip>

## 6. Add Exchange Credentials

Exchange credentials can be added via the UI under **Settings → Subaccounts**

<Note>
  We use asymmetric encryption — your credentials are never transferred between services or stored in plain text. Credentials are deleted when you delete a subaccount.
</Note>

<Tip>
  Watch this walkthrough to see how to create a subaccount, add a Polymarket account.

  <div style={{ position: "relative", paddingBottom: "56.25%", height: 0, marginTop: "12px" }}>
    <iframe src="https://www.loom.com/embed/9b49e269c09e436d98b72f3cb55d7691" title="Subaccounts video walkthrough" frameBorder="0" allowFullScreen style={{ position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }} />
  </div>
</Tip>

## 7. Place Your First Order

Use the River ID from your market search to place an order:

```python theme={null}
order = client.orders.create_order(
    subaccount_id=subaccount_id,
    river_id=4552150,       # From market search
    order_type="LIMIT",      # LIMIT or MARKET
    time_in_force="GTC",     # FOK, GTC, GTD, or IOC
    buy_flag=True,           # True=buy, False=sell
    price=0.50,              # Limit price (0-1)
    qty=10,                  # Number of contracts
)
print(f"Order placed: {order.river_order_id}")
```

## 8. Check Order Status

```python theme={null}
order_status = client.orders.get_order(order_id=order.river_order_id)
print(f"Status: {order_status.status}, Filled: {order_status.traded_qty}/{order_status.qty}")
```

Possible statuses:

| Status               | Description                          |
| -------------------- | ------------------------------------ |
| `pending_submission` | Order received, awaiting processing  |
| `submitted`          | Order sent to exchange               |
| `partially_filled`   | Order partially executed             |
| `filled`             | Order fully executed                 |
| `cancelled`          | Order cancelled                      |
| `rejected`           | Order rejected (see `reject_reason`) |

## 9. Cancel an Order

```python theme={null}
result = client.orders.cancel_order(order_id=order.river_order_id)
print(result)
```

<Warning>
  Only orders with status `submitted` or `partially_filled` can be cancelled.
</Warning>

## Rate Limits

* **Standard**: 10 requests/second
* **Premium**: Contact support for higher limits
