# GitHub Repository Search, Details and Trending (Approximation) (`tan-solutions/github-repos`) Actor

Search GitHub repositories by keyword, language, stars, topics and dates, get repository details (stars, forks, issues, license, topics, languages, releases) and a trending approximation, from the official GitHub REST API with your own token. Clean rows, no personal data. Not affiliated with GitHub.

- **URL**: https://apify.com/tan-solutions/github-repos.md
- **Developed by:** [Tan Solutions](https://apify.com/tan-solutions) (community)
- **Categories:** Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 repository delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Search, Details and Trending (Approximation)

Search GitHub repositories by keyword, language, stars, topics and dates, or get the details of repositories you
already know. You get one clean row per repository: stars, forks, open issues, license, topics, languages, release
count and dates. The data comes from the official GitHub REST API, called with **your own GitHub token**.

Not affiliated with GitHub: this Actor is not affiliated with, endorsed by or sponsored by GitHub, Inc.

### Run it from the API or on a schedule

Get the repositories back in one call (replace the two placeholders with your Apify token and your GitHub token):

```bash
curl -X POST "https://api.apify.com/v2/acts/tan-solutions~github-repos/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"githubToken": "<YOUR_GITHUB_TOKEN>", "mode": "search", "query": "web scraping", "language": "Python", "minStars": 100, "maxResults": 100}'
```

Get the weekly trending approximation every Monday at 07:00 UTC with an Apify schedule. First save your input (with
your GitHub token, mode `trending`, period `weekly`) as a task in Apify Console, so the token is stored encrypted, then
schedule that task (its ID is on the task page):

```bash
curl -X POST "https://api.apify.com/v2/schedules?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name": "github-trending-weekly", "cronExpression": "0 7 * * 1", "timezone": "UTC", "isEnabled": true, "isExclusive": true,
       "actions": [{"type": "RUN_ACTOR_TASK", "actorTaskId": "<YOUR_TASK_ID>"}]}'
```

In Apify Console the same is: **Schedules**, **Create new**, cron `0 7 * * 1`, add your task.

### What it does

- **Search:** repositories that match your keywords and filters (language, topics, minimum and maximum stars,
  created and last-push dates, forks and archived on or off), sorted by stars, forks, last update or best match.
- **Repository details:** paste `owner/repo` names (such as `apify/crawlee`) or repository links and get one row
  for each, with the language breakdown and the number of releases.
- **Trending (approximation):** new repositories created in the last day, 7 days or 30 days, ranked by their stars.
  This is our own approximation from the official API, not GitHub's own trending page. Every trending row says so.
- **Clean rows, no personal data:** only repository facts. The owner is shown by public login and type (user or
  organization) only. Email addresses in descriptions are replaced by `[email hidden]`.

Who it is for: developers, analysts, investors, writers and open-source teams who want repository data in a
spreadsheet or a pipeline without writing API code.

### Quick start

1. Get a free GitHub token (2 minutes, see below) and paste it into the **GitHub token** field.
2. Choose a **Mode**: `search`, `repos` or `trending`.
3. Type your keywords (search) or your repositories (repos), and set **Maximum repositories**.
4. Click **Start**. Download the results as JSON, CSV or Excel from the **Output** tab.

No token yet? Click Start anyway: the run is a free demo with at most 10 repositories.

### How to get a token in 2 minutes

The token is free. Any GitHub account can create one, and for public data it needs no permissions.

1. Sign in to GitHub. Open **Settings**, then **Developer settings**, then **Personal access tokens**, then
   **Fine-grained tokens**, and click **Generate new token**.
2. Give it a name (for example "Apify repositories") and an expiry date.
3. Under **Repository access**, choose **Public repositories** (read-only). Do not add any permissions: public
   repository data needs none.
4. Click **Generate token**, copy it and paste it into the **GitHub token** field of this Actor.

The field is a secret input: the token is never logged, stored in the dataset or shown in a message. It stays your
token, and the requests count against your own GitHub limits. If you think it has leaked, delete it in the same
GitHub page and create a new one.

### Input

| Field | What it does | Default |
| --- | --- | --- |
| GitHub token (recommended) | Your own token (secret). Without it the run is a free demo. | empty |
| Mode | `search`, `repos` or `trending`. | `search` |
| Search keywords | Keywords as on GitHub search, for example `web scraping`. Optional in trending. | empty |
| Repositories (repos mode) | `owner/repo` names or repository links. Duplicates are removed. | empty |
| Trending period | `daily`, `weekly` or `monthly` (created in the last 1, 7 or 30 days). | `weekly` |
| Language | Primary language, for example `TypeScript` or `Python`. | empty |
| Topics | GitHub topics; a repository must have all of them (up to 10). | empty |
| Minimum stars / Maximum stars | Star range. | empty |
| Created from / Created to | Creation date range (YYYY-MM-DD). | empty |
| Last push from / Last push to | Last push date range (YYYY-MM-DD). | empty |
| Include forks | Also return forked repositories. | off |
| Include archived | Also return archived repositories. | on |
| Sort by | `stars`, `forks`, `updated` or `best-match` (search mode). | `stars` |
| Maximum repositories | Stop after this many repositories (1 to 2,000). | 500 |
| Language breakdown | Bytes per language; one extra API call per repository. Empty = on in repos mode only. | empty |
| Releases count | Number of releases; one extra API call per repository. Empty = on in repos mode only. | empty |

Example input (search):

```json
{
  "githubToken": "<your token>",
  "mode": "search",
  "query": "web scraping",
  "language": "TypeScript",
  "minStars": 100,
  "maxResults": 200
}
```

### Output

One row per repository. This example comes from a test run on a made-up repository (`zzz-org/zzz-crawler`):

```json
{
  "status": "ok",
  "mode": "repos",
  "input": "zzz-org/zzz-crawler",
  "fullName": "zzz-org/zzz-crawler",
  "owner": "zzz-org",
  "ownerType": "Organization",
  "name": "zzz-crawler",
  "url": "https://github.com/zzz-org/zzz-crawler",
  "description": "A synthetic web crawler. Questions: [email hidden] or the issue tracker.",
  "language": "TypeScript",
  "stars": 20000,
  "forks": 900,
  "openIssues": 150,
  "watchers": 120,
  "license": "Apache-2.0",
  "topics": ["web-scraping", "crawler"],
  "sizeKb": 123456,
  "createdAt": "2016-08-26T18:35:03Z",
  "pushedAt": "2026-11-12T09:00:00Z",
  "updatedAt": "2026-11-12T10:00:00Z",
  "defaultBranch": "main",
  "isArchived": false,
  "isFork": false,
  "releasesCount": 37,
  "languages": { "TypeScript": 900000, "JavaScript": 12000 },
  "error": null,
  "fetchedAt": "2026-11-13T00:00:00.000Z"
}
```

- Search rows also carry `searchQuery` and `rank`. Trending rows carry `trendingPeriod`, `trendingSince`,
  `starsGained`, `starsPerDay` and a `trendingNote` that says the ranking is an approximation.
- `status` is `ok`, `not_found` (a repository that does not exist or is private), `invalid_input` (a name that is
  not `owner/repo`), `error` (a network failure) or `token_needed` (the demo row that tells you to add a token).
  Rows that are not `ok` explain the problem in `error.message`.
- Every run also writes a `SUMMARY` record to the key-value store: repositories delivered, free rows, API calls,
  the search total, and why the run stopped, if it stopped early.

### Pricing

Pay per event: with your token, you pay once per repository row with status `ok` (the `repo` event). If your spending
limit is reached, the run stops cleanly and tells you so. GitHub charges nothing: the calls count against your
token's free GitHub limits.

| Apify plan | Price per 1,000 repositories |
| --- | --- |
| Free | $1.00 |
| Bronze | $0.90 |
| Silver | $0.80 |
| Gold | $0.70 |

Free: every row of a demo run without a token, the "add a token" row, and `not_found`, `invalid_input` and `error`
rows.

### Limits

- **1,000 results per search:** GitHub search returns at most 1,000 results per query. For bigger runs the Actor
  splits your search by creation date and runs it once per date window, so you can get up to 2,000 repositories.
  The sort order then holds within each date window, not across the whole list.
- **Rate limits:** with a token GitHub allows about 30 searches per minute and 5,000 other requests per hour. The
  Actor paces its searches below that and reads GitHub's limit headers. If GitHub asks it to wait up to a minute,
  it waits; for longer waits it stops cleanly and keeps the rows it already has (`stopReason: rate_limited` in
  `SUMMARY`).
- **Extra calls:** language breakdown and releases count each add one API call per repository.
- **Demo without a token:** at most 10 repositories and 5 API calls, no language or release calls, and nothing is
  charged. GitHub allows only a few requests per hour without a token from Apify's shared addresses, so a demo run
  may return a single free row that says how to add a token. The run still succeeds.
- **Trending is an approximation:** it ranks repositories created in the period by all their stars, not by stars
  gained per day across all repositories. It is not GitHub's own trending page.
- Data is public repository metadata as GitHub returns it. It can be incomplete or a little delayed.

### Use cases

- **Open-source discovery:** find the most used libraries for a language or topic.
- **Market and technology research:** count and compare projects by language, topic, license or age.
- **Dependency and competitor tracking:** follow the stars, releases and activity of repositories you depend on or
  compete with.
- **Newsletters and reports:** collect new and fast-growing repositories for a weekly roundup.

This Actor is about repositories, not people: do not use it for recruiting, headhunting, sales outreach or contact lists.

### FAQ

**Do I need a token?** For real runs, yes. Without one the run is a free demo with at most 10 repositories. A
fine-grained token with read-only access to public repositories is enough.

**The run failed with "GitHub rejected your token (401 Bad credentials)".** The token is wrong, expired or revoked.
Create a new token (see "How to get a token in 2 minutes") and paste all of it.

**Why did I get fewer repositories than I asked for?** Your filters matched fewer, or GitHub's rate limit stopped
the run early. `SUMMARY` shows the search total and the stop reason; start the run again later for the rest.

**Is this the same list as GitHub's trending page?** No. Trending mode is our own approximation from the official
API: new repositories ranked by stars. Each trending row says so.

**Does it collect personal data?** No profiles, names, emails, avatars or followers. The owner appears only as a
public login and type, and emails inside descriptions are hidden.

### More from Tan Solutions

- [GitHub repos tool page](https://www.tansolutions.org/tools/github-repos/): details and examples for this Actor on our site.
- [All Tan Solutions data tools](https://www.tansolutions.org/tools/)

### Your responsibilities

- You are responsible for lawful use and must follow the GitHub Terms of Service (section H, API Terms) and the
  GitHub Acceptable Use Policies. In particular: no spamming or unsolicited email to GitHub users, and no selling
  of GitHub users' personal information.
- Your token stays your token. Use a read-only, least-privilege token, and rotate it if you suspect it has leaked.
- Data is public repository metadata as GitHub returns it; it may be incomplete or delayed. No warranty. Liability
  is capped at the fees you paid in the last 12 months.
- "GitHub" is used only to describe the data source. No GitHub or Octocat logos are used.
- Questions and issues are answered within 14 days through the Actor's Issues tab.

Made by Tan Solutions.

### Related tools by Tan Solutions

- [URL to Markdown](https://apify.com/tan-solutions/url-to-markdown): turn any web page (docs, READMEs, blog posts)
  into clean Markdown for LLMs, RAG and AI agents.
- [Document to Markdown](https://apify.com/tan-solutions/document-to-markdown): PDF, Word and PowerPoint files to
  Markdown.
- [Domain Intelligence](https://apify.com/tan-solutions/domain-intel): DNS, WHOIS/RDAP, SSL and tech stack of a
  project's or company's website domain.
- [SEO Audit](https://apify.com/tan-solutions/seo-audit): on-page SEO checker with PageSpeed for any website.
- [US Company Filings & Financials](https://apify.com/tan-solutions/company-filings): 10-K, 10-Q, 8-K filings and XBRL
  financial facts of US public companies from SEC EDGAR.

# Actor input Schema

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

Your own GitHub personal access token. A fine-grained token with read-only access to public repositories is enough (no extra permissions). Your token, your GitHub quota (5,000 requests per hour). Without a token the run is a small demo: at most 10 repositories and 5 API calls. Rotate the token if you think it leaked.

## `mode` (type: `string`):

search: repositories matching your keywords and filters. repos: details for a list of owner/repo names. trending: an approximation of trending repositories (repositories created in the chosen period, ranked by the stars they gained since they were created). It is not an official GitHub list.

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

Keywords as on GitHub search, for example web scraping. Used in search mode and, optionally, to narrow trending.

## `repositories` (type: `array`):

owner/repo names such as apify/crawlee, or repository links such as https://github.com/apify/crawlee. Duplicates are removed.

## `trendingPeriod` (type: `string`):

Trending mode: repositories created in the last day, 7 days or 30 days, ranked by stars.

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

Primary language, for example TypeScript, Python or C++.

## `topics` (type: `array`):

GitHub topics, for example machine-learning. A repository must have all of them.

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

Only repositories with at least this many stars.

## `maxStars` (type: `integer`):

Only repositories with at most this many stars.

## `createdFrom` (type: `string`):

Created on or after this date (YYYY-MM-DD).

## `createdTo` (type: `string`):

Created on or before this date (YYYY-MM-DD).

## `pushedFrom` (type: `string`):

Last pushed on or after this date (YYYY-MM-DD).

## `pushedTo` (type: `string`):

Last pushed on or before this date (YYYY-MM-DD).

## `includeForks` (type: `boolean`):

Also return forked repositories in search and trending.

## `includeArchived` (type: `boolean`):

Also return archived repositories in search and trending.

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

Search mode order. Trending is always ranked by stars.

## `maxResults` (type: `integer`):

Stop after this many repositories (with a token). Without a token the demo returns at most 10. GitHub search returns at most 1,000 results per query; above that the Actor splits the creation dates into windows (rows are then sorted within each window).

## `includeLanguages` (type: `boolean`):

Add the bytes per language of each repository (one extra API call per repository). Empty = on in repos mode, off in search and trending. Off in the no-token demo.

## `includeReleasesCount` (type: `boolean`):

Add the number of releases of each repository (one extra API call per repository). Empty = on in repos mode, off in search and trending. Off in the no-token demo.

## Actor input object example

```json
{
  "mode": "search",
  "query": "web scraping",
  "trendingPeriod": "weekly",
  "includeForks": false,
  "includeArchived": true,
  "sort": "stars",
  "maxResults": 500
}
```

# Actor output Schema

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

One item per repository: name, owner login, stars, forks, open issues, language, license, topics, dates and (on request) languages and releases count.

# 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": "web scraping"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tan-solutions/github-repos").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": "web scraping" }

# Run the Actor and wait for it to finish
run = client.actor("tan-solutions/github-repos").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": "web scraping"
}' |
apify call tan-solutions/github-repos --silent --output-dataset

```

## MCP server setup

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

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/y2fTKLddoRtl4GrOx/builds/gi2tMmgwj62VPJ9Vl/openapi.json
