{
  "openapi": "3.0.1",
  "info": {
    "title": "GitHub Repo & Trending Scraper (official API)",
    "description": "GitHub repositories scraper for public repository research. Export repository metadata as JSON, with optional contributor rows from the GitHub API.",
    "version": "1.0",
    "x-build-id": "dEt2ffHTRX1NeouaI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~github-repo-trending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-github-repo-trending-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/grit-77~github-repo-trending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-github-repo-trending-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/grit-77~github-repo-trending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-github-repo-trending-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "repos",
              "trending"
            ],
            "type": "string",
            "description": "search = GitHub repository search with filters. repos = details for a list of owner/repo. trending = repos created in the last N days sorted by stars, computed from the GitHub Search API (this is NOT the GitHub trending page, which has no official API).",
            "default": "search"
          },
          "query": {
            "title": "Search text",
            "type": "string",
            "description": "Free-text search terms (mode search, optional in trending), e.g. `web scraping`. GitHub search syntax is allowed, e.g. `in:readme llm agent`."
          },
          "repositories": {
            "title": "Repositories (mode repos)",
            "type": "array",
            "description": "owner/repo names or github.com URLs, e.g. `apify/crawlee` or `https://github.com/psf/requests`.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Primary language filter, e.g. `Python`, `TypeScript` (modes search and trending)."
          },
          "topic": {
            "title": "Topic",
            "type": "string",
            "description": "Only repositories carrying this topic, e.g. `machine-learning`."
          },
          "minStars": {
            "title": "Minimum stars",
            "minimum": 0,
            "type": "integer",
            "description": "Keep repos with at least this many stars."
          },
          "maxStars": {
            "title": "Maximum stars",
            "minimum": 0,
            "type": "integer",
            "description": "Keep repos with at most this many stars."
          },
          "createdAfter": {
            "title": "Created on or after",
            "type": "string",
            "description": "Date YYYY-MM-DD."
          },
          "createdBefore": {
            "title": "Created on or before",
            "type": "string",
            "description": "Date YYYY-MM-DD."
          },
          "pushedAfter": {
            "title": "Last pushed on or after",
            "type": "string",
            "description": "Date YYYY-MM-DD. Useful to drop abandoned repos."
          },
          "pushedBefore": {
            "title": "Last pushed on or before",
            "type": "string",
            "description": "Date YYYY-MM-DD."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "best-match",
              "stars",
              "forks",
              "help-wanted-issues",
              "updated"
            ],
            "type": "string",
            "description": "Sort order for search mode (trending always sorts by stars).",
            "default": "stars"
          },
          "order": {
            "title": "Order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction for search mode.",
            "default": "desc"
          },
          "trendingDays": {
            "title": "Trending window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Mode trending: repositories created in the last N days, ranked by stars.",
            "default": 7
          },
          "maxItems": {
            "title": "Max repositories",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on repository rows (the GitHub search API itself returns at most 1000 per query). Contributor rows are not counted here.",
            "default": 50
          },
          "includeLanguages": {
            "title": "Languages breakdown",
            "type": "boolean",
            "description": "Bytes per language. Costs 1 extra API call per repo.",
            "default": true
          },
          "includeLatestRelease": {
            "title": "Latest release",
            "type": "boolean",
            "description": "Tag, name and date of the latest release. 1 extra API call per repo.",
            "default": true
          },
          "includeLastCommit": {
            "title": "Last commit date",
            "type": "boolean",
            "description": "Date of the newest commit on the default branch. 1 extra API call per repo.",
            "default": true
          },
          "includeContributorsCount": {
            "title": "Contributors count",
            "type": "boolean",
            "description": "Number of contributors (anonymous included). 1 extra API call per repo.",
            "default": true
          },
          "includeReadme": {
            "title": "README excerpt",
            "type": "boolean",
            "description": "First characters of the README as plain text. 1 extra API call per repo.",
            "default": false
          },
          "readmeChars": {
            "title": "README excerpt length",
            "minimum": 50,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum characters kept from the README when the README excerpt is on.",
            "default": 500
          },
          "enrichSearchResults": {
            "title": "Enrich search/trending rows",
            "type": "boolean",
            "description": "Search results already carry stars, forks, license, topics and dates. Turn this on to also fetch the optional extras above (languages, release, last commit, contributors count, README, watchers) for every search/trending row. Mode repos always enriches.",
            "default": false
          },
          "includeContributors": {
            "title": "Top contributors as separate rows",
            "type": "boolean",
            "description": "Emit one `contributor` row per top contributor (login and contribution count only, no emails). 1 extra API call per repo.",
            "default": false
          },
          "maxContributorsPerRepo": {
            "title": "Contributors per repo",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many top contributors to emit per repository when contributor rows are on.",
            "default": 10
          },
          "githubToken": {
            "title": "GitHub token (optional)",
            "type": "string",
            "description": "A personal access token with no scopes is enough for public data. Without it GitHub allows only 60 core requests/hour and 10 search requests/minute per IP, so large runs stop early with a clear message. With it: 5,000/hour and 30 search requests/minute. The token is only sent to api.github.com and is never stored or logged."
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel repositories processed at once. Keep low without a token.",
            "default": 4
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}