# GitHub Repo Analyzer — Health, Activity & Risk (AI) (`noniner/github-repo-analyzer`) Actor

Analyze any GitHub repository's health: stars, activity, release cadence, contributor concentration, issue responsiveness and license — with an AI assessment of maintenance, momentum and risk. For due diligence, OSS selection and dev-tool research.

- **URL**: https://apify.com/noniner/github-repo-analyzer.md
- **Developed by:** [Fredrik Hansson](https://apify.com/noniner) (community)
- **Categories:** Developer tools, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 repo analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GitHub Repo Analyzer — Health, Activity & Risk (AI)

**Before you depend on an open-source project, know what you're depending on.** This Actor reads any GitHub repository through the official GitHub API and turns its raw signals — stars, commit recency, release cadence, contributor concentration, license and issue load — into a clear **health, activity and risk verdict**. On top of the hard numbers, OpenAI adds a grounded assessment of **maintenance, momentum and bus-factor risk**.

Give it a list of repositories. It hands back a due-diligence scorecard.

***

### The flow

```
1. Paste repositories            2. Pull real signals from        3. Get a health verdict
   ("owner/repo" or URLs)    →       the GitHub API            →     score · activity · risks
   facebook/react                    stars · commits · releases      bus factor · summary
   vercel/next.js                    contributors · license
```

1. **Paste repositories** as `owner/repo` or full GitHub URLs (e.g. `facebook/react`, `https://github.com/vercel/next.js`).
2. **The Actor queries the GitHub REST API** for each repo — metadata, languages, contributors, releases and the latest commit. No scraping.
3. **The AI layer scores it** — health (0–100), activity level, bus-factor risk, concrete red flags and a two-sentence summary, grounded only in the gathered numbers.

Add an optional **GitHub token** to lift the rate limit from ~60 to 5,000 requests/hour for large batches.

***

### What you get per repo

For every repository, the Actor:

1. **Reads core metadata** (`GET /repos/{owner}/{repo}`): stars, forks, watchers, primary language, SPDX license, created/pushed dates, open-issue count, archived flag, description, homepage and topics.
2. **Breaks down languages** (`/languages`) by bytes.
3. **Samples contributors** (`/contributors`, first 100): an approximate `contributorsCount`, the top contributors and the **top contributor's share** — the core **bus-factor** signal.
4. **Reads releases** (`/releases`): release count, latest release date and the **median gap (cadence)** between recent releases.
5. **Finds the last commit** (`/commits?per_page=1`): the single most important freshness signal — how long since anyone touched the code.

Then the **AI layer** (OpenAI `gpt-4o-mini`, a fast and low-cost model) adds:

- **`healthScore`** (0–100) — blends activity, community breadth, release discipline and the absence of red flags.
- **`activityLevel`** — `abandoned` · `low` · `active` · `very-active`.
- **`maintenanceSignal`** / **`communitySignal`** — one factual sentence each.
- **`busFactorRisk`** — `low` · `medium` · `high` (how concentrated the work is in one person).
- **`risks`** — short phrases naming concrete red flags (staleness, single-maintainer, missing license, archived).
- **`summary`** — a two-sentence verdict.

Every statement is grounded in the fetched numbers — no invented facts. A repo that is gone, private or renamed comes back with an `error` instead of failing the run.

***

### Three ways people use it

- **Open-source due diligence** — before adopting a library, run a **GitHub repo analysis** to judge **open source health**: is it maintained, is there release discipline, or is it a one-person side project at risk of abandonment?
- **Dependency & vendor risk** — audit your `package.json` / `go.mod` / `requirements.txt` dependencies for **bus factor**, stale commits, archived status and license problems. Turn a list of repos into an **OSS due diligence** register for security and procurement.
- **Dev-tool competitive research** — benchmark your project against rivals: compare stars, momentum, contributor breadth and release cadence across a whole category of developer tools.

Keywords: GitHub repo analysis, open source health, bus factor, OSS due diligence, dependency risk, repository health score.

***

### Input

| Field | Type | Notes |
|---|---|---|
| `repos` | array | **Required.** Repositories as `owner/repo` or GitHub URLs. One per line. |
| `githubToken` | string | Optional GitHub personal access token. Without it, GitHub allows ~60 requests/hour; with it, 5,000/hour. Recommended for large batches. |
| `maxResults` | integer | Cap how many repositories to analyze. Default `100`. One pay-per-event charge per repo analyzed. |
| `maxConcurrency` | integer | Repositories processed in parallel. Default `4`. |
| `model` | string | Override the OpenAI model. Default `gpt-4o-mini`. |

A `GITHUB_TOKEN` environment variable is used as a fallback if the `githubToken` input is left empty.

#### Minimal input example

```json
{
  "repos": ["facebook/react", "vercel/next.js"]
}
```

***

### Output example

```json
{
  "repo": "facebook/react",
  "owner": "facebook",
  "name": "react",
  "description": "The library for web and native user interfaces.",
  "stars": 232000,
  "forks": 47000,
  "watchers": 6700,
  "primaryLanguage": "JavaScript",
  "languages": { "JavaScript": 48210334, "TypeScript": 1203994, "HTML": 102339 },
  "license": "MIT",
  "createdAt": "2013-05-24T16:15:54Z",
  "lastCommit": "2026-10-08T11:02:33Z",
  "lastRelease": "2026-04-25T20:12:00Z",
  "releaseCount": 10,
  "releaseCadenceDays": 61,
  "openIssues": 980,
  "contributorsCount": 100,
  "topContributorShare": 0.12,
  "archived": false,
  "healthScore": 94,
  "activityLevel": "very-active",
  "maintenanceSignal": "Committed within the last day with a steady, well-staffed cadence.",
  "communitySignal": "A broad contributor base with no single dominant author.",
  "busFactorRisk": "low",
  "risks": [],
  "summary": "A flagship, heavily-maintained library with strong momentum and a wide contributor base. No meaningful maintenance or bus-factor risk."
}
```

A repository that is gone, private or renamed comes back with the fields empty and an `error` message, so one bad entry never breaks the batch.

***

### Pay-per-event pricing

This Actor uses **pay-per-event** billing:

| Event | Price | Charged when |
|---|---|---|
| `repo-analyzed` | $0.10 | Once per GitHub repository analyzed for health, activity, contributors, releases and AI risk assessment. |

The Actor logs its OpenAI token usage and the estimated AI cost at the end of every run, so the event price always stays safely above the model cost.

***

### Setup

The AI layer calls the OpenAI API. Set the environment variable / secret **`OPENAI_API_KEY`** on the Actor. The GitHub token is optional and is supplied via the `githubToken` input (or a `GITHUB_TOKEN` environment variable).

***

### Use it from an AI agent (Apify MCP server)

This Actor is available through the [Apify MCP server](https://mcp.apify.com), so AI agents (Claude, ChatGPT, or anything that speaks MCP) can call it as a tool — hand it a list of repositories and read back the health scorecards — with no custom integration code.

***

### Run it locally

```bash
npm install
## put your input in storage/key_value_stores/default/INPUT.json
export OPENAI_API_KEY=sk-...
export GITHUB_TOKEN=ghp_...   # optional, raises the rate limit
apify run -p
```

***

### A note on data

This Actor only reads **public data exposed by the official GitHub REST API**. It does not scrape, and it respects GitHub's rate limits — supply a token to raise them for larger runs.

### Related actors

- [GitHub Candidate Scorer](https://apify.com/fuze/github-candidate-scorer) — Score GitHub developers against a job description by reading their real repos and code.
- [B2B Tech Stack Detector](https://apify.com/fuze/b2b-tech-stack-detector) — Detect the technologies a company's website is built on, for sales and research.
- [npm Package Intelligence](https://apify.com/fuze/npm-package-intelligence) — Health, popularity and risk signals for any npm package.
- [AI Web Extractor](https://apify.com/fuze/ai-web-extractor) — Turn any URL plus a plain-English prompt into structured JSON.

# Actor input Schema

## `repos` (type: `array`):

GitHub repositories as "owner/repo" or full GitHub URLs. One per line.

## `githubToken` (type: `string`):

Optional GitHub token for higher rate limits. Without it, GitHub allows ~60 requests/hour.

## `maxResults` (type: `integer`):

Max repositories to analyze. One pay-per-event charge per repository analyzed.

## `maxConcurrency` (type: `integer`):

How many repositories to process in parallel.

## `model` (type: `string`):

Override the model (default gpt-4o-mini).

## Actor input object example

```json
{
  "repos": [
    "facebook/react",
    "vercel/next.js"
  ],
  "maxResults": 100,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `repos` (type: `string`):

All analyzed repositories in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "repos": [
        "facebook/react",
        "vercel/next.js"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("noniner/github-repo-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "repos": [
        "facebook/react",
        "vercel/next.js",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("noniner/github-repo-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "repos": [
    "facebook/react",
    "vercel/next.js"
  ]
}' |
apify call noniner/github-repo-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,noniner/github-repo-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/uYuEUX7gdV5ETIrOH/builds/E2Ac3MV0LXNKVVCB3/openapi.json
