> ## 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.

# CLI

> Use the EntityML CLI for Polymarket and Kalshi market data endpoints.

## Overview

The EntityML CLI ships with the same Python package as the SDK. Install `entityml` once and you get both:

* `from entityml import EntityMLClient`
* the `entityml` terminal command

<Note>
  The CLI is no longer documented as a separate `entityml-cli` package. The previous `poly-storage` command remains a compatibility alias, but new examples use `entityml`.
</Note>

## Install

Use one of these install methods:

<CodeGroup>
  ```bash pip (recommended) theme={null}
  python3 -m pip install --upgrade entityml
  ```

  ```bash latest from GitHub theme={null}
  python3 -m pip install --upgrade "git+https://github.com/anaygupta2004/entityml.git"
  ```

  ```bash Homebrew + pip theme={null}
  brew install python
  python3 -m pip install --upgrade entityml
  ```

  ```bash download with cURL theme={null}
  curl -L https://github.com/anaygupta2004/entityml/archive/refs/heads/main.tar.gz -o entityml.tar.gz
  tar -xzf entityml.tar.gz
  python3 -m pip install ./entityml-main
  ```

  ```bash local checkout (development) theme={null}
  pip install -e /path/to/entityml
  ```
</CodeGroup>

## Authentication

Use either `--api-key` or the `ENTITY_API_KEY` environment variable:

```bash theme={null}
export ENTITY_API_KEY="YOUR_API_KEY"
```

## Coverage notes

* Orderbook data exists for a subset of markets from `2025-09-01` on Polymarket and `2026-02-17` for Kalshi, but coverage is not continuous.
* Broad Polymarket crypto-related market coverage begins on `2026-02-04`. Broad Kalshi crypto-related market coverage begins on `2026-02-25`.
* Broad all-market capture begins on `2026-04-02` for Polymarket and `2026-03-31` for Kalshi, with known April 2026 quality exceptions.
* Use the Polymarket and Kalshi date-range endpoints to confirm per-market availability.
* See [Data Quality](/data-quality) before depending on April 2026 data.

## Commands

### Health check

```bash theme={null}
entityml health
entityml monitoring-status
entityml lookup-slug --slug will-bitcoin-hit-100k
```

### Polymarket inventory

```bash theme={null}
entityml polymarket list-markets --prefix 0x8213 --limit 5

entityml polymarket date-range \
  --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4
```

### Polymarket raw market data

```bash theme={null}
entityml polymarket market-data \
  --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
  --date 2026-02-13 \
  --offset 0 \
  --limit 500

entityml polymarket market-data-range \
  --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
  --start-timestamp 1770940800000 \
  --end-timestamp 1770944400000 \
  --limit 500
```

### Polymarket orderbook summary

```bash theme={null}
entityml polymarket orderbook-summary \
  --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
  --asset-id 97684905927345553455494278582909124912046930226695064344571162061840768197777 \
  --start-timestamp 1770940800000 \
  --end-timestamp 1770944399999 \
  --resolution 60
```

### Kalshi inventory

```bash theme={null}
entityml kalshi list-markets --prefix KXBTC --limit 5

entityml kalshi date-range \
  --ticker KXBTC-26FEB2606-B60125
```

### Kalshi raw market data

```bash theme={null}
entityml kalshi market-data \
  --ticker KXBTC-26FEB2606-B60125 \
  --date 2026-02-26 \
  --offset 0 \
  --limit 500

entityml kalshi market-data-range \
  --ticker KXBTC-26FEB2606-B60125 \
  --start-timestamp 1772103600000 \
  --end-timestamp 1772107200000 \
  --limit 500
```

### Kalshi orderbook summary

```bash theme={null}
entityml kalshi orderbook-summary \
  --ticker KXBTC-26FEB2606-B60125 \
  --start-timestamp 1772103600000 \
  --end-timestamp 1772107199999 \
  --resolution 60
```

### API key commands

```bash theme={null}
entityml api-keys create --name my-key --user-id YOUR_USER_ID
entityml api-keys list --user-id YOUR_USER_ID
entityml api-keys delete --key-id YOUR_KEY_ID --user-id YOUR_USER_ID
entityml api-keys last-used --key-id YOUR_KEY_ID
entityml api-keys name --key-id YOUR_KEY_ID
```

### Billing and analytics

```bash theme={null}
entityml billing usage --user-id YOUR_USER_ID
entityml billing subscription-status --user-id YOUR_USER_ID

entityml analytics user-request-count --user-id YOUR_USER_ID
entityml analytics user-recent-requests --user-id YOUR_USER_ID --limit 5
entityml analytics popular-markets --limit 10 --days 7
```

All commands return JSON to stdout.
