> For the complete documentation index, see [llms.txt](https://docs.prophetmarket.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prophetmarket.ai/get-started/api/market-data.md).

# Market Data

The public `markets` connection provides paginated access to the full market catalog.

## Listing Markets

```graphql
query Markets($input: MarketsInput) {
  markets(input: $input) {
    totalCount
    pageInfo { hasNextPage endCursor }
    edges {
      node {
        id
        slug
        question
        status
        yesPriceBps
        noPriceBps
        volumeCents
      }
    }
  }
}
```

### Filtering and Sorting

The `MarketsInput` accepts `first`, `after`, `sort`, and a `filter` object.

```json
{
  "input": {
    "first": 50,
    "filter": {
      "status": "OPEN",
      "categorySlug": "crypto",
      "search": "bitcoin"
    },
    "sort": "VOL4j7_DESC"
  }
}
```

Available filters include `status`, `categorySlug`, `topicSlug`, `search` (full-text), `creatorId`, and resolution date ranges (`resolvesAfter`, `resolvesBefore`).

## Single Market Fetch

Fetch a single market by ID or slug:

```graphql
query SingleMarket {
  market(id: "3bc02387-3f09-4fdd-bea9-d2b6cdd1331a") {
    question
    status
  }
  marketBySlug(slug: "btc-hits-66-422-by-aug-7") {
    id
    resolutionDate
  }
}
```

## Categories and Topics

Markets are organized into categories and topics.

```graphql
query CategoriesAndTopics {
  categories {
    name
    slug
    marketCount
    totalVolumeCents
  }
  topics(categorySlug: "crypto", limit: 10) {
    name
    slug
    marketCount
  }
}
```

## Betting Limits

The `marketBetLimits` query returns the minimum and maximum allowed bet sizes for a specific market.

```graphql
query Limits($marketId: String!) {
  marketBetLimits(marketId: $marketId) {
    minBetCents
    maxBetCents
  }
}
```

{% hint style="warning" %}
**Limits vary by market**

While global defaults exist in `bettingConfig`, individual markets may have specific overrides. Always check `marketBetLimits` before placing an order.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prophetmarket.ai/get-started/api/market-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
