# GitHub Repo Search - Structured Repository Search API (`cuantic_data/github-repo-search`) Actor

Searches GitHub repositories using GitHub's own search syntax (stars, language, topic, pushed date...) and returns clean structured JSON: stars, forks, license, last activity. Great for market research, tech due diligence or feeding an AI agent.

- **URL**: https://apify.com/cuantic\_data/github-repo-search.md
- **Developed by:** [Cuantic Data](https://apify.com/cuantic_data) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Repo Search — Structured Repository Search API

Searches GitHub repositories using GitHub's own search syntax and returns
clean, structured results: stars, forks, license, last activity.

### What it does

- Uses the same search syntax as `github.com/search` (e.g.
  `language:python stars:>500 pushed:>2026-01-01`).
- Automatically paginates up to the requested `maxItems` (or the 1000-result
  ceiling imposed by GitHub's own API).
- If GitHub's rate limit is hit mid-search, the run stops there and returns
  what it already collected — it doesn't fail the whole run.

### Who it's for

- Technical market research ("how many active projects exist in this
  category?").
- Quick due diligence on an open-source ecosystem.
- AI agents that need to discover relevant repositories by criteria.

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | GitHub search syntax. |
| `maxItems` | integer | No (default 30) | Between 1 and 1000. |
| `sort` | string | No | `stars`, `forks`, `help-wanted-issues`, `updated`. Empty = best match. |
| `order` | string | No | `desc` or `asc`. |
| `githubToken` | string (secret) | No | Your own read-only Personal Access Token, to raise the limit from 60 to 5000 searches/hour. |

```json
{ "query": "language:javascript stars:>1000", "maxItems": 50, "sort": "stars", "order": "desc" }
```

### Output

```json
{
  "fullName": "vercel/next.js",
  "url": "https://github.com/vercel/next.js",
  "description": "The React Framework",
  "stars": 128000,
  "forks": 27000,
  "language": "JavaScript",
  "openIssues": 3200,
  "updatedAt": "2026-09-18T10:00:00Z",
  "createdAt": "2016-10-05T00:00:00Z",
  "license": "MIT",
  "archived": false
}
```

### Pricing

Pay-per-event, provisional. Starting reference: USD 2.00 per 1,000 repos
returned (`03-plan.md` §2).

### How to call it

```bash
curl "https://api.apify.com/v2/acts/cuantic-data~github-repo-search/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "language:python stars:>500", "maxItems": 100}'
```

### Terms and limits

See [`TERMS.md`](./TERMS.md): a public, documented GitHub API. Without a
token: 60 searches/hour, shared across all users of the Actor. With your own
token (optional, `githubToken` field): 5000/hour, your own quota.

### FAQ

**Why does my run return fewer results than I asked for?**
Either GitHub has fewer than `maxItems` results for your query, or the
shared rate limit was hit partway through (check the run's `RUN-SUMMARY`
for details). If you search often, use your own `githubToken`.

**Found a bug?**
Email `cuanticwindows@gmail.com` — we reply within 72 hours.

***

See `build/README.md` for how to run tests and publish this Actor.

# Actor input Schema

## `query` (type: `string`):

GitHub search syntax.

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

GitHub's search API never returns more than 1000 results per search, no matter how many there are in total.

## `sort` (type: `string`):

Empty = best match (GitHub's default).

## `order` (type: `string`):

Sort direction: descending (highest first) or ascending (lowest first). Ignored when sorting by best match.

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

Optional. Without a token: 60 searches/hour shared. With your own Personal Access Token (no special scopes needed, public read-only): 5000/hour. The token is never stored or shared, it's only used within this run.

## Actor input object example

```json
{
  "query": "language:javascript stars:>1000",
  "maxItems": 30
}
```

# Actor output Schema

## `repositories` (type: `string`):

One row per repository matching the search query.

## `runSummary` (type: `string`):

The search query, how many repositories GitHub reports as available in total, how many were collected, and any rate-limit errors.

# 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 = {
    "query": "language:javascript stars:>1000"
};

// Run the Actor and wait for it to finish
const run = await client.actor("cuantic_data/github-repo-search").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 = { "query": "language:javascript stars:>1000" }

# Run the Actor and wait for it to finish
run = client.actor("cuantic_data/github-repo-search").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 '{
  "query": "language:javascript stars:>1000"
}' |
apify call cuantic_data/github-repo-search --silent --output-dataset

```

## MCP server setup

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

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/mwpyYoHTJf2LU5azW/builds/fhMZ9RaISkCnWPpbz/openapi.json
