{"id":15590738,"url":"https://github.com/timrogers/hogql","last_synced_at":"2025-08-30T17:30:41.655Z","repository":{"id":249433575,"uuid":"831501426","full_name":"timrogers/hogql","owner":"timrogers","description":"Execute PostHog HogQL (\u003chttps://posthog.com/docs/hogql\u003e) queries from your JavaScript code","archived":false,"fork":false,"pushed_at":"2025-07-25T15:40:12.000Z","size":510,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T07:55:09.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timrogers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T18:31:40.000Z","updated_at":"2025-03-23T20:19:07.000Z","dependencies_parsed_at":"2024-07-20T19:47:01.337Z","dependency_job_id":"91c26817-0cbb-4fe4-ba0c-b6011fd10c90","html_url":"https://github.com/timrogers/hogql","commit_stats":null,"previous_names":["timrogers/hogql"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/timrogers/hogql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fhogql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fhogql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fhogql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fhogql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timrogers","download_url":"https://codeload.github.com/timrogers/hogql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fhogql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272880960,"owners_count":25008927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T23:28:16.867Z","updated_at":"2025-08-30T17:30:41.356Z","avatar_url":"https://github.com/timrogers.png","language":"TypeScript","readme":"# hogql\n\nExecute PostHog [HogQL](https://posthog.com/docs/hogql) queries from your JavaScript code\n\n## Installation\n\n```bash\nnpm install --save hogql\n```\n\n## Usage\n\n### From JavaScript code\n\n```ts\nimport { hogql } from 'hogql';\n\n(async () =\u003e {\n  const { results } = await hogql\u003c[string, string][]\u003e('SELECT uuid, event FROM events LIMIT 500', {\n    apiKey: process.env.POSTHOG_API_KEY,\n    projectId: process.env.POSTHOG_PROJECT_ID,\n  });\n\n  for (const [uuid, event] of results) {\n    console.log(`${uuid}: ${event}`);\n  }\n})();\n```\n\n### From the command line\n\nRun the following command, specifying your query, and the query results will be printed as JSON to STDOUT:\n\n```bash\nnpx hogql \"SELECT * FROM events LIMIT 10\"\n```\n\nAs well as specifying the query, you must configure:\n\n* a PostHog API key, using the `--posthog-api-key` option or the `POSTHOG_API_KEY` environment variable\n* the PostHog project ID, using the `--posthog-project-id` option or the `POSTHOG_PROJECT_ID` environment variable\n\nYou may also configure:\n\n* the PostHog base URL, if required, using the `--posthog-base-url` option or the `POSTHOG_BASE_URL` environment variable. Defaults to https://app.posthog.com.\n* the format for the results. By default, an array of arrays will be logged to STDOUT as JSON, but you can set the `--return-objects` to return an array of key-value objects instead, using the column names returned by the PostHog API as keys","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Fhogql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimrogers%2Fhogql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Fhogql/lists"}