# GitHub Repository Scraper - search repos by query (`marekhartmann/github-repo-scraper`) Actor

Search GitHub repositories and get stars, forks, language, license, topics and timestamps. Detects the 403 GitHub sends when the search rate limit is exhausted, so an exhausted limit never looks like zero results.

- **URL**: https://apify.com/marekhartmann/github-repo-scraper.md
- **Developed by:** [Marek Hartmann](https://apify.com/marekhartmann) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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?

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 Scraper

Vyhľadá repozitáre na GitHube a vráti názov, vlastníka, popis, jazyk, témy,
hviezdičky, forky, otvorené issues, licenciu, či je archivovaný, a dátumy.

Bez API kľúča. Vlastný token je nepovinný a len zdvihne limit požiadaviek.

### Čím sa líši: prázdny výsledok nie je faktúra

| čo sa stalo | ako to skončí |
|-------------|---------------|
| GitHub vráti `total_count: 0` | beh **uspeje**, dataset prázdny, v `RUN_REPORT` dôvod. Pri účtovaní za výsledok **neplatíš nič** |
| vyčerpaný limit (HTTP 403) | beh **zlyhá** s vysvetlením, kedy sa limit obnoví |
| odpoveď bez počtu nálezov | beh **zlyhá** — najprv kontrolná otázka na známy dotaz |
| počet je nenulový, ale repozitáre sa nedajú prečítať | beh **zlyhá** |

**Pozor na 403.** GitHub po vyčerpaní limitu nevracia 429, ale **403**. Bežné
spomaľovanie na 429 by ho pustilo ďalej ako obyčajnú odpoveď a parser by z nej
nevytiahol nič — teda presne to tiché zlyhanie, za ktoré si konkurencia dáva
platiť. Tento Actor 403 rozpozná a beh na ňom zlyhá.

**Strop GitHubu sa nezamlčí.** Cez vyhľadávanie vydá GitHub najviac 1000 nálezov
na dotaz, aj keď ich hlási státisíce. Actor to napíše do `RUN_REPORT`, nech to
nevyzerá, že sa niečo stratilo.

### Vstup

| pole | čo to je |
|------|----------|
| `queries` | výrazy vyhľadávania GitHubu (`language:go`, `topic:cli`, `stars:>500`) |
| `maxResultsPerQuery` | strop na jeden dotaz, najviac 1000 |
| `sortBy` | hviezdičky / forky / posledná zmena |
| `githubToken` | nepovinný, zdvihne limit z 10 na 30 vyhľadávaní za minútu |

### Vývoj

```
npm install
npm test                  # 14 testov, bez siete
node scripts/smoke.mjs    # ostrý test proti živému GitHubu
```

Postavené na `Marek-Actor-Kit`.

### Need a scraper for something else?

I build custom Apify Actors and browser automation the same way this one is built:
a verified result or an explicit failure, never an empty dataset sold as a success.

- My other Actors: https://apify.com/marekhartmann
- Code and test suites: https://github.com/marekhartmann-creator

Tell me the site and what you need out of it.

# Actor input Schema

## `queries` (type: `array`):

GitHub search expressions, for example "language:python stars:>1000" or "topic:scraping archived:false". If a query returns nothing, the run does NOT fail and you are not charged for it.

## `maxResultsPerQuery` (type: `integer`):

GitHub search returns at most 1000 results per query. A higher value is capped at 1000 and the run report says so explicitly.

## `sortBy` (type: `string`):

How GitHub should order the results before the cap is applied: best match, stars, forks or recently updated.

## `githubToken` (type: `string`):

Without a token GitHub allows 10 searches per minute, with one 30. The token is never stored; it is used only for this run.

## `proxyConfiguration` (type: `object`):

Apify Proxy configuration. Leave the default unless the source starts rate-limiting your datacenter IP; residential is rarely needed here.

## Actor input object example

```json
{
  "queries": [
    "language:python stars:>10000"
  ],
  "maxResultsPerQuery": 100,
  "sortBy": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per repository: full name, owner, description, stars, forks, open issues, language, license, topics, created and updated dates.

## `runReport` (type: `string`):

Per-query outcome, total\_count as reported by GitHub, remaining rate limit, and whether the 1000-result search cap was hit.

# 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 = {
    "queries": [
        "language:python stars:>10000"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("marekhartmann/github-repo-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 = { "queries": ["language:python stars:>10000"] }

# Run the Actor and wait for it to finish
run = client.actor("marekhartmann/github-repo-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 '{
  "queries": [
    "language:python stars:>10000"
  ]
}' |
apify call marekhartmann/github-repo-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,marekhartmann/github-repo-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/05ZecDZWhflNYFNuC/builds/W1qi5Is98tiLmfrY2/openapi.json
