> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapebadger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a GitHub repository

> Public repository statistics, native README, root files and latest commit.

Read a public repository on its default branch. Pass an owner login and
repository name separately, not a URL. No GitHub token is required; authenticate
with your ScrapeBadger `X-API-Key`. Restricted keys need the `github` scope.

**Credits: 10 per successful uncached response.** Cache hits can cost zero;
inspect `X-Credits-Used`. An empty repository still returns meaningful identity
and its explicit empty state. Health and errors are free. Check
[credits and pricing](https://docs.scrapebadger.com/credits-and-pricing.md) for current currency rates.

## Representative requests

```bash theme={null}
curl 'https://scrapebadger.com/v1/github/repositories/cli/cli' \
  -H 'X-API-Key: YOUR_API_KEY'
scrapebadger github repository cli cli
```

Use MCP `github_get_repository(owner="cli", repo="cli")`. SDK method names are
`client.github.get_repository("cli", "cli")` in Python and
`client.github.getRepository("cli", "cli")` in Node. Verify your installed SDK
version includes the operation before using it.

## Inputs and handoff

The owner is 1–39 letters, digits or hyphens. Repository names are 1–100 letters,
digits, dots, hyphens or underscores, excluding `.` and `..`. Encode each path
segment. No query parameters are accepted: market, ref, page, cursor and tab
inputs are rejected. From a [profile repository summary](https://docs.scrapebadger.com/github/profiles.md), pass
`owner.login` and `name`; do not pass its complete URL as either identifier.
Renamed/transferred repositories return their resolved public identity.

## Understand the fields

The response is unwrapped. `repository` contains identity/owner, description,
website, default branch, topics, language/license and public state flags.
Counts include stars, actual watcher subscriptions, forks and source-published
issue/PR/commit/branch/tag/release/contributor/dependent counts when available.
`watchers` is not the REST star alias. Website issue and pull-request counts are
separate from `open_issues_and_pull_requests_count`. Display counts with
`*_approximate` flags are estimates, not exact totals.

`readme` includes displayed text, native rendered HTML, actual path/ref and
heading metadata when present. It does not guess a README filename or convert
rendered HTML back into original Markdown. `latest_commit` includes SHA/link,
message, authors, committer and check state where public. Full timestamps have
ISO `*_at` and Unix-seconds `*_utc` pairs.

`files` is the native root preview, not a recursive tree. `files_count` counts
root entries including directories; preserve truncation information. Optional
language/release/contributor/funding/community-file previews depend on public
source visibility. Preview lengths are not exhaustive membership totals.

## Absence and errors

Only a recognized native empty state sets `repository.is_empty=true`. Missing
fields are unknown/not applicable and must not become invented zeroes. An
explicit null stays null. Supplemental REST metadata availability is reported
separately; it cannot replace native website sections. A failed expected native
README/commit read is an unbilled error, not an empty success.

Invalid inputs return 400/422. Missing/deleted/private resources share GitHub's
public 404 verdict without revealing private existence. Transient challenge,
throttle or invalid source state returns an unbilled source error. Standard
authentication/scope/rate-limit errors also apply. Repository search, trending,
private data and paginated child lists are separate from this operation.

See the [endpoint reference](https://docs.scrapebadger.com/api-reference/endpoint/github/get-repository.md) and
[GitHub overview](https://docs.scrapebadger.com/github/overview.md).


## OpenAPI

````yaml get /v1/github/repositories/{owner}/{repo}
openapi: 3.1.0
info:
  title: ScrapeBadger GitHub API
  version: 1.0.0
  description: >-
    Prepared contract for public user and organization profiles. Production
    availability and latency are not yet verified. All examples are
    representative. Every mode costs 10 credits.
servers:
  - url: https://scrapebadger.com
    description: API base URL; rollout verification pending
security:
  - apiKeyAuth: []
tags:
  - name: GitHub
    description: Global public profiles; no market or language parameter.
paths:
  /v1/github/repositories/{owner}/{repo}:
    get:
      tags:
        - GitHub
      summary: Get repository
      description: >-
        Public default-branch repository detail, native README, files and latest
        commit.


        Use owner.login and name from a profile repository summary. Root file
        and

        contributor previews are not exhaustive recursive trees or membership
        lists.

        No GitHub token, market, ref, search or pagination parameter is
        accepted.
      operationId: github_get_repository
      parameters:
        - name: owner
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 39
            pattern: ^[A-Za-z0-9-]+$
            title: Owner
        - name: repo
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[A-Za-z0-9_.-]+$
            title: Repo
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitHubRepositoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GitHubRepositoryResponse:
      properties:
        repository:
          $ref: '#/components/schemas/GitHubRepositoryIdentity'
        latest_commit:
          anyOf:
            - $ref: '#/components/schemas/GitHubLatestCommit'
            - type: 'null'
        readme:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryReadme'
            - type: 'null'
        files:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubRepositoryFile'
              type: array
            - type: 'null'
          title: Files
        languages:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubRepositoryLanguage'
              type: array
            - type: 'null'
          title: Languages
        latest_release:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryRelease'
            - type: 'null'
        contributors:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubRepositoryAccount'
              type: array
            - type: 'null'
          title: Contributors
        contributors_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Contributors Truncated
        dependents:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubRepositoryAccount'
              type: array
            - type: 'null'
          title: Dependents
          description: >-
            Dependent owner account preview; not a repository or dependency
            tree.
        dependents_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dependents Truncated
        funding:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryFunding'
            - type: 'null'
        community_files:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubCommunityFile'
              type: array
            - type: 'null'
          title: Community Files
        metadata_available:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Metadata Available
          description: Whether supplemental public REST metadata was available.
      additionalProperties: true
      type: object
      required:
        - repository
      title: GitHubRepositoryResponse
      description: Default-branch repository detail and native website sections.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GitHubRepositoryIdentity:
      properties:
        name:
          title: Name
          type: string
        full_name:
          title: Full Name
          type: string
        link:
          title: Link
          type: string
        owner:
          $ref: '#/components/schemas/GitHubRepositoryAccount'
        is_empty:
          type: boolean
          title: Is Empty
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        website:
          anyOf:
            - type: string
            - type: 'null'
          title: Website
        social_image:
          anyOf:
            - type: string
            - type: 'null'
          title: Social Image
        default_branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Branch
        current_commit:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Commit
        visibility:
          anyOf:
            - type: string
            - type: 'null'
          title: Visibility
        is_fork:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Fork
        forked_from:
          anyOf:
            - type: string
            - type: 'null'
          title: Forked From
        parent:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryReference'
            - type: 'null'
        source:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryReference'
            - type: 'null'
        fork_comparison:
          anyOf:
            - $ref: '#/components/schemas/GitHubForkComparison'
            - type: 'null'
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
        is_template:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Template
        is_mirror:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Mirror
        is_disabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Disabled
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        language_color:
          anyOf:
            - type: string
            - type: 'null'
          title: Language Color
        license:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryLicense'
            - type: 'null'
        topics:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Topics
        stars:
          anyOf:
            - type: integer
            - type: 'null'
          title: Stars
        watchers:
          anyOf:
            - type: integer
            - type: 'null'
          title: Watchers
          description: Actual subscribers, not REST watchers_count's star alias.
        forks:
          anyOf:
            - type: integer
            - type: 'null'
          title: Forks
        network_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Network Count
        open_issues_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Open Issues Count
          description: Website issue badge, excluding pull requests.
        open_pull_requests_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Open Pull Requests Count
        open_issues_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Open Issues Count Approximate
        open_pull_requests_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Open Pull Requests Count Approximate
        open_issues_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Open Issues Display
        open_pull_requests_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Open Pull Requests Display
        is_open_issues_count_capped:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Open Issues Count Capped
        is_open_pull_requests_count_capped:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Open Pull Requests Count Capped
        open_issues_and_pull_requests_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Open Issues And Pull Requests Count
          description: Combined public REST count, when available.
        commits_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Commits Count
        commits_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Commits Display
        commits_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Commits Count Approximate
        branches_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Branches Count
        branches_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Branches Count Approximate
        tags_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tags Count
        releases_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Releases Count
        contributors_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Contributors Count
        contributors_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Contributors Count Approximate
        used_by_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Used By Count
        used_by_count_approximate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Used By Count Approximate
        security_advisories_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Security Advisories Count
        files_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Files Count
          description: Root entries, including directories; not a recursive file count.
        files_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Files Truncated
        has_issues:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Issues
        has_pull_requests:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Pull Requests
        has_discussions:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Discussions
        has_projects:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Projects
        has_wiki:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Wiki
        has_pages:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Pages
        has_downloads:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Downloads
        has_citation:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Citation
        has_code_of_conduct:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Code Of Conduct
        has_contributing_guide:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Contributing Guide
        has_security_policy:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Security Policy
        allow_forking:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Forking
        web_commit_signoff_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Web Commit Signoff Required
        pull_request_creation_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Pull Request Creation Policy
        size_kb:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Kb
        clone_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Clone Url
        ssh_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Ssh Url
        git_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Git Url
        svn_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Svn Url
        archive_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Archive Url
        mirror_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Mirror Url
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Created At
        created_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Created Utc
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Updated At
        updated_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Updated Utc
        pushed_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Pushed At
        pushed_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Pushed Utc
      additionalProperties: true
      type: object
      required:
        - name
        - full_name
        - link
        - owner
        - is_empty
      title: GitHubRepositoryIdentity
    GitHubLatestCommit:
      properties:
        sha:
          type: string
          title: Sha
        link:
          title: Link
          type: string
        message:
          type: string
          title: Message
        message_html:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Html
        body:
          anyOf:
            - type: string
            - type: 'null'
          title: Body
        body_html:
          anyOf:
            - type: string
            - type: 'null'
          title: Body Html
        committed_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Committed At
        committed_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Committed Utc
        pushed_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Pushed At
        pushed_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Pushed Utc
        authors:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubCommitActor'
              type: array
            - type: 'null'
          title: Authors
        committer:
          anyOf:
            - $ref: '#/components/schemas/GitHubCommitActor'
            - type: 'null'
        pusher:
          anyOf:
            - $ref: '#/components/schemas/GitHubCommitActor'
            - type: 'null'
        checks:
          anyOf:
            - $ref: '#/components/schemas/GitHubCommitChecks'
            - type: 'null'
        is_spoofed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Spoofed
      additionalProperties: true
      type: object
      required:
        - sha
        - link
        - message
      title: GitHubLatestCommit
    GitHubRepositoryReadme:
      properties:
        text:
          title: Text
          type: string
        html:
          title: Html
          type: string
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
        ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Ref
        toc:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubReadmeHeading'
              type: array
            - type: 'null'
          title: Toc
      additionalProperties: true
      type: object
      required:
        - text
        - html
      title: GitHubRepositoryReadme
    GitHubRepositoryFile:
      properties:
        name:
          title: Name
          type: string
        path:
          type: string
          title: Path
        type:
          title: Type
          type: string
        link:
          title: Link
          type: string
        has_simplified_path:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Simplified Path
        latest_commit:
          anyOf:
            - $ref: '#/components/schemas/GitHubLatestCommit'
            - type: 'null'
      additionalProperties: true
      type: object
      required:
        - name
        - path
        - type
        - link
      title: GitHubRepositoryFile
    GitHubRepositoryLanguage:
      properties:
        name:
          title: Name
          type: string
        percentage:
          anyOf:
            - type: number
            - type: 'null'
          title: Percentage
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bytes
      additionalProperties: true
      type: object
      required:
        - name
      title: GitHubRepositoryLanguage
    GitHubRepositoryRelease:
      properties:
        name:
          title: Name
          type: string
        link:
          title: Link
          type: string
        tag:
          anyOf:
            - type: string
            - type: 'null'
          title: Tag
        published_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Published At
        published_utc:
          anyOf:
            - type: number
            - type: 'null'
          title: Published Utc
      additionalProperties: true
      type: object
      required:
        - name
        - link
      title: GitHubRepositoryRelease
    GitHubRepositoryAccount:
      properties:
        login:
          title: Login
          type: string
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
      additionalProperties: true
      type: object
      required:
        - login
      title: GitHubRepositoryAccount
    GitHubRepositoryFunding:
      properties:
        github_sponsors:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubRepositoryAccount'
              type: array
            - type: 'null'
          title: Github Sponsors
        links:
          anyOf:
            - items:
                $ref: '#/components/schemas/GitHubFundingLink'
              type: array
            - type: 'null'
          title: Links
        sponsorable_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sponsorable Count
        sponsors_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Sponsors Link
      additionalProperties: true
      type: object
      title: GitHubRepositoryFunding
    GitHubCommunityFile:
      properties:
        name:
          title: Name
          type: string
        path:
          type: string
          title: Path
        ref:
          type: string
          title: Ref
        link:
          title: Link
          type: string
        type:
          title: Type
          type: string
      additionalProperties: true
      type: object
      required:
        - name
        - path
        - ref
        - link
        - type
      title: GitHubCommunityFile
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    GitHubRepositoryReference:
      properties:
        name:
          title: Name
          type: string
        full_name:
          title: Full Name
          type: string
        link:
          title: Link
          type: string
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        owner:
          anyOf:
            - $ref: '#/components/schemas/GitHubRepositoryAccount'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        default_branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Branch
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
      additionalProperties: true
      type: object
      required:
        - name
        - full_name
        - link
      title: GitHubRepositoryReference
    GitHubForkComparison:
      properties:
        ahead:
          type: integer
          title: Ahead
        behind:
          type: integer
          title: Behind
        base_branch:
          type: string
          title: Base Branch
        current_ref:
          type: string
          title: Current Ref
        is_tracking_branch:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Tracking Branch
      additionalProperties: true
      type: object
      required:
        - ahead
        - behind
        - base_branch
        - current_ref
      title: GitHubForkComparison
    GitHubRepositoryLicense:
      properties:
        name:
          title: Name
          type: string
        spdx_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Spdx Id
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
      additionalProperties: true
      type: object
      required:
        - name
      title: GitHubRepositoryLicense
    GitHubCommitActor:
      properties:
        login:
          anyOf:
            - type: string
            - type: 'null'
          title: Login
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        profile_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Name
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        is_github:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Github
      additionalProperties: true
      type: object
      title: GitHubCommitActor
    GitHubCommitChecks:
      properties:
        state:
          type: string
          title: State
      additionalProperties: true
      type: object
      required:
        - state
      title: GitHubCommitChecks
    GitHubReadmeHeading:
      properties:
        level:
          type: integer
          title: Level
        text:
          title: Text
          type: string
        anchor:
          type: string
          title: Anchor
      additionalProperties: true
      type: object
      required:
        - level
        - text
        - anchor
      title: GitHubReadmeHeading
    GitHubFundingLink:
      properties:
        link:
          title: Link
          type: string
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        icon_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon Url
      additionalProperties: true
      type: object
      required:
        - link
      title: GitHubFundingLink
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.