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

# predictionCategories

> Returns available prediction categories and nested subcategories.

<Info>
  **Prediction Market data is currently in beta**. It is actively being worked on and improved, but may be unreliable. Polymarket and Kalshi data are live.

  At least for the time being, this endpoint requires a Growth or Enterprise plan. [Learn more](https://dashboard.codex.io/dashboard/billing?utm_source=codex\&utm_medium=docs\&utm_campaign=billing).
</Info>

<div data-generated>
  ## GraphQL

  ```
  type Query {
    # Requires a Growth or Enterprise plan.
    predictionCategories: [PredictionCategory!]!
  }

  type PredictionSubSubcategory {
    name: String!
    slug: String!
  }

  type PredictionSubcategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubSubcategory!]
  }

  type PredictionCategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubcategory!]
  }
  ```
</div>

## Query example

<a href="/explore" target="_blank" rel="noopener noreferrer">Test this query in the Explorer →</a>

Get all categories with subcategories

```graphql theme={null}
{
  predictionCategories {
    name
    slug
    subcategories {
      name
      slug
      subcategories {
        name
        slug
      }
    }
  }
}
```

```json Example response (truncated) theme={null}
{
  "data": {
    "predictionCategories": [
      {
        "name": "Politics",
        "slug": "politics",
        "subcategories": [
          {
            "name": "Trump",
            "slug": "trump",
            "subcategories": []
          },
          {
            "name": "Biden",
            "slug": "biden",
            "subcategories": []
          },
          {
            "name": "Congress",
            "slug": "congress",
            "subcategories": []
          }
          // ... more political subcategories
        ]
      },
      {
        "name": "Sports",
        "slug": "sports",
        "subcategories": [
          {
            "name": "Basketball",
            "slug": "basketball",
            "subcategories": [
              {
                "name": "NBA",
                "slug": "nba"
              },
              {
                "name": "EuroLeague",
                "slug": "euroleague"
              },
              {
                "name": "NCAA Basketball",
                "slug": "ncaa-basketball"
              }
            ]
          },
          {
            "name": "American Football",
            "slug": "american-football",
            "subcategories": [
              {
                "name": "NFL",
                "slug": "nfl"
              },
              {
                "name": "NCAA Football",
                "slug": "ncaa-football"
              }
            ]
          },
          {
            "name": "Soccer",
            "slug": "soccer",
            "subcategories": [
              {
                "name": "Premier League",
                "slug": "premier-league"
              },
              {
                "name": "La Liga",
                "slug": "la-liga"
              }
            ]
          }
          // ... more sports subcategories
        ]
      },
      {
        "name": "Crypto",
        "slug": "crypto",
        "subcategories": [
          {
            "name": "Bitcoin",
            "slug": "bitcoin",
            "subcategories": []
          },
          {
            "name": "Ethereum",
            "slug": "ethereum",
            "subcategories": []
          },
          {
            "name": "Solana",
            "slug": "solana",
            "subcategories": []
          }
        ]
      }
      // ... 10 more top-level categories
    ]
  }
}
```

### Usage Guidelines

* Categories form a 3-level hierarchy: top-level categories contain subcategories, which may contain sub-subcategories
* Each category has a `name` (display name) and `slug` (URL-friendly identifier)
* Use the `slug` values to filter markets in [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets) (e.g., `filters: { categories: ["sports", "nba"] }`)
* Category matching in filters is case-insensitive
* Categories are dynamically generated based on active markets across all protocols

### Understanding the Category Hierarchy

The category structure has up to 3 levels of nesting:

1. **Top-level categories** (e.g., "Politics", "Sports", "Crypto") - Broad topic areas
2. **Subcategories** (e.g., "Basketball", "White House") - More specific topics within the top-level category
3. **Sub-subcategories** (e.g., "NBA", "Donald Trump") - Highly specific topics

Use the `slug` field when filtering markets by category. The `name` field is the human-readable display name.

### Common Categories

Top-level categories include:

* **Politics** - Elections, White House, Congress, Approval Ratings
* **Sports** - Basketball (NBA), Football (NFL), Soccer, Baseball, MMA, Tennis
* **Crypto** - Bitcoin, Ethereum, DeFi, NFTs
* **Finance** - Stocks, Earnings, Markets
* **Economy** - Fed decisions, Inflation, GDP
* **Tech** - AI, Companies, Products
* **Culture** - Entertainment, Media, Awards
* **World** - Geopolitics, International events
* **Climate & Science** - Weather, Research, Environment

### Troubleshooting Tips

<AccordionGroup>
  <Accordion title="How do I use categories to filter markets?">
    Use the `categories` array in [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets). You can specify one or more categories at any level. For example, `categories: ["sports", "nba"]` returns markets tagged with either Sports or NBA. Category matching is case-insensitive and hierarchical.
  </Accordion>

  <Accordion title="Why do some categories appear empty?">
    Categories are sometimes included in the hierarchy for organizational purposes even if they currently have no active markets. Additionally, all markets in that subcategory may have closed or been resolved. To check if a category has active markets, use [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets) with that category slug and check the count.
  </Accordion>

  <Accordion title="Can I search for markets by category name?">
    Yes, use the `phrase` parameter in [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets) along with the `categories` filter. The phrase searches market questions and event labels, while categories filter by assigned tags. Combining both gives precise results.
  </Accordion>

  <Accordion title="How often are categories updated?">
    Categories are updated dynamically as new markets are created and tagged. When markets close or resolve, the market counts decrease accordingly. The category structure reflects the current state of all active prediction markets.
  </Accordion>

  <Accordion title="What's the difference between category and eventLabel?">
    Categories are broad topic tags (e.g., "Politics", "NBA") used for filtering and organization. Event labels are specific market groupings (e.g., "Fed decision in March?") that represent a single real-world event. An event can have multiple category tags.
  </Accordion>

  <Accordion title="Can markets have multiple categories?">
    Yes, markets can be tagged with multiple categories at different hierarchy levels. For example, a market about "Lakers vs Celtics" might be tagged with "Sports", "Basketball", and "NBA". Use [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets) with multiple category filters to find markets at the intersection.
  </Accordion>

  <Accordion title="How do I find the most popular categories?">
    Use [`filterPredictionMarkets`](/api-reference/queries/filterpredictionmarkets) to query markets by category and check the `count` field in the response. You can also rank by `trendingScore24h` or `volumeUsd24h` to find the most active markets within each category.
  </Accordion>
</AccordionGroup>

### Related Recipes

* [Discover Prediction Markets](/recipes/predictions/discover-markets): Use categories to build filter UIs for event and market discovery
