# github.repository

A public GitHub repository: description, stars, forks, watchers, open issues, language, topics, licence, the dates it was created and last pushed to, and its README.

GitHub repository, one of the GitHub scrapers.

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

Start it with `POST /v1/scrapers/github.repository/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 |
| --- | --- | --- | --- |
| `repository` | string | yes | The repository as owner/name, e.g. pallets/flask, or its address on github.com. Limit: at least 3 characters, at most 300 characters. |
| `include_readme` | boolean | no | Also return the README's text; false leaves it out and makes the run lighter. Default: `true`. |

- `repository` is `owner/name`, or any address inside the repository on github.com. A repository asked for under an old name is returned under the name it has now.
- `source` says where the record was read. It is `api` as a rule. When GitHub's allowance for visitors without an account is used up for the moment, the repository's page is read instead and `source` is `page`: `language`, `open_issues`, `size_kb`, `pushed_at`, `updated_at`, `parent` and the `has_` flags are then `null`, and `readme` is plain text.
- `readme` is the README file as written, whatever its format; `readme_path` names the file. A repository without one has both `null`. `include_readme: false` leaves it out.
- `open_issues` counts open issues and open pull requests together. `license` is the SPDX identifier, `NOASSERTION` for a licence file GitHub cannot match.
- A repository that does not exist, or is private, ends the run `failed` with `not_found`, and costs nothing — 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 |
| --- | --- | --- |
| `full_name` | string | The repository as owner/name, e.g. "pallets/flask". |
| `owner` | string | The account that owns the repository: a user's or an organisation's login. |
| `name` | string | The repository's own name, without the owner. |
| `url` | string | The repository's address on github.com. |
| `source` | string | Where the record was read: "api" (GitHub's public API) or "page" (the repository's page on github.com, read when the API has no answer left for the moment). From the page, language, open_issues, size_kb, parent, the dates other than created_at and the has_ flags are null, and the README is plain text. |
| `repository_id` | integer or null | GitHub's numeric id of the repository; it stays the same when the repository is renamed. |
| `owner_type` | string or null | "User" or "Organization". |
| `description` | string or null | The one-line description under the repository's name; null when it 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, e.g. "Python"; null when it detects none. |
| `topics` | array of string | The topics the owner tagged the repository with, e.g. ["python", "web-framework"]. |
| `license` | string or null | The licence's SPDX identifier, e.g. "MIT", "Apache-2.0"; "NOASSERTION" for a licence file GitHub cannot match; null when there is no licence file. |
| `license_name` | string or null | The licence's name, e.g. "BSD 3-Clause \"New\" or \"Revised\" License". |
| `stars` | integer or null | How many accounts starred the repository. |
| `forks` | integer or null | How many forks the repository has. |
| `watchers` | integer or null | How many accounts watch the repository (are notified of its activity). |
| `open_issues` | integer or null | Open issues and open pull requests together, as GitHub counts them. |
| `default_branch` | string or null | The branch the repository opens on, e.g. "main". |
| `size_kb` | integer or null | The size of the repository in kilobytes. |
| `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 (a push, a star, an edited description), in UTC. |
| `pushed_at` | string (date-time) or null | When code was last pushed to any branch, in UTC. |
| `is_fork` | boolean or null | True when the repository is a fork of another. |
| `parent` | string or null | For a fork, the repository it was forked from, as owner/name. |
| `is_archived` | boolean or null | True when the owner archived the repository (read-only). |
| `is_template` | boolean or null | True for a template repository. |
| `has_issues` | boolean or null | True when the repository's issue tracker is on. |
| `has_wiki` | boolean or null | True when the repository's wiki is on. |
| `has_discussions` | boolean or null | True when the repository's discussions are on. |
| `readme` | string or null | The README's text: the file as written (Markdown, reStructuredText, ...) when source is "api", its plain text when source is "page". Null when the repository has none, when include_readme was false, or when it could not be read. |
| `readme_path` | string or null | The README file's path in the repository, e.g. "README.md". |
| `fetched_at` | string (date-time) | When the repository was 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.repository/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"repository":"pallets/flask"}}'
```

## 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.repository",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "repository": "pallets/flask"
  },
  "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": [
    {
      "full_name": "pallets/flask",
      "owner": "pallets",
      "name": "flask",
      "url": "https://github.com/pallets/flask",
      "source": "api",
      "repository_id": 596892,
      "owner_type": "Organization",
      "description": "The Python micro framework for building web applications.",
      "homepage": "https://flask.palletsprojects.com",
      "language": "Python",
      "topics": [
        "flask",
        "jinja",
        "pallets"
      ],
      "license": "BSD-3-Clause",
      "license_name": "BSD 3-Clause \"New\" or \"Revised\" License",
      "stars": 75249,
      "forks": 17336,
      "watchers": 2153,
      "open_issues": 4,
      "default_branch": "main",
      "size_kb": 12227,
      "created_at": "2010-04-06T11:11:59Z",
      "updated_at": "2026-11-18T22:03:15Z",
      "pushed_at": "2026-10-30T15:05:22Z",
      "is_fork": false,
      "parent": null,
      "is_archived": false,
      "is_template": false,
      "has_issues": true,
      "has_wiki": false,
      "has_discussions": false,
      "readme": "<div align=\"center\"><img src=\"https://raw.githubusercontent.com/pallets/flask/refs/heads/stable/docs/_static/flask-name.svg\" alt=\"\" height=\"150\"></div>\n\n# Flask\n\nFlask is a lightweight [WSGI] web application framework. It is designed\nto … [truncated]",
      "readme_path": "README.md",
      "fetched_at": "2026-11-19T18:07:40.277931Z"
    }
  ],
  "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`: 7 items, the first 3 shown.
- Shortened: `readme`: 1,639 characters, the first 236 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.
