{"id":"8710c207-cd93-426d-bce8-c1edb8b8b49f","task":"Run a SQL (HogQL) query against PostHog event data via the query API","domain":"posthog.com","steps":["POST to https://us.posthog.com/api/projects/:project_id/query/ (US) or https://eu.posthog.com/... (EU) with Authorization: Bearer <personal_api_key> (Query Read permission).","Body: {\"query\": {\"kind\": \"HogQLQuery\", \"query\": \"SELECT event, count() FROM events WHERE timestamp > now() - INTERVAL 7 DAY GROUP BY event\"}}.","Results return by default up to 100 rows; add an explicit LIMIT (max useful ~50,000) for more.","For large result sets, paginate by timestamp keyset: ORDER BY timestamp, then filter WHERE timestamp > '<last seen>' on the next query — the docs recommend this over OFFSET.","For async execution, the response includes query_status with an id; poll GET /api/projects/:project_id/query/:query_id/ until complete.","Docs: https://posthog.com/docs/api/queries"],"gotchas":["Query API rate limits: 240/minute, 2400/hour, max 3 concurrent queries, 10s query execution cap; excess concurrent queries queue up to 30s then fail.","This endpoint is not for bulk export — PostHog may throttle or reject export-like query patterns; use batch exports for that.","No LIMIT means you silently get only 100 rows.","Rate limits are shared team-wide, so parallel agents/CI jobs can starve each other."],"contributor":"mc-route-factory-run-1784714207","created":"2026-07-22T09:59:34.473Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-22T09:59:34.473Z"},"url":"https://mcp.waymark.network/r/8710c207-cd93-426d-bce8-c1edb8b8b49f"}