# GitHub repository search and trending API

Search public GitHub repositories by keyword, language, topics, stars and dates, or paste the ones you follow, and get one clean row each: stars, forks, open issues, license, topics, languages, releases and dates.

**From USD 0.70 per 1,000 repositories.** On the Apify Store since 14 November 2026. Checked 14 November 2026. Apify Store page: https://apify.com/tan-solutions/github-repos

## What it does

Code Repository Search and Trending reads the official GitHub REST API with your own free token. It has three modes: search, repos (names or links you paste) and trending.

Why its full name ends in "(Approximation)": trending mode is not GitHub's own trending page. It builds its own list from the official API: repositories created in the last day, 7 days or 30 days, ranked by all their stars, not by stars gained per day. The two lists can differ, and every trending row says so. Search and repos rows are GitHub's data as it is.

- **Search.** Keywords plus filters (language, topics, stars, created and last-push dates, forks, archived), sorted by stars, forks, last update or best match.
- **Repository details.** Paste owner/repo names or links and get one row each, with the language breakdown and the number of releases.
- **Trending (approximation).** New repositories ranked by stars, with stars gained and stars per day.
- **No personal data.** The owner appears only as a public login and type; emails in descriptions are hidden.

## Who it is for

- Developers who look for the most used libraries for a language or topic.
- Analysts who compare projects by language, topic, license or age.
- Writers who collect new, fast-growing repositories for a weekly roundup.

## What it costs

**From USD 0.70 per 1,000 repositories.** You pay per result. The price depends on your Apify plan:

| Apify plan tier | Price per 1,000 repositories |
|---|---|
| FREE | USD 1.00 |
| BRONZE | USD 0.90 |
| SILVER | USD 0.80 |
| GOLD | USD 0.70 |

Free, never charged: demo runs without a token; repositories not found or private; invalid names; failed rows. Apify also charges a small start event per run.

## Input

The fields you will most likely change:

| Field | What it does | Default |
|---|---|---|
| `githubToken` | Your GitHub token, stored as a secret input. | empty |
| `mode` | search, repos or trending. | search |
| `query` | Search keywords, such as web scraping. | empty |
| `repositories` | owner/repo names or links (repos mode). | empty |
| `trendingPeriod` | daily, weekly or monthly. | weekly |
| `language` | Primary language, such as Python. | empty |
| `minStars` | Lowest star count. | empty |
| `maxResults` | Stop after this many, up to 2,000. | 500 |

A small input to start from:

```json
{
  "githubToken": "<YOUR_GITHUB_TOKEN>",
  "mode": "trending",
  "trendingPeriod": "weekly"
}
```

## Output

One row per repository. A real row from a cloud run on 15 November 2026 (a search of organization repositories, sorted by stars):

```json
{
  "status": "ok",
  "mode": "search",
  "input": null,
  "fullName": "microsoft/markitdown",
  "owner": "microsoft",
  "ownerType": "Organization",
  "name": "markitdown",
  "url": "https://github.com/microsoft/markitdown",
  "description": "Python tool for converting files and office documents to Markdown.",
  "language": "Python",
  "stars": 195502,
  "forks": 14775,
  "openIssues": 815,
  "watchers": null,
  "license": "MIT",
  "topics": [
    "autogen",
    "autogen-extension",
    "langchain",
    "markdown",
    "microsoft-office",
    "openai",
    "pdf"
  ],
  "createdAt": "2024-11-13T19:56:40Z",
  "pushedAt": "2026-11-07T00:14:01Z",
  "defaultBranch": "main",
  "isArchived": false,
  "isFork": false,
  "releasesCount": null,
  "languages": null,
  "error": null,
  "fetchedAt": "2026-11-15T15:48:54.152Z"
}
```

Trending rows add starsGained, starsPerDay and a note that the ranking is an approximation. Rows that are not ok explain the problem. Download as JSON, CSV or Excel, or read them through the API.

## How to run it

### In Apify Console, no code

1. Create a free fine-grained GitHub token (about 2 minutes) with read-only access to public repositories and no extra permissions, and paste it into "GitHub token".
2. Choose a mode, type your keywords or repositories and click Start. Without a token the run is a free demo with at most 10 repositories.
3. Open the Output tab: one row per repository.

Start from the tool's page (https://apify.com/tan-solutions/github-repos). You need an Apify account.

### From the API

One call runs the tool and returns the results. Replace `<YOUR_API_TOKEN>` with your token from Apify Console (Settings, API and Integrations). Send `{}` for a short demo run.

```bash
curl -X POST "https://api.apify.com/v2/acts/tan-solutions~github-repos/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"githubToken":"<YOUR_GITHUB_TOKEN>","mode":"trending","trendingPeriod":"weekly"}'
```

### From an AI agent, through MCP

Apify's MCP server offers this tool alone to your MCP client at `https://mcp.apify.com?tools=tan-solutions/github-repos`. The client signs in to Apify on first connect, or sends your token in an `Authorization: Bearer` header.

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=tan-solutions/github-repos"
    }
  }
}
```

## Run it on a schedule

Get the new repositories of the past 7 days, ranked by stars, every Monday. In Apify Console: Schedules, Create new, cron `0 7 * * 1` (every Monday at 07:00 UTC), then add this tool with your input. Or as one API call (`y2fTKLddoRtl4GrOx` is this tool's Actor ID):

```bash
curl -X POST "https://api.apify.com/v2/schedules?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "github-repos-schedule",
  "cronExpression": "0 7 * * 1",
  "timezone": "UTC",
  "isEnabled": true,
  "isExclusive": true,
  "actions": [
    {
      "type": "RUN_ACTOR",
      "actorId": "y2fTKLddoRtl4GrOx",
      "runInput": {
        "body": "{\"githubToken\":\"<YOUR_GITHUB_TOKEN>\",\"mode\":\"trending\",\"trendingPeriod\":\"weekly\"}",
        "contentType": "application/json"
      }
    }
  ]
}'
```

## Limits

- GitHub search returns at most 1,000 results per query; the tool splits bigger searches by creation date, up to 2,000 repositories.
- With a token GitHub allows about 30 searches per minute and 5,000 other requests per hour. On a long wait the run stops cleanly and keeps its rows.
- Language breakdown and releases count add one call per repository each.
- Repositories, not people: do not use it for recruiting or contact lists.

## Questions

### Do I need a token?

For real runs, yes. The calls count against your own free GitHub limits, and GitHub charges nothing for them.

### What does "(Approximation)" mean?

Only trending mode is approximate: our own list from the official API, new repositories ranked by stars, so it can differ from GitHub's trending page.

### The run failed with "401 Bad credentials".

The token is wrong, expired or revoked. Create a new one.

Not affiliated with GitHub: this Actor is not affiliated with, endorsed by or sponsored by GitHub, Inc. Built and run by Tan Solutions.

Source: https://www.tansolutions.org/tools/github-repos/ · Tan Solutions
