GitHub Repo Analyzer — Repository Metrics & Health
Pricing
from $0.05 / actor start
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
13 hours ago
Last modified
Categories
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-learningand 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?
| Persona | What They Need | How This Actor Helps |
|---|---|---|
| Open-source maintainer | Track adoption metrics across their own repos and similar projects | Batch-analyze related repos side by side to compare stars, forks, contributor activity |
| Data analyst / researcher | Gather repository metadata for analysis, dashboards, or academic studies | Search by topic and export structured JSON into datasets for further processing |
| Recruiter / talent sourcer | Evaluate a candidate's open-source activity | Single-repo mode returns contributor counts, language, and recent issue activity |
| Developer evaluating dependencies | Assess the health and community of a library before adopting it | Quick access to stars, open issues, license, and last update date |
| Tech blogger / content creator | Gather facts for comparison articles or round-up posts | Search or batch mode collects data for "Top 10 ML repos" style articles |
| Product manager | Benchmark competitor or peer project adoption | Batch-analyze repos from multiple organisations and compare metrics |
| DevOps / platform engineer | Automate repo discovery and monitoring as part of infrastructure tooling | Integrate the actor into a CI pipeline or Apify webhook workflow |
| Open-source researcher | Study patterns in the GitHub ecosystem (languages, licenses, topics) | Topic search with configurable limits provides focused, structured samples |
Why use this?
| Concern | GitHub API (direct) | GitHub Repo Analyzer |
|---|---|---|
| Rate limits | 60 req/hr unauthenticated | Same limit applies, but results are structured and batched to maximise every request |
| Output format | Raw JSON with varying structure per endpoint | Consistent schema across all output rows — every field is always present |
| Multi-repo workflows | Requires manual loops, pagination, and error handling | Batch mode handles concurrency, semaphores, and error isolation automatically |
| Error handling | Raw HTTP errors must be caught and parsed per endpoint | Typed error messages per exception (404, 403, 5xx, timeout, network) |
| README extraction | Separate endpoint, base64 decoding required | Built-in decode and truncation to 500 characters |
| Dataset integration | None | Pushes directly to Apify dataset with every row |
| Cost tracking | N/A | Charge events at startup, per-repo, per-search, and batch completion |
| Contributor counting | Requires pagination via Link header parsing | Automatic 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 charging —
charge_safe()wrapper ensures charging errors never crash the actor. - No Playwright — Zero browser dependencies. The Docker image stays lean (
apify/actor-python:3.13base). - 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 forapify-actor-start,repo-analysis,search-execute, andbatch-report.
Input Parameters
| Field | Type | Required | Description |
|---|---|---|---|
mode | string (enum) | Yes | single, batch, or search |
repo | string | If mode=single | Repository URL or owner/name |
repos | array of strings | If mode=batch | List of repo identifiers (max 10) |
topic | string | If mode=search | Keyword to search repositories by topic |
limit | integer | No | Max results for search mode (1–20, default 10) |
Accepted Repository Identifier Formats
owner/name— e.g.example/example-repohttps://github.com/owner/namehttp://github.com/owner/namegithub.com/owner/name- All of the above with trailing
.git
Output Format
Each row in the default dataset contains the following fields:
| Field | Type | Description |
|---|---|---|
repo_name | string | Repository identifier in owner/name format |
stars | number | Stargazers count |
forks | number | Forks count |
language | string | Primary programming language detected by GitHub |
topics | array of strings | Topic tags associated with the repo |
license | string | SPDX license identifier or key |
description | string | Repository description text |
open_issues | number | Number of open issues |
contributors | number | Approximate total contributors |
created_at | string | ISO 8601 creation timestamp |
updated_at | string | ISO 8601 last-update timestamp |
readme_preview | string | First ~500 characters of decoded README content |
error | string | Error 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
limitfield, 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 theLinkheader of the issues endpoint, falling back toopen_issues_countfrom the repo API.contributors: approximate total number of unique committers. Calculated from theLinkheader 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.
Related Tools
-
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 ApifyClientclient = 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().itemsfor 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