downloading-batch-export-files
できること
このスキルは、PostHogから一度限りのデータ書き出しを開始し、完成したファイルをダウンロードします。自分のツールで使う生データがファイルで必要なアナリスト向けです。
使う場面
- ✓特定の期間の生のイベント、人、セッションをダウンロードしたいとき。
- ✓HogQLクエリの結果をファイルとして保存したいとき。
- ✓別のツールに読み込むためのParquetまたはJSON Linesファイルが必要なとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/products/batch_exports/skills/downloading-batch-export-files/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“先週のすべてのイベントを、分析ツールに読み込めるようParquetファイルとして書き出してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、データの種類や日付などの正しい設定で書き出しを開始し、ファイルが準備できるまで状態を確認します。その後、PostHogのダウンロードリンクからファイルを取得します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Downloading batch export files
Use this skill when a user wants a one-off downloadable export of PostHog data. The export is started and monitored through MCP, but the final file download uses the existing REST endpoint directly.
Available MCP tools
| Tool | Purpose |
|---|---|
posthog:file-download-batch-exports-create |
Start an on-demand export and return the run ID |
posthog:file-download-batch-exports-retrieve |
Poll the run status and return file IDs after completion |
Do not rely on a generated MCP tool for the /download/ endpoint.
That endpoint is a redirecting file download endpoint, so raw HTTP/download handling is the right interface until MCP has explicit redirect support.
Workflow
1. Choose the export shape
Ask a short clarifying question if the user did not specify the required inputs:
model: one ofevents,persons,sessions, orhogqldata_interval_startanddata_interval_end: ISO 8601 datetimes. Any supplied bound may not be in the future. When both bounds are supplied, they must be ordered and at most one week apart Required forevents,persons, andsessions. Forhogql, required only for the placeholders the query references. If only one placeholder is referenced, the other bound may be omitted and the one-week limit does not apply.file.format:ParquetorJSONLines; preferParquetfor compact analytics exports andJSONLinesfor line-oriented text processingfile.compression: optional, one ofzstd,gzip,brotli,lz4, orsnappy. IfJSONLineswas chosen as format, onlygzipandbrotliare supported.file.max_size_mb: part size in MiB, 1024 by default. A part can go a little over this size. Lower it when the user wants smaller parts, raise it for fewer and bigger ones, or set it tonullto write a single file of any size.
For events, include and exclude are optional event-name filters.
Use them only when the user asks for specific events or wants to omit specific events.
For hogql, pass the query as hogql_query and leave out include and exclude.
You may prompt the user to export a slice of data by including a WHERE clause in the HogQL query, for example limiting results from the events table by bounding timestamp.
Always prefer limiting the data exported to the minimum necessary to solve the user's request.
Every column in the SELECT clause must be a field or have an alias.
This model is in closed beta and is enabled per team.
A hogql query can reference the {data_interval_start} and {data_interval_end} placeholders.
The export replaces them with the data_interval_start and data_interval_end values, so one query can export any interval.
Supply a bound for every placeholder the query references; a missing bound fails the request.
The bounds only replace placeholders and do not filter anything themselves, so a query without placeholders runs unchanged even when bounds are supplied.
Prefer placeholders over literal dates when the user wants a time range, or several consecutive ranges from the same query.
Compare with >= {data_interval_start} and < {data_interval_end}, so consecutive ranges do not export the same row twice.
2. Start the export
Call posthog:file-download-batch-exports-create with the selected shape.
The response contains an id for the export run.
Example request:
{
"model": "events",
"file": {
"format": "JSONLines",
"compression": "gzip"
},
"include": ["$pageview"],
"data_interval_start": "2026-05-25T00:00:00Z",
"data_interval_end": "2026-05-26T00:00:00Z"
}
Example request for the hogql model:
{
"model": "hogql",
"file": {
"format": "Parquet"
},
"hogql_query": "SELECT event, timestamp, properties.$current_url AS url FROM events WHERE timestamp >= {data_interval_start} AND timestamp < {data_interval_end}",
"data_interval_start": "2026-05-25T00:00:00Z",
"data_interval_end": "2026-05-26T00:00:00Z"
}
3. Poll until completion
Call posthog:file-download-batch-exports-retrieve with the returned id.
Status handling:
| Status | Action | | ------------------------------------------
よくある質問
書き出せるデータは何ですか?
イベント、人、セッション、またはHogQLクエリの結果を書き出せます。
日付の範囲に制限はありますか?
はい。開始日と終了日の両方を指定する場合、順序が正しく、1週間以内である必要があります。
未来の日付を書き出せますか?
いいえ。日付は未来にできません。
詳細
作者による元の説明
Export PostHog events, persons, sessions, or the results of a HogQL query on demand and download the resulting files. Use when the user asks to download/export raw PostHog data, export HogQL query results, create a one-off file export, fetch a Parquet or JSONLines export, or use the file_download_batch_exports API. Covers starting the export with MCP, polling completion, and downloading via the existing REST redirect endpoint.
repo: PostHog/posthog
人気
- GitHubのスター
- 41k
- ランキング
- #6836
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。