{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon Scraper: Posts, Hashtags, Profiles, Trends",
    "description": "Scrape public Mastodon posts from hashtags, accounts, timelines, trends and post links on any instance, no login. Text, counts, media, tags, mentions, polls, cards, plus profiles and hashtag stats. Date, language and keyword filters.",
    "version": "1.0",
    "x-build-id": "hcLFdL1kHou1KVREL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~mastodon-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-mastodon-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/zhtech~mastodon-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-mastodon-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/zhtech~mastodon-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-mastodon-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": "Hashtags to collect posts from, one per line: opensource, #opensource, a tag link (https://fosstodon.org/tags/opensource) or tag@instance (opensource@fosstodon.org). A plain tag is read on every instance in Instances below. Some servers show hashtag feeds only to logged in users; you then get a clear AUTH_REQUIRED error row (not charged) with a suggestion. If you leave every source field empty (Hashtags, Accounts, Post URLs, Timelines, Search, Trending hashtags), the actor runs this example: opensource plus @Mastodon@mastodon.social.",
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "description": "Profiles to read, one per line: @username@instance, a profile link (https://mastodon.social/@Mastodon) or a plain username (read on the first instance below). Each account is read on its own home server, so you get its full public history, not only the posts another server happened to receive.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Single posts by link, for example https://mastodon.social/@Mastodon/123456789012345678. Turn on the option below to also get the whole conversation (replies and parent posts).",
            "items": {
              "type": "string"
            }
          },
          "includeThread": {
            "title": "Add the whole thread for post URLs",
            "type": "boolean",
            "description": "For each post URL, also save the posts it replies to and the public replies below it (up to Max posts per source).",
            "default": false
          },
          "timelines": {
            "title": "Timelines",
            "type": "array",
            "description": "Instance wide feeds, read on every instance below. Local: public posts by the instance's own users. Federated: public posts from other servers the instance knows. Trending: the instance's trending posts right now. Many large servers (mastodon.social included) show the local and federated timelines only to logged in users; fosstodon.org allows both.",
            "items": {
              "type": "string",
              "enum": [
                "local",
                "federated",
                "trending"
              ],
              "enumTitles": [
                "Local timeline",
                "Federated timeline",
                "Trending posts"
              ]
            },
            "default": []
          },
          "trendingTags": {
            "title": "Trending hashtags",
            "type": "boolean",
            "description": "Save the instance's trending hashtags with their use counts for the last 7 days (one hashtag row each, up to Max posts per source).",
            "default": false
          },
          "searchQueries": {
            "title": "Search accounts or hashtags",
            "type": "array",
            "description": "Search terms for the instance's public search, up to 40 results per term and instance (logged out visitors get one page of results). Mastodon only lets logged in users search the text of posts, so this searches account names and bios, or hashtag names. To find posts by word, use Hashtags or Accounts with the Keywords filter.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "accounts",
              "hashtags"
            ],
            "type": "string",
            "description": "What the search queries return: profile rows or hashtag rows.",
            "default": "accounts"
          },
          "instances": {
            "title": "Instances",
            "type": "array",
            "description": "Mastodon servers used for hashtags, timelines, trends, search and plain usernames, one domain per line (mastodon.social, fosstodon.org, hachyderm.io). Several instances are read one after another and duplicate posts are saved only once. Accounts and post links always go to their own server.",
            "default": [
              "mastodon.social"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerSource": {
            "title": "Max posts per source",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Newest first. Applies to each hashtag on each instance, each account, each timeline and each thread, and to the number of rows per search query or trending list. 0 saves only profile and hashtag rows.",
            "default": 20
          },
          "includeProfiles": {
            "title": "Add a profile row per account",
            "type": "boolean",
            "description": "One extra row for each account in Accounts: display name, bio, followers, following, post count, join date, last post date, profile fields with verified links, avatar and header.",
            "default": true
          },
          "includeHashtagStats": {
            "title": "Add a hashtag stats row per hashtag",
            "type": "boolean",
            "description": "One extra row for each hashtag and instance with uses and accounts per day for the last 7 days.",
            "default": true
          },
          "oldestDate": {
            "title": "Oldest post date",
            "type": "string",
            "description": "Stop when posts get older than this. YYYY-MM-DD (UTC), a full ISO timestamp, or a relative value such as 24 hours, 7 days, 2 weeks. Ideal for scheduled runs: 24 hours every day gives you only new posts."
          },
          "newestDate": {
            "title": "Newest post date",
            "type": "string",
            "description": "Skip posts newer than this (not saved, not charged). Same formats; a plain date includes the whole UTC day. The actor jumps straight to this date instead of reading newer pages."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Keep only posts in these languages, as two letter codes (en, de, fr, ja). Uses the language the author's app set on the post. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (any match)",
            "type": "array",
            "description": "Keep only posts that contain at least one of these words or phrases (case insensitive, checked in the post text, content warning, image descriptions, link card and poll options). Non matching posts are skipped and not charged. Each saved post lists its matchedKeywords.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip posts that contain any of these words or phrases. Skipped posts are not charged.",
            "items": {
              "type": "string"
            }
          },
          "keywordMatch": {
            "title": "Keyword matching",
            "enum": [
              "contains",
              "wholeWord"
            ],
            "type": "string",
            "description": "Contains: part of a word is enough (rust also matches rusty). Whole word: only complete words or phrases.",
            "default": "contains"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Turn off to keep only top level posts.",
            "default": true
          },
          "includeBoosts": {
            "title": "Include boosts",
            "type": "boolean",
            "description": "Boosts (reposts) in account timelines are saved as the original post with boostedBy and boostedAt filled in. Turn off to keep only the account's own posts.",
            "default": true
          },
          "onlyMedia": {
            "title": "Only posts with media",
            "type": "boolean",
            "description": "Keep only posts with images, videos, GIFs or audio.",
            "default": false
          },
          "respectOptOuts": {
            "title": "Respect account opt outs",
            "type": "boolean",
            "description": "Skip accounts that asked search engines not to index them (Mastodon's noindex setting) or that put #nobot or #noindex in their bio. These are skipped and never charged. Keep this on unless you have the account owner's permission.",
            "default": true
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety limit for filtered runs. Each page holds up to 40 posts. With strict filters (rare keywords, a language far from the instance's audience) the actor may read many pages to find matches; this caps it per source.",
            "default": 50
          },
          "maxItems": {
            "title": "Max results (all sources)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the whole run after this many saved rows (posts, profiles and hashtag rows). 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for normal use: the Mastodon API is public and the actor stays far below the limit of 300 anonymous requests per 5 minutes per server. Use Apify datacenter proxy only if a server blocks your runs. Residential proxy is not supported and is replaced by datacenter automatically.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}