{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon & Lemmy Scraper: Fediverse Posts, Profiles, Comments",
    "description": "Scrape Mastodon and Lemmy with no login or API key: hashtag posts across many servers, account posts, profiles, followers, trending posts & hashtags, replies, Lemmy keyword search, community posts, comments and communities. Bio email/website extraction. JSON, CSV, Excel.",
    "version": "1.0",
    "x-build-id": "hpeeYZaB7h3NasZbb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spriggs-data~fediverse-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spriggs-data-fediverse-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/spriggs-data~fediverse-scraper/runs": {
      "post": {
        "operationId": "runs-sync-spriggs-data-fediverse-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/spriggs-data~fediverse-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-spriggs-data-fediverse-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": "What to scrape",
            "enum": [
              "hashtagPosts",
              "accountPosts",
              "profiles",
              "followers",
              "following",
              "searchAccounts",
              "trendingPosts",
              "trendingHashtags",
              "postReplies",
              "lemmySearch",
              "lemmyCommunityPosts",
              "lemmyPostComments",
              "lemmyCommunities"
            ],
            "type": "string",
            "description": "Mastodon modes use 'Hashtags', 'Accounts', 'Search terms' or 'URLs' plus 'Mastodon servers'. Lemmy modes use 'Search terms', 'Communities' or 'URLs' plus 'Lemmy servers'.",
            "default": "hashtagPosts"
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Without or with #, e.g. tattoo, opensource. Used by 'posts with a #hashtag'.",
            "default": [
              "tattoo"
            ],
            "items": {
              "type": "string"
            }
          },
          "instances": {
            "title": "Mastodon servers",
            "type": "array",
            "description": "Servers to read from, e.g. mastodon.social, fosstodon.org, hachyderm.io, mstdn.social. Each server shows the hashtag posts it knows about; adding more servers finds more posts (duplicates are removed). Also used for account search and trends.",
            "default": [
              "mastodon.social"
            ],
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Mastodon accounts",
            "type": "array",
            "description": "@user@server, user@server or a profile URL like https://mastodon.social/@Gargron. Used by account posts, profiles, followers and following.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Mastodon: people search (names, bios). Lemmy: full-text search of posts, comments or communities. (Logged-out Mastodon has no full-text post search; use hashtags.)",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Mastodon post URL (https://server/@user/123...) for 'replies'; Lemmy post URL (https://lemmy.world/post/123) for 'comments'.",
            "items": {
              "type": "string"
            }
          },
          "lemmyInstances": {
            "title": "Lemmy servers",
            "type": "array",
            "description": "e.g. lemmy.world, lemmy.ml, sh.itjust.works, lemm.ee. Search runs on each server (duplicates removed).",
            "default": [
              "lemmy.world"
            ],
            "items": {
              "type": "string"
            }
          },
          "communities": {
            "title": "Lemmy communities",
            "type": "array",
            "description": "!technology@lemmy.world, technology@lemmy.world or https://lemmy.world/c/technology.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerInput": {
            "title": "Max items per input",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit for each hashtag / account / search term / community / URL (per server for trends).",
            "default": 100
          },
          "maxItems": {
            "title": "Max total items",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap for the whole run (keeps cost predictable). 0 = no cap.",
            "default": 1000
          },
          "since": {
            "title": "Posted since (YYYY-MM-DD)",
            "type": "string",
            "description": "Only posts/comments created on or after this date."
          },
          "until": {
            "title": "Posted before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only posts/comments created before this date."
          },
          "language": {
            "title": "Language (Mastodon)",
            "type": "string",
            "description": "ISO code like en, de, ja. Keeps only Mastodon posts in that language."
          },
          "excludeReplies": {
            "title": "Exclude replies (Mastodon)",
            "type": "boolean",
            "description": "Skip posts that are replies.",
            "default": false
          },
          "excludeBoosts": {
            "title": "Exclude boosts (Mastodon)",
            "type": "boolean",
            "description": "Skip boosts (reposts) in account posts.",
            "default": false
          },
          "onlyMedia": {
            "title": "Only posts with media (Mastodon)",
            "type": "boolean",
            "description": "Hashtag and account posts with images/video only.",
            "default": false
          },
          "lemmySort": {
            "title": "Lemmy sort",
            "enum": [
              "New",
              "Hot",
              "Active",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopYear",
              "TopAll",
              "MostComments",
              "NewComments",
              "Old"
            ],
            "type": "string",
            "description": "Order for Lemmy search and community posts. 'New' lets the date filter stop early.",
            "default": "New"
          },
          "lemmySearchType": {
            "title": "Lemmy search returns",
            "enum": [
              "Posts",
              "Comments",
              "Communities"
            ],
            "type": "string",
            "description": "For 'Lemmy: keyword search'.",
            "default": "Posts"
          },
          "lemmyCommunity": {
            "title": "Limit Lemmy search to one community",
            "type": "string",
            "description": "Optional, e.g. technology@lemmy.world."
          },
          "extractContacts": {
            "title": "Extract emails & websites from bios",
            "type": "boolean",
            "description": "Adds emails[] and websites[] to Mastodon profiles (from the bio and profile links).",
            "default": false
          },
          "skipNsfw": {
            "title": "Skip NSFW",
            "type": "boolean",
            "description": "Skip Lemmy posts/communities marked NSFW and Mastodon posts whose media is marked sensitive.",
            "default": true
          },
          "respectNoIndex": {
            "title": "Respect search opt-outs",
            "type": "boolean",
            "description": "Skip Mastodon accounts that opted out of search-engine indexing (noindex).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}