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

# GET /api/organizations/:id/markets

> List an organization's markets with pagination, filtering, and sorting

Fetches a paginated list of markets belonging to a specific organization. This is a convenience sub-resource — it returns exactly the same results as [`GET /api/markets?organizationId=:id`](/developer-docs/public-embed-api/endpoints/markets), scoped to a single organization so you only ever get back that organization's markets.

## Endpoint

```
GET https://app.kash.bot/api/organizations/:id/markets
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique organization identifier (UUID format)
</ParamField>

## Query Parameters

<ParamField query="status" type="string" default="active">
  Filter by market status: `active`, `resolved`, `cancelled`, `paused`, `refunded`, `all`
</ParamField>

<ParamField query="category" type="string">
  Filter by category (e.g., `politics`, `crypto`, `sports`)
</ParamField>

<ParamField query="limit" type="number" default="50">
  Maximum number of results per page (max: 100)
</ParamField>

<ParamField query="offset" type="number" default="0">
  Pagination offset for fetching subsequent pages
</ParamField>

<ParamField query="sortBy" type="string" default="created_at">
  Field to sort by: `created_at`, `total_volume`, `current_probability`, `title`, `end_time`
</ParamField>

<ParamField query="sortOrder" type="string" default="desc">
  Sort direction: `asc`, `desc`
</ParamField>

## Response

<ResponseField name="markets" type="array">
  Array of market objects (same shape as [`GET /api/markets`](/developer-docs/public-embed-api/endpoints/markets))

  <Expandable title="Market Object">
    <ResponseField name="id" type="string">
      Unique market identifier
    </ResponseField>

    <ResponseField name="question" type="string">
      Market question
    </ResponseField>

    <ResponseField name="probability" type="number">
      Current YES probability (0-1)
    </ResponseField>

    <ResponseField name="totalVolume" type="number">
      Total trading volume in cents
    </ResponseField>

    <ResponseField name="status" type="string">
      Market status
    </ResponseField>

    <ResponseField name="endTime" type="number">
      Market end time (Unix timestamp in milliseconds)
    </ResponseField>

    <ResponseField name="category" type="string">
      Market category
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of market creation
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata

  <Expandable title="Pagination Object">
    <ResponseField name="offset" type="number">
      Current offset
    </ResponseField>

    <ResponseField name="limit" type="number">
      Results per page
    </ResponseField>

    <ResponseField name="total" type="number">
      Total number of matching markets
    </ResponseField>

    <ResponseField name="hasMore" type="boolean">
      Whether more results are available
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="_meta" type="object">
  Request metadata

  <Expandable title="Metadata Properties">
    <ResponseField name="organizationId" type="string">
      The organization ID that was queried
    </ResponseField>

    <ResponseField name="requestedAt" type="string">
      ISO 8601 timestamp of request processing
    </ResponseField>
  </Expandable>
</ResponseField>

## Rate Limit

<Info>
  **100 requests per minute** per IP address
</Info>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://app.kash.bot/api/organizations/550e8400-e29b-41d4-a716-446655440000/markets?status=active&sortBy=total_volume&sortOrder=desc&limit=10"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.kash.bot/api/organizations/550e8400-e29b-41d4-a716-446655440000/markets?' +
    new URLSearchParams({
      status: 'active',
      sortBy: 'total_volume',
      sortOrder: 'desc',
      limit: 10
    })
  );
  const data = await response.json();
  console.log(`Found ${data.markets.length} markets`);
  ```

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

  response = requests.get(
      'https://app.kash.bot/api/organizations/550e8400-e29b-41d4-a716-446655440000/markets',
      params={
          'status': 'active',
          'sortBy': 'total_volume',
          'sortOrder': 'desc',
          'limit': 10
      }
  )
  data = response.json()
  print(f"Found {len(data['markets'])} markets")
  ```
</CodeGroup>

## Example Response

```json 200 - Success theme={null}
{
  "markets": [
    {
      "id": "market-abc123",
      "question": "Will BTC hit $100k by end of 2025?",
      "probability": 0.72,
      "totalVolume": 1250000,
      "status": "OPEN",
      "endTime": 1735689600000,
      "category": "crypto",
      "createdAt": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 10,
    "total": 24,
    "hasMore": true
  },
  "_meta": {
    "organizationId": "550e8400-e29b-41d4-a716-446655440000",
    "requestedAt": "2026-03-04T12:00:00Z"
  }
}
```

```json 404 - Organization Not Found theme={null}
{
  "error": "Organization not found",
  "message": "No organization exists with ID: 550e8400-e29b-41d4-a716-446655440000",
  "code": "NOT_FOUND"
}
```

## Showing only your organization's markets

Because the organization is fixed by the path, every market returned belongs to that organization — there is no way for another organization's markets to appear in the response. This is the recommended endpoint for powering an "our markets" feed on your own website.

If you prefer the flat endpoint, the equivalent call is:

```bash theme={null}
curl "https://app.kash.bot/api/markets?organizationId=550e8400-e29b-41d4-a716-446655440000"
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Embedding Organization Iframes" href="/developer-docs/public-embed-api/guides/organization-iframe">
    Drop your markets onto your site with a single iframe
  </Card>

  <Card title="GET /api/organizations/:id" href="/developer-docs/public-embed-api/endpoints/organization-detail">
    Get organization metadata (name, logo, branding)
  </Card>

  <Card title="GET /api/markets" href="/developer-docs/public-embed-api/endpoints/markets">
    List all markets with the equivalent organizationId filter
  </Card>

  <Card title="GET /api/markets/:id/twitter-link" href="/developer-docs/public-embed-api/endpoints/market-twitter-link">
    Generate a Twitter deep link to post & trade a market
  </Card>
</CardGroup>
