# Github Topic Repositories Scraper (`fresh_cliff/github-topic-repositories-scraper`) Actor

Extract trending GitHub repositories by topic with name, owner, stars, description, language, URLs.  Filter language or minimum stars. Monitor developer trends, discover popular projects, analyze tech stacks. Export to JSON/CSV for research, dashboards, competitive analysis. Fast Playwright scraper.

- **URL**: https://apify.com/fresh\_cliff/github-topic-repositories-scraper.md
- **Developed by:** [Brennan Crawford](https://apify.com/fresh_cliff) (community)
- **Categories:** Other, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$14.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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 Topics Scraper – Export Repositories by Topic

Extract repositories from GitHub topic pages. Export JSON/CSV for analysis, research, or monitoring.

### Features

- Collects repository name, owner, description, primary language, stars, forks, last updated, URLs
- Filters by language and minimum stars
- Playwright + async `Actor` implementation

### Input

- `topicSlug` (required): e.g., `machine-learning`
- `language` (optional): e.g., `Python`
- `minStars` (optional): integer
- `maxPages` (default 1): 1–5
- `userAgent` (optional)
- `maxConcurrency` (default 5)
- `timeoutSec` (default 30)

### Output

Each dataset item:

```json
{
  "name": "scikit-learn",
  "owner": "scikit-learn",
  "repoUrl": "https://github.com/scikit-learn/scikit-learn",
  "topicUrl": "https://github.com/topics/machine-learning?o=desc&s=stars&p=1",
  "description": "Machine learning in Python",
  "language": "Python",
  "stars": 56000,
  "forks": 25000,
  "lastUpdated": "2025-01-01T00:00:00Z"
}
```

### Local Testing

1. `pip install -r requirements.txt`
2. `python apify_actor.py` with an `INPUT.json` or by setting environment input via Apify CLI.
3. Verify output in the default dataset directory.

### Deployment

See `DEPLOY.md` for Apify deployment steps.

# Actor input Schema

## `topicSlug` (type: `string`):

GitHub topic slug, e.g., machine-learning

## `language` (type: `string`):

Optional language filter (e.g., Python). Leave blank for all.

## `minStars` (type: `integer`):

Only include repositories with at least this many stars.

## `maxPages` (type: `integer`):

Number of pages to fetch (each page ~30 repos).

## `userAgent` (type: `string`):

Optional User-Agent override for requests.

## `maxConcurrency` (type: `integer`):

Concurrency for page navigation.

## `timeoutSec` (type: `integer`):

Per-page timeout in seconds.

## Actor input object example

```json
{
  "minStars": 0,
  "maxPages": 1,
  "maxConcurrency": 5,
  "timeoutSec": 30
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("fresh_cliff/github-topic-repositories-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("fresh_cliff/github-topic-repositories-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call fresh_cliff/github-topic-repositories-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fresh_cliff/github-topic-repositories-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dOhkN15coSJbAmlfB/builds/8D85dRfWceZsthBco/openapi.json
