{
  "openapi": "3.0.1",
  "info": {
    "title": "Discord Server Scraper — Invite Resolver & Directory Search",
    "description": "Resolve Discord invite links in bulk to server profiles (member and online counts, creation date, flags, features), or search Top.gg and Disboard by keyword. No login, no bot token. MCP-ready.",
    "version": "0.5",
    "x-build-id": "jJiOWBBlELlpygcUb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~discord-all-in-one-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-discord-all-in-one-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/khadinakbar~discord-all-in-one-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-discord-all-in-one-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/khadinakbar~discord-all-in-one-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-discord-all-in-one-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scrape mode",
            "enum": [
              "resolve",
              "search",
              "channels",
              "emojis",
              "bulk"
            ],
            "type": "string",
            "description": "What to do. 'resolve' (or 'bulk') turns invite URLs, codes or vanity slugs into server profiles via Discord's public invite API. 'search' finds servers by keyword or tag on Top.gg and Disboard. 'channels' also returns the channel list for servers with the public widget on. 'emojis' tries custom emojis and stickers (best effort). Default 'resolve'.",
            "default": "resolve"
          },
          "inviteUrls": {
            "title": "Invite URLs / codes / vanity slugs",
            "uniqueItems": true,
            "type": "array",
            "description": "Discord invite URLs (https://discord.gg/xyz, https://discord.com/invite/xyz), bare invite codes (xyz) or vanity slugs (discord-developers). Used by resolve, bulk, channels and emojis. Ignored in search mode. Server IDs alone cannot be looked up without a Discord login.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search keyword or tag",
            "type": "string",
            "description": "Keyword or tag to look up on Top.gg and Disboard in search mode, for example 'anime', 'crypto', 'ai art'. Top.gg matches the keyword as a tag; Disboard matches tags and free text. For one specific server use resolve mode with its invite instead. Default 'crypto'.",
            "default": "crypto"
          },
          "searchSources": {
            "title": "Directory sources to query",
            "uniqueItems": true,
            "type": "array",
            "description": "Directories to search in search mode. Top.gg lists member counts. Disboard lists online counts and real server IDs. If one directory is blocked the other still runs; if every directory is blocked the run fails and charges nothing.",
            "items": {
              "type": "string",
              "enum": [
                "disboard",
                "topgg"
              ],
              "enumTitles": [
                "Disboard.org (online counts, server IDs, tags)",
                "Top.gg (member counts, ratings)"
              ]
            },
            "default": [
              "topgg",
              "disboard"
            ]
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum servers returned and charged. In search mode this caps the directory results; with minMembers/minOnline the Actor reads up to 3x this many candidates to find enough matches. Default 100, max 10000.",
            "default": 100
          },
          "enrichWithInviteApi": {
            "title": "Enrich directory results via Invite API",
            "type": "boolean",
            "description": "When true (default), directory results that expose an invite code are also resolved through Discord for live member and online counts, features and boost tier. Directories rarely show invite codes, so also turn on 'Find invite codes' for full profiles.",
            "default": true
          },
          "findInviteCodes": {
            "title": "Find invite codes for directory results",
            "type": "boolean",
            "description": "Search mode only. When true, each Top.gg result is followed to its public invite and resolved through Discord for the full live profile (exact member count, online count, features, creation date). Disboard does not publish invites, so Disboard rows keep directory data. Adds one page fetch per Top.gg server; the price per server stays the same. Default false.",
            "default": false
          },
          "includeChannels": {
            "title": "Include channels, online members and presence (when widget is on)",
            "type": "boolean",
            "description": "When true, reads each server's public widget. Returns the channel list, widget online count, an instant invite link and a sample of up to 25 online members (username and status only). Only servers with the widget enabled return data; about 1 in 10 do. Adds one request per server. Default false.",
            "default": false
          },
          "includeEmojisStickers": {
            "title": "Include custom emojis and stickers (best-effort)",
            "type": "boolean",
            "description": "Best effort: tries Discord's guild preview for custom emojis and stickers. Discord requires a login for most servers, so the lists are usually empty. Default false.",
            "default": false
          },
          "minMembers": {
            "title": "Minimum members",
            "minimum": 0,
            "type": "integer",
            "description": "Skip servers with fewer members than this. Skipped servers are not charged. Leave empty for no limit."
          },
          "minOnline": {
            "title": "Minimum online members",
            "minimum": 0,
            "type": "integer",
            "description": "Skip servers with fewer members online than this. Skipped servers are not charged. Leave empty for no limit."
          },
          "monitorMode": {
            "title": "Monitor mode — member change since last check",
            "type": "boolean",
            "description": "When true, each row also shows the member count from your previous check of the same server (previousMemberCount, memberChange, memberChangePct). Counts are saved in a key-value store named 'discord-server-monitor' in your account, so schedule the Actor daily or weekly to track growth. First check shows empty change fields. Default false.",
            "default": false
          },
          "includeDeadInvites": {
            "title": "Return dead or expired invites as rows",
            "type": "boolean",
            "description": "When true (default), invites Discord reports as expired, invalid or unreachable come back as a row with status NOT_FOUND or LOOKUP_FAILED so you can clean your list. These rows are not charged.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Used only as a backup if Discord refuses the Actor's direct connection. Leave the default.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}