# GitHub Repository Details Scraper (`ahmdshrif/github-repo-details-scraper`) Actor

Extracts full stats and metadata — stars, forks, watchers, language, license, topics, and last commit date — from any GitHub repository page URL.

- **URL**: https://apify.com/ahmdshrif/github-repo-details-scraper.md
- **Developed by:** [Ahmed Ashraf](https://apify.com/ahmdshrif) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$2.00 / 1,000 repository scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## GitHub Repository Details Scraper

Extracts full stats and metadata — stars, forks, watchers, open issues, primary language, topics, license, default branch, creation date, last commit date, archived status, and homepage URL — from any GitHub repository page URL. Built for developers, researchers, and agents who need per-repo metadata (license, topics, archived status, last commit) for a specific list of repos rather than a snapshot of the trending page.

### Why this scraper

- Takes arbitrary repo URLs as input, so you can pull full metadata for exactly the repos you care about — not just whatever happens to be trending that day.
- Returns license, topics, default branch, archived status, and last commit date alongside stars/forks — fields that a name/stars/forks listing scrape doesn't surface.
- Priced per repo scraped, so a run of 3 repos costs the same per-unit as a run of 3,000 — you don't pay a flat per-run fee regardless of how much you actually get back.

### Output fields

| Field | Type | Description |
|---|---|---|
| repoUrl | string | Canonical URL of the repository page |
| owner | string | GitHub username or org that owns the repo |
| repoName | string | Repository name |
| description | string | Short repo description shown at the top of the page |
| stars | integer | Total star count |
| forks | integer | Total fork count |
| watchers | integer | Total watcher count |
| openIssues | integer | Number of open issues |
| primaryLanguage | string | Dominant programming language of the repo |
| topics | string | Comma-separated list of repo topic tags |
| license | string | License name, e.g. 'Apache-2.0' |
| defaultBranch | string | Name of the default branch |
| createdAt | string | ISO date the repository was created |
| lastCommitDate | string | ISO date of the most recent commit on the default branch |
| isArchived | boolean | Whether the repository is archived |
| homepageUrl | string | External homepage/project URL listed on the repo, if any |

### Input

```json
{
  "startUrls": [
    { "url": "https://github.com/psf/requests" }
  ],
  "maxItems": 50
}
```

`startUrls` is a list of repo page URLs to scrape. `maxItems` caps how many will be processed in a single run.

### Output

```json
{
  "repoUrl": "https://github.com/psf/requests",
  "owner": "psf",
  "repoName": "requests",
  "description": "A simple, yet elegant, HTTP library. Contribute to psf/requests development by creating an account on GitHub.",
  "stars": 54262,
  "forks": 10078,
  "watchers": null,
  "openIssues": 147,
  "primaryLanguage": "",
  "topics": "",
  "license": "LICENSE",
  "defaultBranch": "main",
  "createdAt": "2011-02-13T18:38:17.000Z",
  "lastCommitDate": "",
  "isArchived": false,
  "homepageUrl": "https://requests.readthedocs.io/en/latest/"
}
```

### Pricing

Pay $0.002 per repository successfully scraped. A run of 50 repos costs $0.10; scraping a list of 500 repos costs $1.00. There is no separate per-run or per-start charge — you pay only for repos actually returned.

### Use cases

- Tracking a fixed watchlist of dependency repos (e.g. everything in a `requirements.txt` or `package.json`) for license changes or archival status before a release.
- Building a comparison table of stars, forks, and last commit date across a shortlist of candidate open-source libraries during a vendor evaluation.
- Feeding repo metadata (license, topics, primary language) into an internal catalog or agent tool that needs structured facts about specific GitHub projects.

# Actor input Schema

## `startUrls` (type: `array`):

Pages to export.

## `maxItems` (type: `integer`):

Stop after this many records.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://github.com/psf/requests"
    },
    {
      "url": "https://github.com/rails/rails"
    },
    {
      "url": "https://github.com/tensorflow/tensorflow"
    }
  ],
  "maxItems": 5
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://github.com/psf/requests"
        },
        {
            "url": "https://github.com/rails/rails"
        },
        {
            "url": "https://github.com/tensorflow/tensorflow"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmdshrif/github-repo-details-scraper").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 = { "startUrls": [
        { "url": "https://github.com/psf/requests" },
        { "url": "https://github.com/rails/rails" },
        { "url": "https://github.com/tensorflow/tensorflow" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ahmdshrif/github-repo-details-scraper").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 '{
  "startUrls": [
    {
      "url": "https://github.com/psf/requests"
    },
    {
      "url": "https://github.com/rails/rails"
    },
    {
      "url": "https://github.com/tensorflow/tensorflow"
    }
  ]
}' |
apify call ahmdshrif/github-repo-details-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/NKi8gZnJfVBW5LgEa/builds/MwU7fhmTdvtB0mj1f/openapi.json
