Skip to main content
Glama
dizpers

polystrike

README.md
# Polymarket Tweet Count API — Examples

Code examples for the [Polystrike](https://polystrike.xyz/tweet-count-api) API: live
tweet counters for Polymarket's Elon Musk and Ted Cruz tweet-count markets.

The free tier needs no key (100 requests/hour). One call gets you three counters per
active market — Polystrike's independent 60-second count, the official XTracker
settlement count, and the count shown on Polymarket's UI — plus the deltas between them:

```bash
curl https://polystrike.xyz/api/v1/meta/elon
```

```json
{
  "timestamp": 1783363631650,
  "data": [
    {
      "event_id": 666466,
      "event_title": "Elon Musk # tweets July 6 - July 8, 2026?",
      "polymarket_xtracker_counter": 41,
      "real_counter": 44,
      "polymarket_ui_counter": 41,
      "settlement_delta": 3,
      "display_delta": 3,
      "internal_delta": 0
    }
  ]
}
```

## Examples

| Example | What it does |
|---|---|
| [`python/poll_counters.py`](python/poll_counters.py) | Poll both accounts, print counters + deltas (stdlib only) |
| [`typescript/pollCounters.ts`](typescript/pollCounters.ts) | Same in TypeScript / Node 18+ |
| [`mcp/claude_desktop_config.json`](mcp/claude_desktop_config.json) | Connect Claude Desktop to the hosted MCP server |
| [`mcp-server/server.js`](mcp-server/server.js) | Local MCP server over the public REST API (Node 20+) |

## Local MCP server

[`mcp-server/server.js`](mcp-server/server.js) is a stdio MCP server that wraps the
public REST API — the same tools as the hosted server, runnable locally:

```bash
npm install && node mcp-server/server.js
```

Free-tier tools need no key; free counters are delayed 30 minutes (every response says so in
`freshness_delay_sec`). Set `POLYSTRIKE_API_KEY` to a Data key ($29/month, USDC on Polygon or
Base, see https://polystrike.xyz/#pricing) for live counters, the WebSocket feed, full post
archive, counter and price history, and bulk parquet.

## Endpoints used

- `GET /api/v1/meta/elon` — Elon Musk markets (free)
- `GET /api/v1/meta/cruz` — Ted Cruz markets (free)
- `GET /api/v1/meta/{account}/tweets` — recent tweet stream (free: last 15)

Full reference: [API docs](https://polystrike.xyz/docs/) ·
[OpenAPI spec](https://polystrike.xyz/openapi.json) ·
[MCP setup guide](https://polystrike.xyz/docs/guides/mcp-setup/)

## Notes on the data

- The **XTracker oracle** is the settlement authority — Polymarket pays out on its
  number. Polystrike measures it faster (60s vs ~5min) but does not replace it.
- **Deleted tweets** stay in Polystrike's count if captured before deletion; a
  `settlement_delta` driven by a deletion is not a real edge.
- These are measurement tools, not a promise of profit.

MIT licensed.

TDQS

A4.5/5.0

Scored across 8 tools

Disambiguation5/5

Each tool targets a distinct aspect: predictions, metadata, tweets, signals, crypto metadata, portfolio analysis, rebalancing, and health. No two tools have overlapping purposes.

Naming Consistency4/5

All tools use snake_case with verb_noun pattern (mostly 'get_'), but 'check_health' uses a different verb. Still highly consistent and predictable.

Tool Count5/5

8 tools is well-scoped for a specialized prediction market API, covering all necessary operations without bloat.

Completeness5/5

Covers all key operations: discovery, forecasting, signals, portfolio analysis, rebalancing, and health. Intentionally read-only, so no gaps for its stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues