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

# GitHub Intelligence

> Developers' public GitHub for hiring: repositories, stars, tech stack, contributions and pull requests, 5 credits per profile.

Send up to 10 GitHub usernames or links in `profiles`. Each result has a `status`, and a `profile` when the developer was found.

```bash theme={null}
curl -X POST 'https://api.enricho.co/api/directory/github/profiles' \
  -H 'Authorization: Bearer enr_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"profiles":["https://github.com/octocat","@torvalds"]}'
```

Any of these work, as pasted: `octocat`, `@octocat`, `github.com/octocat`, `https://github.com/octocat`, or a link to one of their repositories. Different spellings of one login count once.

## What a profile holds

| Section | What it answers |
| - | - |
| Profile | Name, bio, company, location, website, X, whether they're open to hire, account age and followers. |
| Repositories | Public repositories (forks included) and original ones, total stars and forks, and the most starred, with language, topics and last push. |
| `tech_stack` | Share of code per language across their recently updated original repositories, and their most used topics. |
| `activity` | The last 12 months: contributions, commits, pull requests, reviews, issues, active days and weeks, streaks, last active day, and contributions per week. Private contributions are counted but never detailed. |
| `pull_requests` | Pull requests opened and merged, and **`merged_external`**: how many were merged into repositories they don't own, with the projects (`top_external`). |
| `highlights` | The notable facts in plain English, strongest open source signal first. They state what GitHub shows; they never judge the person. |

## Statuses

| `status` | Meaning | Charged |
| - | - | - |
| `found` | The developer's profile is in `profile`. | 5 credits |
| `not_found` | No GitHub user has this login (it may be an organization, or renamed). | Free |
| `invalid` | The value isn't a GitHub username or github.com link. | Free |
| `rate_limited` | GitHub's hourly limit was reached. Try again in a few minutes. | Free |
| `unavailable` | GitHub didn't answer. Try again in a moment. | Free |

`rate_limited` and `unavailable` never mean the developer doesn't exist.

## Pricing

Each profile found costs 5 credits. Everything else is free, and so is a profile you looked up in the last year. Profiles are refreshed from GitHub at most once a day.

## Limits

* Up to 10 profiles per request.
* Public GitHub data only. Work in private or company repositories usually isn't visible, so little public activity doesn't mean little experience. Judge candidates on their work, never on their name, photo or location.


## OpenAPI

````yaml api-reference/openapi.json POST /api/directory/github/profiles
openapi: 3.1.0
info:
  title: Enricho Public REST API
  version: 1.0.0
  description: >-
    Public directory search and billing APIs. Every search costs 5 credits per
    new record; usage calls use no credits. The REST API has no previews:
    sending preview true returns 422. Request and response contracts reflect the
    current public gateway and service handlers.
servers:
  - url: https://api.enricho.co
security:
  - apiKey: []
  - headerKey: []
tags:
  - name: Directory
  - name: Billing
paths:
  /api/directory/github/profiles:
    post:
      tags:
        - Directory
      summary: GitHub Intelligence
      description: >-
        Read 1-10 developers' public GitHub profiles, for hiring: profile,
        account age and followers; original repositories, total stars and forks
        and the most starred; tech stack (share of code per language) and
        topics; the last 12 months of contributions (commits, pull requests,
        reviews, issues, active weeks, streaks, last active); and pull requests,
        including how many were merged into repositories the developer doesn't
        own and which projects. Send GitHub usernames or github.com links as
        pasted. Each profile found costs 5 credits; a profile not found, an
        invalid value, a lookup GitHub didn't answer (rate_limited, unavailable)
        and any profile the caller looked up in the last year are free. Results
        are released only after an atomic debit is confirmed. Public GitHub data
        only: private and company work usually isn't visible.
      operationId: githubProfiles
      requestBody:
        required: true
        description: 'Send JSON with Content-Type: application/json.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitHubProfileRequest'
            examples:
              one:
                summary: Is this developer worth interviewing?
                value:
                  profiles:
                    - https://github.com/octocat
              compare:
                summary: Compare candidates
                value:
                  profiles:
                    - octocat
                    - '@torvalds'
                    - github.com/gaearon
      responses:
        '200':
          description: Success envelope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  result:
                    $ref: '#/components/schemas/GitHubProfileResponse'
                  message:
                    type: string
                required:
                  - success
                  - result
                  - message
        '400':
          description: 'bad_request: malformed JSON.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 'unauthorized: missing, invalid or revoked API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            insufficient_credits: insufficient balance for the profiles found.
            No results returned and no credits deducted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: 'method_not_allowed: this route takes POST.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: 'payload_too_large: the body is over 1 MiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            validation_failed: no profiles, more than 10 profiles, unknown
            fields or wrong types. A rejected request costs nothing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            rate_limited: key, account or IP request limit exceeded; wait a
            minute before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'internal: unexpected server failure.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: 'upstream_unavailable: gateway could not reach the service.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            upstream_unavailable: GitHub Intelligence is off or GitHub can't be
            reached, or the credit charge couldn't be confirmed. Nothing was
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GitHubProfileRequest:
      type: object
      additionalProperties: false
      required:
        - profiles
      properties:
        profiles:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: string
            maxLength: 300
          description: >-
            GitHub usernames or github.com links: "octocat", "@octocat",
            "https://github.com/octocat". Duplicates count once.
    GitHubProfileResponse:
      type: object
      required:
        - results
        - credits_used
        - already_purchased
        - note
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/GitHubResult'
        credits_used:
          type: integer
        already_purchased:
          type: integer
          description: Profiles looked up in the last year, free this time.
        note:
          type: string
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        result:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
          required:
            - code
        message:
          type: string
          description: Human-readable error; do not parse this as a stable identifier.
      required:
        - success
        - result
        - message
    GitHubResult:
      type: object
      required:
        - query
        - status
      properties:
        query:
          type: string
          description: The value sent, as given.
        login:
          type: string
        status:
          type: string
          enum:
            - found
            - not_found
            - invalid
            - rate_limited
            - unavailable
          description: >-
            Only found is charged. rate_limited and unavailable mean try again
            later; they never mean the user doesn't exist.
        reason:
          type: string
        profile:
          $ref: '#/components/schemas/GitHubProfile'
    GitHubProfile:
      type: object
      required:
        - login
        - url
        - stars_total
        - activity
        - pull_requests
      properties:
        login:
          type: string
        name:
          type: string
        url:
          type: string
        avatar_url:
          type: string
        bio:
          type: string
        company:
          type: string
        location:
          type: string
        website:
          type: string
        x_url:
          type: string
        hireable:
          type: boolean
          description: They marked themselves available for hire on GitHub.
        account_created_at:
          type: string
          format: date
        account_age_years:
          type: number
        followers:
          type: integer
        following:
          type: integer
        public_repos:
          type: integer
          description: Forks included.
        original_repos:
          type: integer
          description: Not forks.
        stars_total:
          type: integer
          description: Across their 100 most starred original repositories.
        forks_total:
          type: integer
        organizations:
          type: array
          items:
            type: object
            properties:
              login:
                type: string
              name:
                type: string
              url:
                type: string
        top_repos:
          type: array
          items:
            $ref: '#/components/schemas/GitHubRepo'
        tech_stack:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              percent:
                type: number
              repos:
                type: integer
        topics:
          type: array
          items:
            type: string
        activity:
          $ref: '#/components/schemas/GitHubActivity'
        pull_requests:
          $ref: '#/components/schemas/GitHubPullRequests'
        highlights:
          type: array
          items:
            type: string
          description: >-
            Notable facts in plain English; they state what GitHub shows and
            never judge the person.
    GitHubRepo:
      type: object
      required:
        - name
        - url
        - stars
        - forks
        - topics
        - archived
      properties:
        name:
          type: string
        url:
          type: string
        description:
          type: string
        stars:
          type: integer
        forks:
          type: integer
        language:
          type: string
        topics:
          type: array
          items:
            type: string
        archived:
          type: boolean
        pushed_at:
          type: string
          format: date
    GitHubActivity:
      type: object
      description: The last 12 months, from GitHub's contribution calendar.
      properties:
        from:
          type: string
          format: date
        to:
          type: string
          format: date
        total_contributions:
          type: integer
        commits:
          type: integer
        pull_requests:
          type: integer
        reviews:
          type: integer
        issues:
          type: integer
        repos_with_commits:
          type: integer
        private_contributions:
          type: integer
          description: Counted by GitHub, details not public.
        active_days:
          type: integer
        active_weeks:
          type: integer
        longest_streak_days:
          type: integer
        current_streak_days:
          type: integer
        last_active_on:
          type: string
          format: date
        weekly:
          type: array
          items:
            type: integer
          description: Contributions per week, oldest first.
    GitHubPullRequests:
      type: object
      properties:
        total:
          type: integer
          description: Opened, all time.
        merged:
          type: integer
        merged_external:
          type: integer
          description: 'Merged into repositories they don''t own: the open source signal.'
        other_repos_contributed_to:
          type: integer
          description: >-
            Repositories outside their own with their recent commits or pull
            requests.
        top_external:
          type: array
          items:
            $ref: '#/components/schemas/GitHubExternalRepo'
    GitHubExternalRepo:
      type: object
      required:
        - repo
        - url
        - stars
        - merged_prs
      properties:
        repo:
          type: string
          description: owner/name
        url:
          type: string
        stars:
          type: integer
        merged_prs:
          type: integer
          description: >-
            Among the developer's latest 50 merged pull requests to others'
            repositories.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Enricho API key (enr_...)
    headerKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        An Enricho API key (enr_...). Use this or Authorization: Bearer, not
        both.

````

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