Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 2.47 KB

File metadata and controls

82 lines (62 loc) · 2.47 KB

GitHub Activity Stream — Python (apify-client) examples

Call the hosted GitHub Activity Stream from Python with the official apify-client. These snippets run the Actor on Apify — nothing scrapes locally.

Install

pip install apify-client

Run and iterate over results

from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")

run = client.actor("logiover/github-activity-stream").call(run_input={
    "mode": "repo",
    "repos": ["microsoft/vscode"],
    "since": "2026-06-29",
    "maxPerType": 200,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f'{item["type"]:<8} {item["repo"]} | {item["title"]}')

Weekly digest of merged PRs and releases

from datetime import date, timedelta
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
since = (date.today() - timedelta(days=7)).isoformat()

run = client.actor("logiover/github-activity-stream").call(run_input={
    "mode": "repo", "repos": ["vercel/next.js"], "since": since,
})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())

releases = [e for e in items if e["type"] == "release"]
merged = [e for e in items if e["type"] == "pull" and e.get("merged")]
print(f"Releases: {len(releases)}  Merged PRs: {len(merged)}")

Security-commit detection

import re
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("logiover/github-activity-stream").call(run_input={
    "mode": "repo",
    "repos": ["openssl/openssl"],
    "eventTypes": ["commits", "pulls"],
    "maxPerType": 300,
})
rx = re.compile(r"\b(security|cve|vuln|exploit|patch|fix)\b", re.I)
flagged = [e for e in client.dataset(run["defaultDatasetId"]).iterate_items()
           if e.get("title") and rx.search(e["title"])]
print(f"{len(flagged)} security-flagged events")

Load org releases into pandas

import pandas as pd
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("logiover/github-activity-stream").call(run_input={
    "mode": "org", "org": "kubernetes", "maxOrgRepos": 20,
    "eventTypes": ["releases"], "since": "2026-06-01",
})
df = pd.DataFrame(client.dataset(run["defaultDatasetId"]).iterate_items())
print(df[["repo", "tagName", "createdAt"]].sort_values("createdAt"))

Keep your token in an environment variable (os.environ["APIFY_TOKEN"]) instead of hard-coding it.