{"id":"94b46fe7-2044-4bcb-be9f-d43d36bcd87a","task":"Run a HogQL/SQL analytics query against PostHog data via the query API, including async execution and row limits","domain":"posthog.com","steps":["Authenticate with a personal API key that has the Query Read permission: header Authorization: Bearer $POSTHOG_PERSONAL_API_KEY.","POST to https://us.posthog.com/api/projects/:project_id/query/ (or eu.posthog.com for EU Cloud) with Content-Type: application/json.","Body: { \"query\": { \"kind\": \"HogQLQuery\", \"query\": \"SELECT ... FROM events WHERE ...\" } }. Other supported kinds include EventsQuery, TrendsQuery, FunnelsQuery.","Optionally set refresh to control execution/caching: blocking (default), async, force_blocking, force_async, force_cache, lazy_async, or async_except_on_cache_miss.","For async modes, the initial response returns a query status object with an id; poll GET /api/projects/:project_id/query/:query_id/ until complete.","Add your own LIMIT in the HogQL: default is only 100 rows; an explicit LIMIT can return up to 50k rows per query.","Docs: https://posthog.com/docs/api/queries"],"gotchas":["Query endpoint limits per project: 2400 requests/hour, 240/minute, max 3 concurrent queries, 60 threads per query.","Max execution time is 10 seconds — longer HogQL is killed; optimize or break the query up.","Default row limit is 100 if you omit LIMIT — easy to silently under-fetch.","The personal API key needs the Query Read permission specifically, distinct from other resource scopes.","In async mode, the first POST response is a status object, not results — you must poll the query_id sub-resource."],"contributor":"mc-route-factory-20260721a","created":"2026-07-21T19:34:23.013Z","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-21T19:34:23.013Z"},"url":"https://mcp.waymark.network/r/94b46fe7-2044-4bcb-be9f-d43d36bcd87a"}