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

# Get Popular Markets

> Return the most frequently queried markets over a lookback window.

## Request

<ParamField query="limit" type="integer">
  Number of markets to return. Default: `20`. Max: `100`.
</ParamField>

<ParamField query="days" type="integer">
  Lookback window in days. Default: `30`. Max: `365`.
</ParamField>

## Response

<ResponseField name="top_markets" type="array">
  Array of `{ condition_id, request_count }` rows.
</ResponseField>

## Example

<CodeGroup>
  ```python Python SDK theme={null}
  from entityml import EntityMLClient

  client = EntityMLClient()
  popular = client.analytics.get_popular_markets(limit=10, days=7)
  print(popular["top_markets"])
  ```

  ```bash CLI theme={null}
  entityml analytics popular-markets --limit 10 --days 7
  ```

  ```bash Raw HTTP (cURL) theme={null}
  curl "https://api.entityml.com/api/v1/stats/popular-markets?limit=10&days=7"
  ```
</CodeGroup>

### Example response

```json theme={null}
{
  "days": 7,
  "total_unique_markets": 150,
  "top_markets": [
    {
      "condition_id": "0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
      "request_count": 82
    }
  ]
}
```
