# GitHub Repository Analyzer - Security & Maintenance Scorer (`ntriqpro/github-repo-intelligence`) Actor

Score any open-source GitHub repository before you depend on it: security posture, maintainership health, dependency risk and license compliance, combined into a single rating. Built for OSS due diligence in enterprise adoption reviews and VC technical diligence.

- **URL**: https://apify.com/ntriqpro/github-repo-intelligence.md
- **Developed by:** [Daniel Carter](https://apify.com/ntriqpro) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $26.00 / 1,000 github repository analyses

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Repository Intelligence

Analyze a GitHub repository's maintenance activity and a sample of its direct npm dependencies. Results include measured counts, heuristic scores, and explicit coverage warnings. Unavailable measurements and scores are `null`, never a claim of zero risk.

| Plan | Output per run | Dependency sample |
|---|---|---|
| Free | One repository analysis | Up to 20 direct npm dependencies |
| Paid | One repository analysis | Up to 20 direct npm dependencies |

Each run accepts one repository. The 25-row free-plan cap does not truncate this single-row result.

### What It Does

1. **GitHub REST API** — Repository stars, last push age, open issues and license.
2. **Default-branch package.json** — Reads the root manifest and combines production and development dependencies. A missing manifest is reported separately from a failed request. Nested workspaces and transitive dependencies are not scanned.
3. **npm Registry** — Counts a dependency as outdated when a newer `latest` release is outside its declared semver range. A range such as `^2.0.0` is not outdated merely because it differs from `2.4.1` as text.
4. **OSV** — Queries each sampled dependency at its exact declared version or the minimum version of its semver range, follows batch pagination, deduplicates advisory IDs, and reads advisory details for severity.

**Version scope:** `vulnerability_version_basis: "manifest_minimum"` describes a manifest-based estimate, not the installed version or a lockfile audit. A minimum allowed version can differ from the version you deploy. Unsupported specifications (including workspace, file, git, aliases and wildcard `*`) are reported as unresolved. OSV counts are advisory IDs, not necessarily unique CVEs.

**Coverage:** The first 20 dependencies are sampled in manifest order (production first, then development). The result reports the full count, sample count and successful lookups. Scores describe this sample, not a full repository audit. OSV pagination is bounded at 10 pages and severity details at 100 advisory IDs per run. If a limit or source failure prevents a measurement, that measurement stays unknown. Unrecognized severity (including records exposing only a CVSS vector) is not treated as LOW or zero.

### Scoring

The overall score starts at 100 and deducts:

- Commit age: `(last_commit_days / 30) × 5`, capped at 30 points.
- Outdated packages: 3 points each, capped at 30.
- Critical advisories: 15 points each; high advisories: 8 points each.
- More than 50 open issues: 10 points.

Security and maintenance scores use the same measured inputs with different weights. All scores are clamped to 0–100. A score is `null` when any input required for that score is unknown. A metadata-only result with no root manifest has no dependency-based scores. An empty, successfully read manifest can have measured zero dependencies.

### Input

| Parameter | Type | Required | Description |
|---|---|---|---|
| `repoUrl` | string | Yes | Full GitHub repository URL; `.git`, a trailing slash and query parameters are accepted |
| `githubToken` | string | No | Optional customer GitHub token sent only to GitHub requests |

```json
{
  "repoUrl": "https://github.com/apify/apify-sdk-js"
}
```

### Output

| Field | Meaning |
|---|---|
| `repo_url`, `repo_name` | Submitted URL and normalized owner/repo |
| `stars`, `last_commit_days`, `open_issues_count`, `license` | Repository metadata; null on an unavailable-analysis notice |
| `outdated_packages_count` | Sampled ranges excluding a newer latest release; null on incomplete npm checks |
| `total_vulns` | Unique OSV advisory IDs at the sampled manifest minimum versions; null on incomplete queries |
| `critical_vulns`, `high_vulns` | Counts from advisory severity; null when any sampled severity or version is unresolved |
| `unknown_severity_count` | IDs with missing or unrecognized severity; null when the query could not be completed |
| `security_score`, `maintenance_score`, `overall_score` | Heuristic 0–100 scores, or null when required inputs are unavailable |
| `analysis_status` | `complete`, `partial`, `not_applicable` (no root manifest), or `unavailable` (notice) |
| `manifest_status`, `npm_status`, `osv_status` | Source coverage, present on repository result rows |
| `dependency_count`, `dependencies_sampled`, `dependency_sample_limited` | Full direct dependency count, selected count, and whether the 20-package limit applies |
| `packages_checked`, `vulnerability_packages_checked` | Successful npm and completed OSV package queries |
| `vulnerability_version_basis` | `manifest_minimum`; no installed-version claim |
| `warnings` | Array explaining missing data, unresolved versions or sample limits |
| `notice`, `error` | Present on an unavailable-analysis status row |
| `disclaimer`, `timestamp` | Usage disclaimer and ISO timestamp |

Repository metadata is retained when a dependency source fails. A partial result remains a repository analysis; inspect its warnings before using its scores.

### Pricing and Errors

- **$0.05 per delivered repository analysis**, using the existing `repo-analyzed` event. Partial and metadata-only repository results are included.
- If the repository itself cannot be analyzed or the input is invalid, the Actor returns an `analysis-unavailable` notice with null measurements and no analysis event. A notice is not a repository result.
- Free-plan and paid-plan runs use the same one-repository input and sample. Platform credits and actual charges are determined by Apify; local tests do not prove a billable platform event.
- Storage or billing failures surface as execution failures instead of appending a second, contradictory result row.

### Local Reproduction

Run these commands from this Actor directory:

```bash
npm install --ignore-scripts --no-audit --no-fund
npm test
npm run check
```

For a real API run, create `$AGENT_TMPDIR/github-repo-prefill/key_value_stores/default/INPUT.json` containing the example input, then run:

```bash
env -u APIFY_IS_AT_HOME -u APIFY_TOKEN APIFY_USER_IS_PAYING=1 CRAWLEE_STORAGE_DIR="$AGENT_TMPDIR/github-repo-prefill" npm start
```

Read the result in `$AGENT_TMPDIR/github-repo-prefill/datasets/default/`. Use a separate storage directory and `APIFY_USER_IS_PAYING=0` to exercise the free-plan path. An empty input object returns a notice. Never assert fixed advisory counts for a live repository: manifests, releases and advisories change.

### Limitations and Responsibility

This Actor aggregates publicly available GitHub, npm and OSV data. It is not affiliated with or endorsed by those services. Results are informational, not professional security advice or a guarantee of safety. Customers are responsible for their input permissions and lawful use of the results. Data is stored in the run's Apify dataset. Review the coverage fields and perform an installed-dependency audit before production decisions.

### See Also

- [OSV Database](https://osv.dev/) — Open Source Vulnerabilities
- [GitHub REST API](https://docs.github.com/en/rest) — Repository metadata
- [npm Registry](https://registry.npmjs.org/) — Package information
- [Apify Platform](https://apify.com/) — Serverless Actor ecosystem

***

**Built by NtriqPRO** | Version 1.0 | MIT License

***

### 🔗 Related Actors by ntriqpro

Build your data pipeline with the ntriqpro Actor suite:

- [**maigret-actor**](https://apify.com/ntriqpro/maigret-actor) — Maigret OSINT — Username search across 3000+ sites
- [**website-tech-detector**](https://apify.com/ntriqpro/website-tech-detector) — Website Tech Stack Scanner
- [**code-review-intelligence-mcp**](https://apify.com/ntriqpro/code-review-intelligence-mcp) — AI Code Reviewer for PR diffs

### ⭐ Love it? Leave a Review

Your rating helps professionals discover this actor. [Rate it here](https://apify.com/ntriqpro/github-repo-intelligence/reviews).

# Actor input Schema

## `repoUrl` (type: `string`):

Full GitHub repository URL, with optional .git suffix. Metadata and dependency coverage are returned even when a source is unavailable; unknown counts and dependent scores are null. One delivered repository analysis is one repo-analyzed event.

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

Increases API rate limit from 60 to 5000 requests/hour. Leave empty for anonymous access.

## Actor input object example

```json
{
  "repoUrl": "https://github.com/apify/apify-sdk-js"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "repoUrl": "https://github.com/apify/apify-sdk-js"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ntriqpro/github-repo-intelligence").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 = { "repoUrl": "https://github.com/apify/apify-sdk-js" }

# Run the Actor and wait for it to finish
run = client.actor("ntriqpro/github-repo-intelligence").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 '{
  "repoUrl": "https://github.com/apify/apify-sdk-js"
}' |
apify call ntriqpro/github-repo-intelligence --silent --output-dataset

```

## MCP server setup

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

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/9esSBGd2mEOKDClud/builds/CvMjPbxvLhetUDGge/openapi.json
