# GitHub API: Search repositories

> Finds public GitHub repositories by keywords, with an optional language filter and sort order. Returns up to 100 matches.

Unofficial. Not affiliated with or endorsed by GitHub.

- Page: https://fous.com/methods/github.com/search-repositories
- Method: `github.com/search_repositories`, version 1
- Website: github.com
- Returns: name, owner, description, stars, forks, main_language, last_updated_date, project_link, full_name, repository_id
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `sort` | string | no |  | Order of results, such as stars. One of "best_match", "stars", "recently_updated". Default "best_match". |
| `query` | string | yes | `"invoice pdf generator"` | Keywords to search for, such as invoice pdf generator. |
| `language` | string | no |  | Repository language, such as Python. Use any for no language filter. Default "any". |
| `max_results` | integer | no |  | Maximum repositories to return, such as 20. Default 20. |

## Output

From a run on Oct 23, 2026, shortened. Its input:

```json
{
  "query": "invoice pdf generator"
}
```

Its output:

```json
{
  "repositories": [
    {
      "name": "InvoiceGenerator",
      "forks": 125,
      "owner": "by-cx",
      "stars": 184,
      "full_name": "by-cx/InvoiceGenerator",
      "description": "Library to generate PDF invoices.",
      "project_link": "https://github.com/by-cx/InvoiceGenerator",
      "main_language": "Python",
      "repository_id": 2173993,
      "last_updated_date": "2026-08-12"
    },
    {
      "name": "react-invoice-generator",
      "forks": 273,
      "owner": "tuanpham-dev",
      "stars": 678,
      "full_name": "tuanpham-dev/react-invoice-generator",
      "description": "React Invoice Generator allows you quickly make invoices and export them as PDF",
      "project_link": "https://github.com/tuanpham-dev/react-invoice-generator",
      "main_language": "TypeScript",
      "repository_id": 276736432,
      "last_updated_date": "2026-10-13"
    },
    {
      "name": "invoice-generator",
      "forks": 228,
      "owner": "johnuberbacher",
      "stars": 295,
      "full_name": "johnuberbacher/invoice-generator",
      "description": "An Invoice creator project built with React. Uses jspdf-react to capture the data from the modal and convert it from canvas -> pdf.",
      "project_link": "https://github.com/johnuberbacher/invoice-generator",
      "main_language": "JavaScript",
      "repository_id": 403724136,
      "last_updated_date": "2026-10-15"
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"github.com/search_repositories","input":{"query":"invoice pdf generator"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- Find the top 15 most starred Rust repositories about async web frameworks
- I need public repos for a markdown to PDF converter sorted by recently updated, max 50
- Show me JavaScript libraries for drag and drop kanban boards, best matches first
- On GitHub, look up Go repositories related to distributed key value stores ordered by stars
- Give me 30 Python projects for parsing invoice PDFs with the most forks listed first

## Input schema

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "sort": {
      "enum": [
        "best_match",
        "stars",
        "recently_updated"
      ],
      "type": "string",
      "default": "best_match",
      "description": "Order of results, such as stars."
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Keywords to search for, such as invoice pdf generator."
    },
    "language": {
      "type": "string",
      "default": "any",
      "description": "Repository language, such as Python. Use any for no language filter."
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum repositories to return, such as 20."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "repositories"
  ],
  "properties": {
    "repositories": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "owner",
          "description",
          "stars",
          "forks",
          "main_language",
          "last_updated_date",
          "project_link",
          "full_name",
          "repository_id"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name."
          },
          "forks": {
            "type": "integer",
            "description": "Fork count."
          },
          "owner": {
            "type": "string",
            "description": "Owner account name."
          },
          "stars": {
            "type": "integer",
            "description": "Star count."
          },
          "full_name": {
            "type": "string",
            "description": "Owner and project name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Project description, if provided."
          },
          "project_link": {
            "type": "string",
            "format": "uri",
            "description": "Project page on GitHub."
          },
          "main_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Main programming language, if known."
          },
          "repository_id": {
            "type": "integer",
            "description": "GitHub repository ID."
          },
          "last_updated_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the repository was last updated."
          }
        },
        "additionalProperties": false
      },
      "description": "Public repositories matching the search."
    }
  },
  "additionalProperties": false
}
```

## See more

- [GitHub API: Get repository facts](https://fous.com/methods/github.com/get-repository.md): Looks up a public GitHub repository by name, owner/name, or link and returns its stars, forks, release, commit and contributor facts.
- [GitHub API: List issues or pull requests](https://fous.com/methods/github.com/list-issues.md): Lists public issues or pull requests for a GitHub project, with state, label and sort options. A bare project name matches the most-starred repository with that name.
- [GitHub API: List trending repositories](https://fous.com/methods/github.com/list-trending-repositories.md): Lists up to 25 public repositories trending on GitHub, in page order, optionally filtered by programming language and time period.
- [GitHub API: List releases](https://fous.com/methods/github.com/list-releases.md): Lists published, non-draft releases of a public GitHub project, newest first. A bare project name matches the most-starred repository.
- [crates.io API: Search crates](https://fous.com/methods/crates.io/search-crates.md): Finds Rust crates on crates.io by keywords, sorted by relevance, total downloads, recent downloads, or newest creation.
- [PyPI API: Search packages](https://fous.com/methods/pypi.org/search-packages.md): Searches PyPI by keywords and returns matching packages in relevance order, each with its latest version and that version's release date. Returns up to 100 results.
- [Hugging Face API: Search models](https://fous.com/methods/huggingface.co/search-models.md): Finds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
- [Reddit API: Search posts](https://fous.com/methods/reddit.com/search-posts.md): Finds public Reddit posts by topic, optionally in one community, for a time window and sort order. Returns up to 100 posts in Reddit search order with score, comment count, text and link.
- [All GitHub methods](https://fous.com/methods/github.com.md)
