GitHub Repo Analyzer — Repository Metrics & Health avatar

GitHub Repo Analyzer — Repository Metrics & Health

Pricing

from $0.05 / actor start

Go to Apify Store
GitHub Repo Analyzer — Repository Metrics & Health

GitHub Repo Analyzer — Repository Metrics & Health

Extract comprehensive repository metrics from public GitHub repos. Supports single-repo lookup, batch analysis (up to 10 repos), and topic/keyword search. Returns stars, forks, language, topics, license, contributors, open issues, README preview, and timestamps. No authentication required.

Pricing

from $0.05 / actor start

Rating

0.0

(0)

Developer

Perry AY

Perry AY

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

13 hours ago

Last modified

Share

GitHub Repo Analyzer — Extract Repository Metrics and Analysis Data

Analyze public GitHub repositories without authentication. Get stars, forks, primary language, topics, license, contributor counts, open issue counts, and README previews — all from one clean output. Supports single repositories, batch lists of up to 10, and topic-based keyword search.

Built with async HTTPX and the plain Apify SDK. No Playwright, no browser automation, no authentication secrets to manage. Just point it at a GitHub URL (or a list of them) and the actor returns structured data for every repository it finds.


What does it do?

GitHub Repo Analyzer is a lightweight Apify actor that reads the public GitHub REST API and returns a consistent, structured dataset of repository metrics. It handles three common workflows:

  • Single repo — paste one URL and get a full breakdown.
  • Batch list — provide up to 10 repos and get them all back in one run, fetched concurrently for speed.
  • Topic search — give it a keyword like machine-learning and it finds the top starred repos in that topic, then fetches detailed metrics for each.

The actor is designed for developers, data analysts, researchers, and anyone who needs to inventory or compare GitHub repositories programmatically.


Who is it for?

PersonaWhat They NeedHow This Actor Helps
Open-source maintainerTrack adoption metrics across their own repos and similar projectsBatch-analyze related repos side by side to compare stars, forks, contributor activity
Data analyst / researcherGather repository metadata for analysis, dashboards, or academic studiesSearch by topic and export structured JSON into datasets for further processing
Recruiter / talent sourcerEvaluate a candidate's open-source activitySingle-repo mode returns contributor counts, language, and recent issue activity
Developer evaluating dependenciesAssess the health and community of a library before adopting itQuick access to stars, open issues, license, and last update date
Tech blogger / content creatorGather facts for comparison articles or round-up postsSearch or batch mode collects data for "Top 10 ML repos" style articles
Product managerBenchmark competitor or peer project adoptionBatch-analyze repos from multiple organisations and compare metrics
DevOps / platform engineerAutomate repo discovery and monitoring as part of infrastructure toolingIntegrate the actor into a CI pipeline or Apify webhook workflow
Open-source researcherStudy patterns in the GitHub ecosystem (languages, licenses, topics)Topic search with configurable limits provides focused, structured samples

Why use this?

ConcernGitHub API (direct)GitHub Repo Analyzer
Rate limits60 req/hr unauthenticatedSame limit applies, but results are structured and batched to maximise every request
Output formatRaw JSON with varying structure per endpointConsistent schema across all output rows — every field is always present
Multi-repo workflowsRequires manual loops, pagination, and error handlingBatch mode handles concurrency, semaphores, and error isolation automatically
Error handlingRaw HTTP errors must be caught and parsed per endpointTyped error messages per exception (404, 403, 5xx, timeout, network)
README extractionSeparate endpoint, base64 decoding requiredBuilt-in decode and truncation to 500 characters
Dataset integrationNonePushes directly to Apify dataset with every row
Cost trackingN/ACharge events at startup, per-repo, per-search, and batch completion
Contributor countingRequires pagination via Link header parsingAutomatic last-page detection from Link header

Features

  • Three analysis modes — Single, Batch (up to 10), Search by topic
  • Async concurrent fetching — Semaphore-limited parallel requests in batch mode (max 3 concurrent) for good throughput without hammering rate limits
  • Structured output — Every row contains: repo name, stars, forks, language, topics list, license, description, open issues, contributors, created/updated timestamps, README preview, and error field
  • No authentication required — Uses the public GitHub REST API v3 with no token needed. Ready to run with zero configuration.
  • Graceful error isolation — A failed repo never blocks the rest. Errors are recorded per row with descriptive messages (rate limited, not found, network error, server error, parse error).
  • Input validation — Mode checks, URL parsing, array length limits, and integer bounds run before any API call.
  • Safe chargingcharge_safe() wrapper ensures charging errors never crash the actor.
  • No Playwright — Zero browser dependencies. The Docker image stays lean (apify/actor-python:3.13 base).
  • Event hooks — Push events fire at meaningful lifecycle points: apify-actor-start, apify-default-dataset-item (per row), batch-analysis (batch/search summary). Charge events fire for apify-actor-start, repo-analysis, search-execute, and batch-report.

Input Parameters

FieldTypeRequiredDescription
modestring (enum)Yessingle, batch, or search
repostringIf mode=singleRepository URL or owner/name
reposarray of stringsIf mode=batchList of repo identifiers (max 10)
topicstringIf mode=searchKeyword to search repositories by topic
limitintegerNoMax results for search mode (1–20, default 10)

Accepted Repository Identifier Formats

  • owner/name — e.g. example/example-repo
  • https://github.com/owner/name
  • http://github.com/owner/name
  • github.com/owner/name
  • All of the above with trailing .git

Output Format

Each row in the default dataset contains the following fields:

FieldTypeDescription
repo_namestringRepository identifier in owner/name format
starsnumberStargazers count
forksnumberForks count
languagestringPrimary programming language detected by GitHub
topicsarray of stringsTopic tags associated with the repo
licensestringSPDX license identifier or key
descriptionstringRepository description text
open_issuesnumberNumber of open issues
contributorsnumberApproximate total contributors
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last-update timestamp
readme_previewstringFirst ~500 characters of decoded README content
errorstringError message if data could not be fetched (empty on success)

Example Input

Example 1 — Single Repository

Input:

{
"mode": "single",
"repo": "https://github.com/example/example-repo"
}

Output row:

{
"repo_name": "example/example-repo",
"stars": 42,
"forks": 12,
"language": "Python",
"topics": ["data-science", "example"],
"license": "MIT",
"description": "An example repository for demonstration purposes.",
"open_issues": 5,
"contributors": 10,
"created_at": "2020-01-15T10:30:00Z",
"updated_at": "2024-06-01T14:22:00Z",
"readme_preview": "# Example Repository\n\nThis is an example...",
"error": ""
}

Example 2 — Batch Mode (3 Repositories)

Input:

{
"mode": "batch",
"repos": [
"https://github.com/example/example-repo",
"https://github.com/example/another-repo",
"example/third-repo"
]
}

Output — three rows in the dataset, one per repository. Each row follows the same schema as Example 1. Repos are fetched concurrently (up to 3 at a time) so total runtime is approximately the slowest single request plus overhead.

Example 3 — Topic Search

Input:

{
"mode": "search",
"topic": "machine-learning",
"limit": 5
}

Output — up to 5 rows, each representing a repository matched by the topic search, sorted by stars descending. Each row contains the full schema including README preview and contributor counts.

Example 4 — Repository Not Found (Graceful Error)

Input:

{
"mode": "single",
"repo": "example/nonexistent-repo-xyz"
}

Output row:

{
"repo_name": "example/nonexistent-repo-xyz",
"stars": 0,
"forks": 0,
"language": "",
"topics": [],
"license": "",
"description": "",
"open_issues": 0,
"contributors": 0,
"created_at": "",
"updated_at": "",
"readme_preview": "",
"error": "Repository 'example/nonexistent-repo-xyz' not found on GitHub."
}

Example 5 — Invalid Input

Input:

{
"mode": "single",
"repo": ""
}

Outcome: The actor fails immediately with status_message set to "Mode 'single' requires a 'repo' value (owner/name or full URL)." No dataset rows are written.

Example 6 — Search with Rate Limit

If the GitHub API returns a 403 with X-RateLimit-Remaining: 0, the actor produces a single error row:

{
"repo_name": "search:machine-learning",
"error": "Search rate limited (remaining: 0).",
...
}

Use Cases

1. Open-Source Portfolio Auditing

Maintainers can batch-analyze all their organisation's public repos to track star growth, fork activity, and contributor trends over time. Export the dataset into a spreadsheet or dashboard for quarterly reviews.

2. Dependency Health Checks

Before adding a library to a project, run the actor against its repository to check: stars (community confidence), open issues / contributors ratio (maintenance activity), last update date (abandonment risk), and license (compatibility with your project).

3. Competitive Landscape Research

Gather data on 10 competitor or peer project repositories in a single run. Compare stars, language choice, topic tags, and contributor communities side by side to understand market positioning.

4. Topic-Based Discovery

Use search mode with keywords like static-site-generator, database-driver, or ci-cd to discover the most-starred projects in any category. The actor fetches full metadata for each, making it easy to evaluate options without opening GitHub tabs.

5. Academic Research on Open Source

Researchers studying the GitHub ecosystem can use topic search to collect structured samples of repositories by topic, language, or other characteristics. The consistent output schema simplifies statistical analysis and avoids per-endpoint parsing.

6. Recruitment and Candidate Assessment

When evaluating a candidate's GitHub activity, run the actor against their repositories to see contributor counts, primary languages, and recent update activity. Get an objective snapshot without manual browsing.

7. Content and Blog Post Research

Tech writers preparing comparison articles or "Top N" lists can search by topic and get structured data on the top repositories — stars, license, description — all in one export. No manual data entry required.

8. Infrastructure Automation

DevOps teams can trigger the actor via Apify webhooks or API calls as part of a CI/CD pipeline. Repository metrics become data points in monitoring dashboards, Slack alerts, or automated reports.


FAQ

1. Do I need a GitHub token or authentication?

No. The actor uses the unauthenticated GitHub REST API v3. Without a token you are limited to 60 requests per hour. If you need higher limits, modify the headers dict in main.py to include an Authorization header with a personal access token.

2. What happens if one repository in a batch fails?

It is isolated. The repository gets a row with an error field describing the failure. The other repositories complete normally.

3. How many repositories can I analyze in one run?

  • Batch mode: up to 10.
  • Search mode: up to 20 (configurable via the limit field, default 10).
  • Single mode: 1.

4. Does the actor handle paginated results (e.g. all contributors)?

The actor reads contributor and issue header pagination by parsing the Link header to find the last page number. This gives an approximate total without fetching every page. For most repos this is accurate to within a few units.

5. What does the README preview include?

The actor fetches the repository's README via the GitHub API, base64-decodes the content, and truncates it to approximately 500 characters. If the repo has no README or the request fails, the field is an empty string.

6. Does this actor work with private repositories?

No. The actor uses the public GitHub REST API without authentication, so it can only read public repositories.

7. What happens when the rate limit is hit?

The actor detects a 403 response with X-RateLimit-Remaining: 0 and returns an informative error row. No dataset is corrupted; you can retry once the rate limit resets (typically one hour).

8. Can I run this actor locally with Apify CLI?

Yes. Clone the actor directory, run apify run in the project root. Make sure you have Python 3.13+ and the dependencies from requirements.txt installed.

9. What's the difference between open_issues and contributors?

  • open_issues: number of currently open GitHub issues on the repo. Calculated from the Link header of the issues endpoint, falling back to open_issues_count from the repo API.
  • contributors: approximate total number of unique committers. Calculated from the Link header of the contributors endpoint.

Both are approximations when the count exceeds the first page (30 items).

10. Are there plans to add more modes (e.g. user repos, organisation repos)?

The current architecture makes it straightforward to add new fetch modes by extending the mode enum and adding a fetch function. Community contributions and feature requests are welcome.


  • Website Tech Stack Detector — Detect the technology stack used by any website. Complementary to repository analysis: use the Tech Stack Detector to identify tools and frameworks on live sites, then use Repo Analyzer to examine their source repositories.

  • Article to Markdown Converter — Convert web articles and blog posts to clean Markdown. Use alongside Repo Analyzer to capture technical blog content about repositories you discover, or to convert README content into formatted documentation.


API Usage

Via cURL

curl -X POST "https://api.apify.com/v2/acts/perryay~github-repo-analyzer/runs" \
-H "Content-Type: application/json" \
-d '{
"mode": "single",
"repo": "https://github.com/example/example-repo"
}'

Via Python (Apify Client)

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("perryay/github-repo-analyzer").call(
run_input={
"mode": "single",
"repo": "https://github.com/example/example-repo",
}
)
dataset_items = client.dataset(run["defaultDatasetId"]).list_items().items
for item in dataset_items:
print(f"{item['repo_name']}: {item['stars']} stars, {item['language']}")

Via JavaScript (Apify Client)

const ApifyClient = require('apify-client').ApifyClient;
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('perryay/github-repo-analyzer').call({
mode: 'single',
repo: 'https://github.com/example/example-repo',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => console.log(`${item.repo_name}: ${item.stars} stars`));

MCP Integration

Add this actor to your MCP (Model Context Protocol) server configuration:

{
"mcpServers": {
"apify-github-analyzer": {
"command": "npx",
"args": [
"-y",
"@apify/mcp-server-actors",
"--actors=perryay/github-repo-analyzer"
]
}
}
}

This enables AI assistants to analyze GitHub repositories through your MCP client.


SEO Keywords

GitHub repo analyzer, repository metrics, GitHub stars tracker, open source analytics, repository health check, GitHub API scraper, repo analysis tool, batch repo analyzer, GitHub topic search, repository metadata extraction, open source project analysis, developer analytics tool