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

# Get quote

> Get a price quote before placing an order

Get the expected cost, shares, and fees for a potential trade without committing to it. Provide `X-Public-Key` to include profit estimates based on your existing position.

## Authentication

Public — no authentication required. Provide `X-Public-Key` for personalized profit estimates.

## Path parameters

<ParamField path="eventId" type="string" required>
  UUID of the event.
</ParamField>

<ParamField path="marketId" type="string" required>
  UUID of the market.
</ParamField>

## Request body

<ParamField body="side" type="string" required>
  `BUY` or `SELL`.
</ParamField>

<ParamField body="outcomeId" type="string" required>
  UUID of the outcome. Use the [Get Event](/api-reference/pm/get-event) endpoint to find outcome IDs.
</ParamField>

<ParamField body="amount" type="number" required>
  Amount to spend (buy) or receive (sell), in the specified currency.
</ParamField>

<ParamField body="currency" type="string">
  `USD` (default) or `NGN`.
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/quote" \
    -H "Content-Type: application/json" \
    -d '{"side":"BUY","outcomeId":"c3d4e5f6-a7b8-9012-cdef-345678901234","amount":100,"currency":"USD"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/quote',
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        side: 'BUY',
        outcomeId: 'c3d4e5f6-a7b8-9012-cdef-345678901234',
        amount: 100,
        currency: 'USD',
      }),
    }
  );
  const quote = await response.json();
  ```

  ```python Python theme={null}
  import requests

  resp = requests.post(
      'https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/quote',
      json={
          'side': 'BUY',
          'outcomeId': 'c3d4e5f6-a7b8-9012-cdef-345678901234',
          'amount': 100,
          'currency': 'USD',
      },
  )
  quote = resp.json()
  ```

  ```go Go theme={null}
  body := strings.NewReader(`{"side":"BUY","outcomeId":"c3d4e5f6-a7b8-9012-cdef-345678901234","amount":100,"currency":"USD"}`)
  req, _ := http.NewRequest(
      "POST",
      "https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/quote",
      body,
  )
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

<ResponseField name="price" type="number">
  Average price per share for this trade (0.00–1.00).
</ResponseField>

<ResponseField name="currentMarketPrice" type="number">
  Current market price before this trade executes.
</ResponseField>

<ResponseField name="quantity" type="number">
  Number of shares you will receive.
</ResponseField>

<ResponseField name="amount" type="number">
  Total amount spent (including fee).
</ResponseField>

<ResponseField name="costOfShares" type="number">
  Cost of shares before fee.
</ResponseField>

<ResponseField name="fee" type="number">
  Trading fee charged.
</ResponseField>

<ResponseField name="priceImpactAbsolute" type="number">
  How much this trade moves the market price.
</ResponseField>

<ResponseField name="profitPercentage" type="number">
  Estimated profit percentage if the outcome wins.
</ResponseField>

<ResponseField name="currencyBaseMultiplier" type="number">
  Multiplier applied to convert prices to the requested currency (1 for USD, 100 for NGN).
</ResponseField>

<ResponseField name="completeFill" type="boolean">
  Whether the full amount can be filled at the quoted price (relevant for CLOB markets).
</ResponseField>

<ResponseField name="tradeGoesOverMaxLiability" type="boolean">
  Whether this trade exceeds maximum liability limits.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "price": 0.7235,
    "currentMarketPrice": 0.72,
    "quantity": 138.21,
    "amount": 100,
    "costOfShares": 98.04,
    "fee": 1.96,
    "priceImpactAbsolute": 0.0035,
    "profitPercentage": 38.21,
    "currencyBaseMultiplier": 1,
    "completeFill": true,
    "tradeGoesOverMaxLiability": false
  }
  ```
</ResponseExample>

<Tip>
  Always get a quote before placing an order to confirm the expected cost and shares. The quoted price is indicative — the actual fill price may differ slightly in fast-moving markets.
</Tip>
