Skip to main content

Get Summary

Retrieve high-level analytics summary across all connected repositories.
curl -X GET 'http://localhost:8000/api/v1/analytics/summary' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/analytics/summary Authentication: Required

Response

total_reviews
integer
required
Total unique PRs reviewed (deduplicated)
success_rate
number
required
Percentage of reviews that completed successfully
avg_processing_seconds
number
required
Average AI review processing time in seconds
connected_repos
integer
required
Number of active repository connections
reviews_today
integer
required
PRs reviewed today
reviews_this_week
integer
required
PRs reviewed in the last 7 days
avg_merge_hours
number
Average time from PR open to merge (hours)
avg_pr_size
integer
Average PR size (additions + deletions)
last_week_activity
array
required
Array of PR activity from the last 7 days

Example Response

{
  "total_reviews": 47,
  "success_rate": 95.7,
  "avg_processing_seconds": 38.2,
  "connected_repos": 3,
  "reviews_today": 2,
  "reviews_this_week": 12,
  "avg_merge_hours": 18.4,
  "avg_pr_size": 342,
  "last_week_activity": [
    {
      "pr_number": 42,
      "title": "Add authentication",
      "author": "octocat",
      "repo_name": "octocat/nectr",
      "state": "merged",
      "additions": 234,
      "deletions": 56,
      "changed_files": 8
    }
  ]
}

Get Timeline

Retrieve daily review counts over a time period.
curl -X GET 'http://localhost:8000/api/v1/analytics/timeline?days=30' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/analytics/timeline Authentication: Required
days
integer
default:"30"
Number of days to include (7-90)

Response

Array of daily statistics:
date
string
required
ISO date (YYYY-MM-DD)
total
integer
required
Total unique PRs reviewed on this day
completed
integer
required
Successfully completed reviews
failed
integer
required
Failed reviews

Example Response

[
  {
    "date": "2025-03-10",
    "total": 5,
    "completed": 4,
    "failed": 1
  },
  {
    "date": "2025-03-09",
    "total": 3,
    "completed": 3,
    "failed": 0
  }
]

Get Insights

Detailed analytics including merge times, per-author stats, verdict breakdown, and issue categorization.
curl -X GET 'http://localhost:8000/api/v1/analytics/insights?days=30' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/analytics/insights Authentication: Required
days
integer
default:"30"
Analysis period in days (7-90)

Response

period_days
integer
required
Number of days analyzed
total_prs
integer
required
Total unique PRs in period
avg_pr_size
integer
Average PR size (lines changed)
merge_time
object
required
Merge time statistics (hours)
verdicts
object
required
AI review verdict counts: APPROVE, REQUEST_CHANGES, NEEDS_DISCUSSION
confidence_distribution
object
required
Distribution of confidence scores (1-5)
issue_categories
object
required
Counts of issues by severity: critical, moderate, minor, total
per_author
array
required
Per-developer statistics
per_repo
array
required
Per-repository statistics

Example Response

{
  "period_days": 30,
  "total_prs": 47,
  "avg_pr_size": 342,
  "merge_time": {
    "avg_hours": 18.4,
    "median_hours": 12.5,
    "fastest_hours": 2.3,
    "slowest_hours": 72.1,
    "sample_size": 38
  },
  "verdicts": {
    "APPROVE": 32,
    "REQUEST_CHANGES": 8,
    "NEEDS_DISCUSSION": 7
  },
  "confidence_distribution": {
    "1": 0,
    "2": 2,
    "3": 8,
    "4": 25,
    "5": 12
  },
  "issue_categories": {
    "critical": 5,
    "moderate": 18,
    "minor": 34,
    "total": 57
  },
  "per_author": [
    {
      "author": "octocat",
      "prs": 23,
      "merged": 21,
      "issues_flagged": 12,
      "avg_confidence": 4.2
    }
  ],
  "per_repo": [
    {
      "repo": "octocat/nectr",
      "prs": 47,
      "merged": 42,
      "issues": 57,
      "merge_rate": 89.4
    }
  ]
}

Get Contributors

Team leader view: per-developer profiles from the memory layer.
curl -X GET 'http://localhost:8000/api/v1/analytics/contributors?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/analytics/contributors Authentication: Required
repo
string
required
Repository in owner/repo format
page
integer
default:"1"
Page number (1-indexed)
per_page
integer
default:"20"
Items per page (1-100)

Response

repo
string
required
Repository name
contributor_count
integer
required
Total contributors
page
integer
required
Current page
per_page
integer
required
Items per page
total_pages
integer
required
Total pages available
contributors
array
required
Array of contributor profiles

Example Response

{
  "repo": "octocat/nectr",
  "contributor_count": 8,
  "page": 1,
  "per_page": 20,
  "total_pages": 1,
  "contributors": [
    {
      "username": "octocat",
      "profile_summary": "Senior backend developer with expertise in Python and FastAPI",
      "patterns": [
        "Prefers async/await patterns for I/O operations",
        "Always includes comprehensive error handling"
      ],
      "strengths": [
        "Database optimization",
        "API design"
      ],
      "pr_count": 23,
      "commit_count": 147,
      "last_seen_pr": 42
    }
  ]
}

Notes

  • Requires Mem0 memory layer to be configured
  • Returns empty list if memory not available
  • Only includes developers with recorded activity

Get Graph Analytics

Repository intelligence from Neo4j graph + GitHub API.
curl -X GET 'http://localhost:8000/api/v1/analytics/graph?repo=octocat/nectr' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/analytics/graph Authentication: Required
repo
string
required
Repository in owner/repo format

Response

repo
string
required
Repository name
languages
array
required
Language distribution from GitHub (byte-accurate)
file_hotspots
array
required
Most PR-touched files (up to 10)
high_risk_files
array
required
Files with most REQUEST_CHANGES verdicts (up to 8)
dead_files
object
required
Files never touched by reviewed PRs
code_ownership
array
required
File → dominant contributor mapping (up to 10)
developer_expertise
array
required
Per-developer directory expertise (up to 8)
contributors
array
required
Top 10 contributors by commit count (default branch, all time)

Example Response

{
  "repo": "octocat/nectr",
  "languages": [
    {"name": "Python", "bytes": 234567, "pct": 78.3},
    {"name": "JavaScript", "bytes": 45678, "pct": 15.2},
    {"name": "Shell", "bytes": 19456, "pct": 6.5}
  ],
  "file_hotspots": [
    {"path": "app/api/v1/reviews.py", "touch_count": 12}
  ],
  "high_risk_files": [
    {"path": "app/auth/router.py", "issue_count": 5}
  ],
  "dead_files": {
    "count": 23,
    "sample": ["legacy/old_api.py", "utils/deprecated.py"]
  },
  "code_ownership": [
    {"path": "app/api/v1/reviews.py", "owner": "octocat", "contribution_pct": 82.5}
  ],
  "developer_expertise": [
    {"username": "octocat", "directory": "app/api/v1", "file_count": 15}
  ],
  "contributors": [
    {
      "login": "octocat",
      "total": 147,
      "additions": 12456,
      "deletions": 3421,
      "weeks": [{"w": 1709596800, "c": 8}]
    }
  ]
}

Error Responses

  • 403: Repo not connected or access denied
  • 400: Invalid repo format (must be owner/repo)

Build docs developers (and LLMs) love