{
  "openapi": "3.0.1",
  "info": {
    "title": "GitHub AI/ML Trending Scraper",
    "description": "Scrape trending GitHub repositories filtered to AI/ML projects, with real star gains per period (today/week/month).",
    "version": "0.1",
    "x-build-id": "2hvaEPsD0uy7FVf8O"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/serge_esteves-ai~github-ai-trending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-serge_esteves-ai-github-ai-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/serge_esteves-ai~github-ai-trending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-serge_esteves-ai-github-ai-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/serge_esteves-ai~github-ai-trending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-serge_esteves-ai-github-ai-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": {
          "since": {
            "title": "Time range",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "type": "string",
            "description": "Trending period, exactly like the tabs on github.com/trending.",
            "default": "daily"
          },
          "languages": {
            "title": "Programming languages",
            "type": "array",
            "description": "GitHub trending language slugs to scrape (e.g. `python`, `jupyter-notebook`, `typescript`, `rust`, `c++`). Each becomes one page github.com/trending/<slug>, and GitHub returns ~25 repos per page — so listing several languages returns more candidates. Leave empty to scrape the single all-languages trending page.",
            "default": [
              "python",
              "jupyter-notebook"
            ],
            "items": {
              "type": "string"
            }
          },
          "aiOnly": {
            "title": "AI/ML repositories only",
            "type": "boolean",
            "description": "When enabled, keep only repositories related to AI, machine learning, LLMs, deep learning, agents, etc. Classification uses a built-in dictionary of GitHub topic tags AND name/description keywords (a repo matches if either hits). Turn off to return every trending repo. To filter by your own criteria instead, use the two fields below.",
            "default": true
          },
          "filterTopics": {
            "title": "Filter by topics",
            "type": "array",
            "description": "Keep only repos that have at least one of these GitHub topic tags (OR match). Examples: `mcp`, `rag`, `computer-vision`, `web-scraping`, `devops`, `game-engine`. Requires topic data, so enabling this fetches topics from the GitHub API. Leave empty to skip topic filtering. Combined with the other filters using AND.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filterKeywords": {
            "title": "Filter by keywords",
            "type": "array",
            "description": "Keep only repos whose NAME or DESCRIPTION contains at least one of these words (OR match, whole-word, case-insensitive). Examples: `langchain`, `diffusion`, `agent`, `scraper`, `kubernetes`. Leave empty to skip keyword filtering. Combined with the other filters using AND.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeMetadata": {
            "title": "Enrich with GitHub API metadata",
            "type": "boolean",
            "description": "Fetch extra fields per repo from the GitHub API (topics, license, homepage, open issues, created/pushed dates, watchers). Automatically enabled when the AI/ML filter or topic filtering is used.",
            "default": false
          },
          "maxRepos": {
            "title": "Max repositories",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of repositories to output after filtering (0 = no limit). Results are sorted by star gain in the selected period, descending.",
            "default": 100
          },
          "githubToken": {
            "title": "GitHub token (optional)",
            "type": "string",
            "description": "Optional personal access token (read-only / public scope is enough). Only used to raise the GitHub API rate limit from 60 to 5000 requests/hour for metadata and topic enrichment. Never stored in the code — provided per run and treated as a secret."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used to fetch the github.com/trending pages.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}