# 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](https://apify.com/ahmdshrif) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 4 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/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 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
}
```

# Actor output Schema

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

One structured record per input URL.

# 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/324qQskuwkfhqVWbI/openapi.json
