# github.search

The public repositories GitHub's search finds for a query, a page at a time: name, description, stars, forks, language, topics, licence and dates.

GitHub repository search, one of the GitHub scrapers.

| | |
| --- | --- |
| Id | `github.search` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/github.search/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | yes | What to search for, in GitHub's own search syntax: words, and qualifiers such as language:python, stars:>1000, topic:cli, user:pallets, pushed:>2026-01-01, in:readme. Limit: at least 1 characters, at most 256 characters. |
| `sort` | "best_match" \| "stars" \| "forks" \| "updated" | no | The order of the results: best_match, stars, forks or updated. Default: `"best_match"`. |
| `order` | "desc" \| "asc" | no | With a sort other than best_match: desc (most first) or asc. Default: `"desc"`. |
| `max_results` | integer | no | Repositories a page; 100 at most. Limit: 1 to 100. Default: `30`. |
| `page` | integer | no | The results page, from 1. GitHub serves the first 1,000 results of a search. Limit: 1 to 1000. Default: `1`. |

- `query` is GitHub's own search syntax: words, and qualifiers such as `language:python`, `stars:>1000`, `topic:cli`, `user:pallets`, `pushed:>2026-01-01`, `license:mit`, `in:readme`.
- One run reads one page: `max_results` repositories, `position` counting on across pages. GitHub serves the first 1,000 results of a search, so `page` x `max_results` may not exceed 1,000.
- A search nothing matches ends `ok` with zero records. One GitHub refuses as written ends `failed` with `search_not_accepted` — see [the reasons of this family](https://docs.enrichednow.com/results-and-statuses.md#github).

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `position` | integer | The repository's place in the whole result list, from 1 (page 2 of 30 a page starts at 31). |
| `page` | integer | The results page the repository was on. |
| `full_name` | string | The repository as owner/name. |
| `owner` | string | The account that owns the repository. |
| `name` | string | The repository's own name, without the owner. |
| `url` | string | The repository's address on github.com. |
| `repository_id` | integer or null | GitHub's numeric id of the repository. |
| `owner_type` | string or null | "User" or "Organization". |
| `description` | string or null | The one-line description; null when the repository has none. |
| `homepage` | string or null | The website the repository links to; null when it names none. |
| `language` | string or null | The main programming language GitHub detects; null when it detects none. |
| `topics` | array of string | The topics the repository is tagged with. |
| `license` | string or null | The licence's SPDX identifier, e.g. "MIT"; null when there is no licence file. |
| `stars` | integer or null | How many accounts starred the repository. |
| `forks` | integer or null | How many forks the repository has. |
| `open_issues` | integer or null | Open issues and open pull requests together. |
| `default_branch` | string or null | The branch the repository opens on. |
| `created_at` | string (date-time) or null | When the repository was created, in UTC. |
| `updated_at` | string (date-time) or null | When the repository itself last changed, in UTC. |
| `pushed_at` | string (date-time) or null | When code was last pushed, in UTC. |
| `is_fork` | boolean or null | True when the repository is a fork. |
| `is_archived` | boolean or null | True when the repository is archived. |
| `fetched_at` | string (date-time) | When the results were read, in UTC. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/github.search/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"query":"web scraper language:python","sort":"stars","max_results":5}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "github.search",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "query": "web scraper language:python",
    "sort": "stars",
    "max_results": 5
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "position": 1,
      "page": 1,
      "full_name": "unclecode/crawl4ai",
      "owner": "unclecode",
      "name": "crawl4ai",
      "url": "https://github.com/unclecode/crawl4ai",
      "repository_id": 798201435,
      "owner_type": "User",
      "description": "Official Crawl4AI Cloud: a hosted web scraping, extraction, and search API for AI agents. Free API key, 1,000 credits a month, no card. Fully open source: this repo is the Apache-2.0 crawler that powers it, and you can self-host it.",
      "homepage": "https://crawl4ai.com/?ref=github-about",
      "language": "Python",
      "topics": [
        "ai",
        "ai-agents",
        "crawl4ai-cloud"
      ],
      "license": "Apache-2.0",
      "stars": 87529,
      "forks": 9130,
      "open_issues": 350,
      "default_branch": "main",
      "created_at": "2024-05-09T09:48:50Z",
      "updated_at": "2026-11-18T21:36:09Z",
      "pushed_at": "2026-11-18T15:37:54Z",
      "is_fork": false,
      "is_archived": false,
      "fetched_at": "2026-11-19T18:07:40.285580Z"
    }
  ],
  "next_cursor": null
}
```

What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with `… [truncated]`.

- Shortened: `topics`: 16 items, the first 3 shown.

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the GitHub scrapers](https://docs.enrichednow.com/results-and-statuses.md#github) are in their own section there.
