# searchMarkets

**Identifier:** `polymarket_searchMarkets`

**Provider:** [Polymarket](https://kirha.com/providers/polymarket.md)

Search Polymarket events by keyword and get the markets inside each one with real-time odds. An event groups sibling markets (one per candidate, model, date), so match the question against each market's question and groupItemTitle. Use getEvent for every market of an event, getMarket for one known market, getMarketPriceHistory for odds over time.

## Run it with the CLI

```bash
kirha tools run polymarket_searchMarkets \
  --input '{
    "query": "Fed rate cut December"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "polymarket_searchMarkets",
  "input": {
    "query": "Fed rate cut December"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "closingWithinDays": {
      "maximum": 365,
      "minimum": 1,
      "type": "number"
    },
    "includeClosed": {
      "default": false,
      "description": "Also return resolved events and markets",
      "type": "boolean"
    },
    "limit": {
      "default": 10,
      "description": "Max events",
      "maximum": 50,
      "minimum": 1,
      "type": "integer"
    },
    "query": {
      "description": "Event names, people, topics. e.g. 'Fed rate cut December', 'Ethereum ETF'",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "events": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "closed": {
            "type": "boolean"
          },
          "eventId": {
            "type": "string"
          },
          "eventSlug": {
            "description": "Input for getEvent",
            "type": "string"
          },
          "marketCount": {
            "description": "Markets in the event; call getEvent when larger than markets returned",
            "type": "number"
          },
          "markets": {
            "description": "Highest volume first",
            "items": {
              "additionalProperties": false,
              "properties": {
                "closed": {
                  "type": "boolean"
                },
                "endDate": {
                  "type": "string"
                },
                "groupItemTitle": {
                  "description": "Short label distinguishing this market from siblings in the same event",
                  "type": "string"
                },
                "liquidity": {
                  "type": "number"
                },
                "marketId": {
                  "type": "string"
                },
                "marketSlug": {
                  "description": "Input for getMarket and getMarketPriceHistory",
                  "type": "string"
                },
                "openInterest": {
                  "type": "number"
                },
                "outcomePrices": {
                  "description": "Probability per outcome (0-1), same order as outcomes",
                  "items": {
                    "type": "number"
                  },
                  "type": "array"
                },
                "outcomes": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "question": {
                  "type": "string"
                },
                "volume": {
                  "type": "number"
                },
                "volume24hr": {
                  "type": "number"
                }
              },
              "required": [
                "marketId",
                "marketSlug",
                "question",
                "closed",
                "outcomes",
                "outcomePrices"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "eventId",
          "eventSlug",
          "title",
          "closed",
          "marketCount",
          "markets"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "marketSlugs": {
      "description": "Inputs for getMarket and getMarketPriceHistory",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "events",
    "marketSlugs"
  ],
  "type": "object"
}
```

## Related tools

Other Polymarket tools that this tool refers to, or that refer to it.

- [`getEvent`](https://kirha.com/providers/polymarket/getEvent.md)
- [`getMarketPriceHistory`](https://kirha.com/providers/polymarket/getMarketPriceHistory.md)
- [`getMarket`](https://kirha.com/providers/polymarket/getMarket.md)

-----

[All Polymarket tools](https://kirha.com/providers/polymarket.md) · [< Back to tools list](https://kirha.com/tools.md)