{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon & Lemmy Scraper: Posts, Threads, Trends & Servers",
    "description": "Scrape Mastodon and Lemmy (fediverse) with no login: hashtag and account posts, threads, who liked or boosted, trending posts, hashtags and links, Lemmy communities, posts, full comment trees, search, server activity, rules, domain blocks and the Lemmy moderation log.",
    "version": "0.1",
    "x-build-id": "5Mmix4NjJZYuejyMw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/powernaner~mastodon-lemmy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-powernaner-mastodon-lemmy-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/powernaner~mastodon-lemmy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-powernaner-mastodon-lemmy-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/powernaner~mastodon-lemmy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-powernaner-mastodon-lemmy-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": {
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Posts with these hashtags, newest first, from every server in 'Mastodon servers'. The same post seen on several servers is returned once (matched by its global id). With or without #.",
            "items": {
              "type": "string"
            }
          },
          "mastodonServers": {
            "title": "Mastodon servers",
            "type": "array",
            "description": "Mastodon is federated: each server only sees the posts that reached it. Hashtags, trends, link search and account search run on every server listed here (up to 20). Accounts and post URLs always go to their own server. Default: mastodon.social.",
            "items": {
              "type": "string"
            }
          },
          "mastodonAccounts": {
            "title": "Accounts",
            "type": "array",
            "description": "Profile (with featured hashtags) and posts. @user@server, user@server or a profile URL. A bare username uses the first server above.",
            "items": {
              "type": "string"
            }
          },
          "mastodonPostUrls": {
            "title": "Post URLs (with full thread)",
            "type": "array",
            "description": "The post plus its whole thread (parents and replies). Each thread row has threadOfUri set to the post you asked for.",
            "items": {
              "type": "string"
            }
          },
          "sharedLinks": {
            "title": "Who shared this link",
            "type": "array",
            "description": "Posts that shared a URL. Limitation of the Mastodon API: it only answers for links that are trending on that server right now; for any other link the server returns nothing (noted in the run summary).",
            "items": {
              "type": "string"
            }
          },
          "mastodonTrends": {
            "title": "Trending",
            "type": "array",
            "description": "What is trending right now on each Mastodon server: posts, hashtags (with 7-day usage) and links (news articles with 7-day shares).",
            "items": {
              "type": "string",
              "enum": [
                "posts",
                "hashtags",
                "links"
              ],
              "enumTitles": [
                "Trending posts",
                "Trending hashtags",
                "Trending links (news)"
              ]
            }
          },
          "mastodonPublicTimeline": {
            "title": "Public timeline",
            "enum": [
              "none",
              "local",
              "all"
            ],
            "type": "string",
            "description": "Best effort: big servers (mastodon.social and others) close it to logged-out visitors; then the source is marked unavailable in the run summary and the run goes on.",
            "default": "none"
          },
          "accountSearch": {
            "title": "Search people",
            "type": "array",
            "description": "Accounts matching these words, on each Mastodon server above. Without login Mastodon returns at most 40 accounts per server and search.",
            "items": {
              "type": "string"
            }
          },
          "includeReplies": {
            "title": "Include replies in account posts",
            "type": "boolean",
            "description": "Account posts: also return the replies the account wrote.",
            "default": true
          },
          "includeBoosts": {
            "title": "Include boosts in account posts",
            "type": "boolean",
            "description": "Account posts: also return posts the account boosted (isReblog = true; text and counters are the original post's).",
            "default": false
          },
          "includeEngagers": {
            "title": "Who liked and boosted each post",
            "type": "boolean",
            "description": "For every Mastodon post returned, also return one row per account that liked or boosted it (up to 'Max results per source' of each). Adds at least 2 requests per post.",
            "default": false
          },
          "includeEditHistory": {
            "title": "Edit history",
            "type": "boolean",
            "description": "For every edited Mastodon post, return each previous version (one extra request per edited post).",
            "default": false
          },
          "includeFollowers": {
            "title": "Followers, following and endorsements",
            "type": "boolean",
            "description": "For each account above, also return its followers, the accounts it follows and the accounts it recommends, up to 'Max results per source' each. Some accounts hide these lists.",
            "default": false
          },
          "lemmyCommunities": {
            "title": "Communities",
            "type": "array",
            "description": "Community details (subscribers, activity, moderators) and its posts. !name@server, name@server or a community URL. A bare name uses the first Lemmy server below.",
            "items": {
              "type": "string"
            }
          },
          "lemmyServers": {
            "title": "Lemmy servers",
            "type": "array",
            "description": "Servers for the feed, search and moderation log (up to 20). Default: lemmy.world.",
            "items": {
              "type": "string"
            }
          },
          "lemmyPostUrls": {
            "title": "Post URLs (with every comment)",
            "type": "array",
            "description": "The post plus ALL its comments, with depth, parent and path to rebuild the tree. Comments are paginated in full (no 300-comment cut).",
            "items": {
              "type": "string"
            }
          },
          "lemmyUsers": {
            "title": "Users",
            "type": "array",
            "description": "Profile, communities they moderate, and their posts and comments. name@server or a profile URL.",
            "items": {
              "type": "string"
            }
          },
          "lemmySearch": {
            "title": "Search",
            "type": "array",
            "description": "Full-text search on each Lemmy server above. Lemmy servers allow only a few searches per minute, so large searches are slow (the Actor waits as the server asks).",
            "items": {
              "type": "string"
            }
          },
          "lemmySearchType": {
            "title": "Search in",
            "enum": [
              "Posts",
              "Comments",
              "Communities",
              "Users"
            ],
            "type": "string",
            "description": "What the Lemmy search returns.",
            "default": "Posts"
          },
          "lemmyFeed": {
            "title": "Server feed",
            "type": "boolean",
            "description": "All posts the Lemmy server sees, in the order below.",
            "default": false
          },
          "lemmySort": {
            "title": "Sort",
            "enum": [
              "Hot",
              "Active",
              "New",
              "Old",
              "MostComments",
              "NewComments",
              "Controversial",
              "Scaled",
              "TopHour",
              "TopSixHour",
              "TopTwelveHour",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopThreeMonths",
              "TopSixMonths",
              "TopNineMonths",
              "TopYear",
              "TopAll"
            ],
            "type": "string",
            "description": "Order of the feed and of community posts. New is chronological, so 'Posted since' can stop early.",
            "default": "Hot"
          },
          "includeComments": {
            "title": "Include comments of each post",
            "type": "boolean",
            "description": "For posts from the feed, communities and search, also return all their comments (up to 'Max results per source' per post).",
            "default": false
          },
          "serverInfo": {
            "title": "Server data",
            "type": "array",
            "description": "One row per server: software and version, sign-up policy, users, rules, admins and, on Mastodon, 12 weeks of posts, logins and sign-ups. Works with any fediverse software (detected via nodeinfo); content is collected only from Mastodon and Lemmy.",
            "items": {
              "type": "string"
            }
          },
          "includeBlocklists": {
            "title": "Blocked servers",
            "type": "boolean",
            "description": "With 'Server data': one row per server it blocks (Mastodon: with severity and reason). Some admins do not publish the list; then blockedCount is null.",
            "default": true
          },
          "includePeers": {
            "title": "Known servers (peers)",
            "type": "boolean",
            "description": "With 'Server data': one row per server it federates with. Can be over 100,000 rows; capped by 'Max results per source'.",
            "default": false
          },
          "includeModlog": {
            "title": "Moderation log (Lemmy)",
            "type": "boolean",
            "description": "Public moderation log of each Lemmy server above: removals, bans, locks, pins and purges, with moderator, target, reason and date.",
            "default": false
          },
          "maxItemsPerSource": {
            "title": "Max results per source",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Limit for EACH source (each hashtag on each server, each account, each community, each search...). Keeps cost predictable. Extras of a post (likes, boosts, edits, Lemmy comments) have the same limit, separately.",
            "default": 100
          },
          "since": {
            "title": "Posted since",
            "type": "string",
            "description": "Skip posts, comments and moderation actions older than this day (UTC). Newest-first sources stop paginating there, so you do not pay for old items."
          },
          "skipNsfw": {
            "title": "Skip NSFW",
            "type": "boolean",
            "description": "Skip Mastodon posts marked sensitive and Lemmy posts marked NSFW (or in NSFW communities).",
            "default": false
          },
          "respectNoIndex": {
            "title": "Respect 'do not index' requests",
            "type": "boolean",
            "description": "On by default: skips Mastodon accounts (and their posts, boosts, likes and follower rows) that explicitly asked search engines not to index them (noindex). Mastodon only reveals this for accounts of the server queried. Accounts that just opted out of Mastodon's own full-text search (indexable = false) are kept, with that flag in the authorIndexable / indexable column so you can filter. Skipped items are counted in the run summary and never charged.",
            "default": true
          },
          "healthCheck": {
            "title": "Health check mode (canary)",
            "type": "boolean",
            "description": "For the scheduled daily health check. Ignores every other field, checks a fixed list of stable Mastodon and Lemmy hashtags, accounts, trends, communities, users, modlogs and servers, writes nothing to the dataset (no charge), and FAILS the run if a whole source stops responding. The status message names the broken source.",
            "default": false
          },
          "healthCheckSimulateFailure": {
            "title": "Simulate a canary failure (test only)",
            "type": "boolean",
            "description": "Test only: with health check mode, swaps the test accounts and users for nonexistent ones so those sources really fail. Used to prove the failure alert works.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}