openapi: 3.0.0
info:
  title: GitHub Profile API
  description: |
    The GitHub Profile API scrapes a single github.com/{username} profile into structured JSON: identity and sidebar details (name, bio, company, location, website, status, social accounts, repository, star, project and package counts), pinned or popular repositories, organizations, GitHub Sponsors in both directions, achievement badges, the profile README as plain text and as HTML, and the contribution calendar with its activity overview and the per-type activity breakdown behind it.

    Pass the GitHub handle in the `username` parameter. A pasted profile URL or an `@handle` is normalized to the login automatically. By default the calendar covers the last 12 months. Pass `year` for a calendar year. Header follower/following counts are rendered compact by GitHub (e.g. `25.2k`) and are therefore approximate. The `repos`, `starred_count`, `projects_count` and `packages_count` values are exact.

    Both user and organization accounts are supported. Organizations return the shared identity and detail fields - `login`, `name`, `avatar_url`, `bio`, `location`, `website`, `email`, `twitter_username`, `social_accounts`, `followers`, `repos`, `sponsoring_count`, `readme` - with `is_organization: true`, the `sponsors` / `sponsoring` rows when GitHub shows them, plus the sections that exist only on an organization page: the overview `repositories` list with exact counts, `top_languages`, `topics`, `members_count`, the `people` member preview, and `is_verified` / `verified_domains` for GitHub-verified organizations. The sections GitHub renders only on a user profile - `company`, `following`, `starred_count`, `status`, `local_time`, `utc_offset`, `highlights`, `organizations`, `achievements`, and `contributions` - are omitted for organizations.

    Pass `tab=repositories` for the account's full repository list (30 rows per page, paged with `page`), for users and organizations, or `tab=stars` for a user's starred repositories and star lists (30 rows per page, paged with `next_page_token`). Those tabs return `profile`, the tab's list and `pagination` only.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: GitHub Profile
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Search engine to use
          schema:
            type: string
            enum: ["github_profile"]
            default: "github_profile"
        - name: username
          in: query
          required: true
          description: >-
            The GitHub username (login) to look up, e.g. "dhh". User and organization handles are both
            accepted. An @handle or a profile URL of the
            form https://github.com/dhh is accepted and normalized to the login. Other URL shapes
            such as github.com/orgs/rails are not. The handle must be 1 to 39 letters, digits, or
            hyphens (older accounts can start or end with a hyphen) and must not be one of GitHub's
            reserved top-level routes such as "about" or "settings". Anything else returns a 400.
          schema:
            type: string
        - name: year
          in: query
          required: false
          description: >-
            Calendar year of contributions to return, from 1970 to the current year (e.g. 2024). The
            calendar then covers that whole year and the activity timeline shows its December, or the
            current month so far for the current year. Omit it for GitHub's default view of the last 12
            months. User accounts only. Organizations carry no contribution calendar. Supported with the
            overview tab only.
          schema:
            type: integer
            minimum: 1970
        - name: tab
          in: query
          required: false
          description: >-
            Profile tab to return. overview (default) is the profile page itself. repositories returns
            the account's full repository list, 30 rows per page, for users and organizations. stars returns
            a user's starred repositories and star lists, 30 rows per page. Organizations have no stars tab.
            On the repositories and stars tabs the response carries profile, the tab's list and pagination
            only.
          schema:
            type: string
            enum: ["overview", "repositories", "stars"]
            default: "overview"
        - name: page
          in: query
          required: false
          description: Page of the repositories tab to return, from 1 to 1000000. Supported with tab=repositories only.
          schema:
            type: integer
            minimum: 1
            maximum: 1000000
        - name: next_page_token
          in: query
          required: false
          description: >-
            Cursor for the next page of starred repositories, taken from pagination.next_page_token of the
            previous stars response. Supported with tab=stars only.
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        error:
          type: string
          description: Error message when the username does not resolve to a profile or the requested tab page has no rows
        profile:
          $ref: '#/components/schemas/Profile'
        pinned_repositories:
          type: array
          description: Repositories and gists the account pinned to its profile, in pinned order
          items:
            $ref: '#/components/schemas/Repository'
        popular_repositories:
          type: array
          description: Repositories from the "Popular repositories" section GitHub shows on a profile without pins
          items:
            $ref: '#/components/schemas/Repository'
        repositories:
          type: array
          description: >-
            Repository rows from an organization overview's preview list, or one page of the account's
            repository list with tab=repositories
          items:
            $ref: '#/components/schemas/OrgRepository'
        starred_repositories:
          type: array
          description: One page of the user's starred repositories, most recently starred first
          items:
            $ref: '#/components/schemas/StarredRepository'
        star_lists:
          type: array
          description: Star lists the user created to group starred repositories
          items:
            $ref: '#/components/schemas/StarList'
        pagination:
          $ref: '#/components/schemas/TabPagination'
        organizations:
          type: array
          description: >-
            Organization avatars on the profile, up to the 24 GitHub renders
            (additional_organizations_count counts the rest)
          items:
            $ref: '#/components/schemas/AccountAvatar'
        additional_organizations_count:
          type: integer
          description: Number of further organizations behind the "+ N more" chip after the Organizations row
        people:
          type: array
          description: >-
            Member avatars from the organization's People module, the preview of about twenty members
            GitHub renders
          items:
            $ref: '#/components/schemas/AccountAvatar'
        sponsors:
          type: array
          description: Public sponsors from the "Sponsors" avatar row, the preview of about a dozen tiles GitHub renders
          items:
            $ref: '#/components/schemas/AccountAvatar'
        additional_sponsors_count:
          type: integer
          description: Number of further sponsors behind the "+N" chip next to the Sponsors row
        sponsoring:
          type: array
          description: >-
            Accounts this profile sponsors, from the "Sponsoring" avatar row (profile.sponsoring_count
            holds the total)
          items:
            $ref: '#/components/schemas/AccountAvatar'
        achievements:
          type: array
          description: Achievement badges GitHub shows on the profile
          items:
            $ref: '#/components/schemas/Achievement'
        readme:
          $ref: '#/components/schemas/Readme'
        top_languages:
          type: array
          description: Languages from the organization's "Top languages" module
          items:
            $ref: '#/components/schemas/TopLanguage'
        topics:
          type: array
          description: Topics from the organization's "Most used topics" module
          items:
            type: string
        contributions:
          $ref: '#/components/schemas/Contributions'
          description: The contribution calendar with its activity overview and activity timeline
    SearchMetadata:
      type: object
      required: [id, status, created_at]
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: GitHub URL for this profile
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          description: Search engine used
        username:
          type: string
          description: The GitHub username that was looked up
        year:
          type: string
          description: The calendar year requested, as sent (e.g. "2024")
        tab:
          type: string
          description: The profile tab requested
        page:
          type: string
          description: The repositories tab page requested, as sent
        next_page_token:
          type: string
          description: The stars cursor sent
    Profile:
      type: object
      required: [login, id, avatar_url, link]
      properties:
        login:
          type: string
          description: The account's GitHub username
        id:
          type: integer
          description: GitHub account ID
        name:
          type: string
          description: Display name
        avatar_url:
          type: string
          description: Full-resolution avatar URL
        link:
          type: string
          description: Profile URL
        bio:
          type: string
          description: Profile bio, or the description GitHub renders under an organization's name
        company:
          type: string
          description: Company as GitHub shows it, without the @ when it is a single organization handle (e.g. "37signals")
        location:
          type: string
          description: Location, from the user sidebar or the organization header
        website:
          type: string
          description: Website URL from the profile sidebar or the organization header
        email:
          type: string
          description: Public contact email shown on the profile
        twitter_username:
          type: string
          description: X / Twitter handle from the linked social account
        followers:
          type: integer
          description: Follower count, approximate because GitHub renders large counts compact (e.g. 25.2k)
        following:
          type: integer
          description: Following count, approximate for large values
        repos:
          type: integer
          description: Exact public repository count
        starred_count:
          type: integer
          description: Exact number of repositories the user has starred
        projects_count:
          type: integer
          description: Exact public project count
        packages_count:
          type: integer
          description: Exact public package count
        members_count:
          type: integer
          description: Exact public member count of the organization
        status:
          $ref: '#/components/schemas/UserStatus'
        local_time:
          type: string
          description: The user's local time as the sidebar renders it, e.g. "10:58 (UTC +01:00)"
        utc_offset:
          type: number
          description: The user's timezone offset from UTC in hours (e.g. 1.0 or -7.0)
        is_organization:
          type: boolean
          description: Whether the account is an organization
        is_verified:
          type: boolean
          description: Whether GitHub has verified domains for the organization
        is_staff:
          type: boolean
          description: Whether GitHub labels the account as GitHub Staff
        is_sponsorable:
          type: boolean
          description: Whether the account has a GitHub Sponsors profile
        sponsoring_count:
          type: integer
          description: Exact number of accounts this profile sponsors
        sponsors_link:
          type: string
          description: URL of the account's GitHub Sponsors page, e.g. https://github.com/sponsors/simonw
        verified_domains:
          type: array
          description: Domains GitHub has verified for the organization, as listed behind its "Verified" badge
          items:
            type: string
        highlights:
          type: array
          description: Badges from the sidebar "Highlights" block, e.g. "Pro", "GitHub Star" or "Developer Program Member"
          items:
            type: string
        social_accounts:
          type: array
          description: Linked social accounts, from the user sidebar or the organization header
          items:
            $ref: '#/components/schemas/SocialAccount'
    SocialAccount:
      type: object
      required: [link]
      properties:
        provider:
          type: string
          description: Network name GitHub labels the link with (X, LinkedIn, Mastodon, Bluesky, Instagram, ...)
        link:
          type: string
          description: URL of the linked account
        label:
          type: string
          description: Display text of the link (e.g. the handle)
    Repository:
      type: object
      description: A pinned or popular card, which is a repository or a pinned gist (is_gist)
      required: [position]
      properties:
        position:
          type: integer
          description: Order of the card on the profile
        id:
          type: integer
          description: Numeric repository id, matching the REST API id
        name:
          type: string
          description: Repository name, or GitHub's truncated gist title for gist cards
        full_name:
          type: string
          description: Owner and repository name (e.g. vuejs/core)
        owner:
          $ref: '#/components/schemas/RepositoryOwner'
        link:
          type: string
          description: Repository (or gist) URL
        description:
          type: string
          description: Repository description, or the full gist title for gist cards
        language:
          type: string
          description: Primary language
        language_color:
          type: string
          description: Hex color GitHub assigns to the primary language
        stars:
          type: integer
          description: Stargazer count (approximate, rendered compact)
        forks:
          type: integer
          description: Fork count (approximate, rendered compact)
        visibility:
          type: string
          enum: ["public", "private", "internal"]
          description: Repository visibility
        is_gist:
          type: boolean
          description: Whether the card is a pinned gist
        is_fork:
          type: boolean
          description: Whether the repository is a fork
        forked_from:
          type: string
          description: The repository this fork was forked from (owner/name)
        is_archived:
          type: boolean
          description: Whether the repository is archived
    RepositoryOwner:
      type: object
      required: [login]
      properties:
        login:
          type: string
          description: Owner login
    OrgRepository:
      type: object
      description: >-
        A row from a repositories list, either an organization overview or the repositories tab of a
        user or organization, with exact counts
      required: [position, name, full_name, link]
      properties:
        position:
          type: integer
          description: Row order in the list
        id:
          type: integer
          description: Numeric repository id from an organization overview row, matching the REST API id
        name:
          type: string
          description: Repository name
        full_name:
          type: string
          description: Organization and repository name (e.g. rails/rails)
        link:
          type: string
          description: Repository URL
        description:
          type: string
          description: Repository description
        language:
          type: string
          description: Primary language
        language_color:
          type: string
          description: Hex color GitHub assigns to the primary language
        topics:
          type: array
          description: Topics GitHub shows for the repository
          items:
            type: string
        license:
          type: string
          description: License as GitHub labels it on that page, the SPDX id on an organization overview (e.g. MIT) and the license name on a repositories tab (e.g. MIT License)
        stars:
          type: integer
          description: Exact stargazer count
        forks:
          type: integer
          description: Exact fork count
        open_issues_count:
          type: integer
          description: Open issues count from an organization's overview or repositories tab row
        open_pull_requests_count:
          type: integer
          description: Open pull requests count from an organization's overview or repositories tab row
        good_first_issue_issues_count:
          type: integer
          description: Open issues labelled "good first issue" ("N issues need help")
        visibility:
          type: string
          enum: ["public", "private", "internal"]
          description: Repository visibility
        is_fork:
          type: boolean
          description: Whether the repository is a fork
        forked_from:
          type: string
          description: The repository this fork was forked from (owner/name)
        is_archived:
          type: boolean
          description: Whether the repository is archived
        pushed_at:
          type: string
          format: date-time
          description: >-
            Time of the last push in ISO 8601, the timestamp behind GitHub's "Updated" label (REST
            pushed_at, not updated_at)
    StarredRepository:
      type: object
      description: A repository from a user's stars tab
      required: [position, name, full_name, owner, link]
      properties:
        position:
          type: integer
          description: Row order on the page
        name:
          type: string
          description: Repository name
        full_name:
          type: string
          description: Owner and repository name (e.g. abue-ammar/tinycast)
        owner:
          $ref: '#/components/schemas/RepositoryOwner'
        link:
          type: string
          description: Repository URL
        description:
          type: string
          description: Repository description
        language:
          type: string
          description: Primary language
        language_color:
          type: string
          description: Hex color GitHub assigns to the primary language
        stars:
          type: integer
          description: Exact stargazer count
        forks:
          type: integer
          description: Exact fork count
        is_fork:
          type: boolean
          description: Whether the repository is a fork
        forked_from:
          type: string
          description: The repository this fork was forked from (owner/name)
        pushed_at:
          type: string
          format: date-time
          description: Time of the last push (ISO 8601), behind GitHub's "Updated" label
    StarList:
      type: object
      description: A star list the user created
      required: [name, link]
      properties:
        name:
          type: string
          description: List name
        description:
          type: string
          description: Description the user wrote for the list
        link:
          type: string
          description: URL of the list
        repositories_count:
          type: integer
          description: Number of repositories in the list
    TabPagination:
      type: object
      description: >-
        Pagination of the repositories tab, paged by number (pass page), and of the stars tab, paged by
        cursor (pass next_page_token)
      properties:
        current:
          type: integer
          description: Current page of the repositories tab
        total_pages:
          type: integer
          description: Total pages of an organization's repositories tab
        next_page_token:
          type: string
          description: Cursor for the next stars page, to send as next_page_token
        next:
          type: string
          description: GitHub URL of the next page
        previous:
          type: string
          description: GitHub URL of the previous page
    AccountAvatar:
      type: object
      description: >-
        One account tile from an avatar row, which is an organization membership, an organization
        member, a sponsor or a sponsored account
      required: [login, link, avatar_url]
      properties:
        login:
          type: string
          description: Account login
        id:
          type: integer
          description: Account id, matching the REST API id
        link:
          type: string
          description: Profile URL
        avatar_url:
          type: string
          description: Full-size avatar URL (GitHub's s= size parameter removed), the same form as profile.avatar_url
    UserStatus:
      type: object
      description: The user's status banner
      required: [message]
      properties:
        emoji:
          type: string
          description: Status emoji
        message:
          type: string
          description: Status message
        is_busy:
          type: boolean
          description: Whether the user marked the status as busy (limited availability)
    TopLanguage:
      type: object
      required: [name, link]
      properties:
        name:
          type: string
          description: Language name
        color:
          type: string
          description: Hex color GitHub assigns to the language
        link:
          type: string
          description: The organization's repositories filtered to this language
    Achievement:
      type: object
      required: [slug, tier, link]
      properties:
        name:
          type: string
          description: Display name (e.g. "Pull Shark")
        slug:
          type: string
          description: Machine identifier (e.g. "pull-shark")
        tier:
          type: integer
          description: Multiplier for the achievement (1 when earned once)
        image:
          type: string
          description: Badge image URL
        link:
          type: string
          description: URL to the achievement on the user's profile
    Readme:
      type: object
      description: The profile README
      properties:
        text:
          type: string
          description: Plain text of the profile README
        html:
          type: string
          description: >-
            The profile README as rendered HTML, with relative links and image sources made absolute and
            in-page anchors kept
        link:
          type: string
          description: >-
            URL of the file the README renders from, the {login}/{login} repository for a user or the
            .github repository's profile/README.md for an organization
    Contributions:
      type: object
      description: >-
        The contribution calendar for the last 12 months or the requested year, with GitHub's activity
        timeline for one month of it
      required: [total, from, to, calendar, years]
      properties:
        total:
          type: integer
          description: Total contributions over the calendar (0 for inactive accounts)
        private_contributions:
          type: integer
          description: >-
            Contributions in private repositories during the activity window (activity_from to
            activity_to), counted by GitHub but not listed in activity
        from:
          type: string
          format: date
          description: First day covered by the calendar
        to:
          type: string
          format: date
          description: Last day covered by the calendar
        calendar:
          type: array
          description: One entry per calendar day, in chronological order
          items:
            $ref: '#/components/schemas/ContributionDay'
        activity_overview:
          $ref: '#/components/schemas/ActivityOverview'
        activity_from:
          type: string
          format: date
          description: >-
            First day of the activity timeline window, the current month so far or the December of a
            requested past year
        activity_to:
          type: string
          format: date
          description: Last day of the activity timeline window
        activity:
          type: array
          description: >-
            The activity timeline for the activity window as blocks in GitHub's order, where one
            contribution type can fill several blocks (e.g. two highlight blocks)
          items:
            $ref: '#/components/schemas/ActivityBlock'
        years:
          type: array
          description: The years GitHub's year selector links to, newest first, which can include years without contributions
          items:
            type: integer
    ActivityOverview:
      type: object
      description: The opt-in "Activity overview" panel with highlighted repositories and the activity split
      properties:
        contributed_repositories:
          type: array
          description: The repositories GitHub highlights in the "Contributed to" sentence (owner/name)
          items:
            type: string
        other_repositories_count:
          type: integer
          description: The "and N other repositories" long-tail count
        percentages:
          type: object
          description: How the year's activity splits across contribution types (integer percentages)
          properties:
            commits:
              type: integer
              description: Percent of activity that was commits
            pull_requests:
              type: integer
              description: Percent of activity that was pull requests
            code_review:
              type: integer
              description: Percent of activity that was code review
            issues:
              type: integer
              description: Percent of activity that was issues
        organizations:
          type: array
          description: Organizations the year's contributions happened in (can differ from memberships)
          items:
            type: object
            required: [login, link]
            properties:
              login:
                type: string
                description: Organization login
              link:
                type: string
                description: Organization URL
    ActivityBlock:
      type: object
      description: >-
        One block of the activity timeline, grouping a single contribution type for the period with its
        contributions in items
      required: [type, title, items]
      properties:
        type:
          type: string
          enum: ["commits", "repositories", "pull_requests", "pull_request_reviews", "issues", "discussions", "answered_discussions", "highlight"]
          description: >-
            The contribution type the block groups, where highlight is a single pull request or issue
            GitHub features for the discussion it drew
        title:
          type: string
          description: >-
            GitHub's own summary line for the block, e.g. "Created 274 commits in 24 repositories" or
            "Created a pull request in simonw/llm that received 10 comments".
        count:
          type: integer
          description: How many contributions of this type the block covers, parsed out of title
        repositories_count:
          type: integer
          description: How many repositories those contributions span, parsed out of title
        items:
          type: array
          description: >-
            One row per repository in a commits block and per contribution in other blocks, in GitHub's
            order and capped by GitHub on long lists
          items:
            $ref: '#/components/schemas/ActivityItem'
    ActivityItem:
      type: object
      description: A single contribution inside an activity block
      required: [position, repository, link]
      properties:
        position:
          type: integer
          description: Order of the row within its block
        title:
          type: string
          description: Pull request, issue or discussion title
        repository:
          type: string
          description: Owner and repository the contribution belongs to (e.g. simonw/llm)
        link:
          type: string
          description: URL of the contribution, which is the pull request, issue, discussion or repository
        state:
          type: string
          description: State of the pull request or issue as a lowercase word (open, closed, merged or draft)
        language:
          type: string
          description: Primary language of a created repository
        commits:
          type: integer
          description: Commits the user made to this repository in the period
        comments:
          type: integer
          description: Comments the contribution received
        description:
          type: string
          description: GitHub's truncated preview of the body text
        date:
          type: string
          description: >-
            The day GitHub renders for the contribution, as shown and relative to the year in view (e.g.
            "Aug 27")
    ContributionDay:
      type: object
      required: [date, count, level]
      properties:
        date:
          type: string
          format: date
          description: Day in YYYY-MM-DD
        count:
          type: integer
          description: Number of contributions on this day
        level:
          type: integer
          description: GitHub's 0-4 intensity bucket for the day
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message
