{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon Scraper: Hashtags, Trends, Accounts & Keyword Monitor",
    "description": "Scrape Mastodon hashtag timelines across several instances at once (de-duplicated), account posts, and trending posts, hashtags and links. Keyword filter plus a monitor mode that outputs only new posts since the last run. No login. $0.50 per 1,000 items.",
    "version": "1.0",
    "x-build-id": "9uAfs8hH0Ev9aFOe3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tali-works~mastodon-hashtag-trends-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tali-works-mastodon-hashtag-trends-monitor",
        "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/tali-works~mastodon-hashtag-trends-monitor/runs": {
      "post": {
        "operationId": "runs-sync-tali-works-mastodon-hashtag-trends-monitor",
        "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/tali-works~mastodon-hashtag-trends-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-tali-works-mastodon-hashtag-trends-monitor",
        "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 (with or without #). Each hashtag is read from every instance below; results are de-duplicated across instances (duplicates are free).",
            "items": {
              "type": "string"
            }
          },
          "instances": {
            "title": "Instances",
            "type": "array",
            "description": "Mastodon servers to read from. Each server only sees posts that reached it through federation, so 2-3 big ones find more. Default: mastodon.social.",
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "description": "Export posts from accounts: '@user@instance', 'user@instance' or a profile URL like https://mastodon.social/@Mastodon. Read from the account's home server.",
            "items": {
              "type": "string"
            }
          },
          "trends": {
            "title": "Trends",
            "type": "array",
            "description": "Also export what is trending on each instance.",
            "items": {
              "type": "string",
              "enum": [
                "statuses",
                "tags",
                "links"
              ],
              "enumTitles": [
                "Trending posts",
                "Trending hashtags (7-day uses)",
                "Trending links/news"
              ]
            }
          },
          "keywords": {
            "title": "Keyword filter",
            "type": "array",
            "description": "Optional. Keep only posts whose text, hashtags, content warning or link card contains any of these words (case-insensitive). Mastodon has no public full-text search, so this filters hashtag/account posts; up to 10x 'Max items' posts are scanned per source to find matches.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Optional ISO codes to keep, e.g. 'en', 'de'.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Monitor mode: only new items",
            "type": "boolean",
            "description": "Remember what earlier runs returned (named key-value store 'mastodon-monitor-state') and output only items not seen before. First run = baseline. Schedule it hourly/daily for brand or hashtag alerts. Already-seen items are not charged.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. Runs with the same name share memory. Default: keyed by your hashtags/accounts/instances/keywords/trends."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Skip posts published before this date (hashtag/account reading stops once older posts are reached)."
          },
          "minFavourites": {
            "title": "Min favourites",
            "type": "integer",
            "description": "Skip posts with fewer favourites."
          },
          "excludeBoosts": {
            "title": "Exclude boosts",
            "type": "boolean",
            "description": "Skip boosts (reblogs). If off, the original post is output with a boostedBy field.",
            "default": true
          },
          "excludeReplies": {
            "title": "Exclude replies",
            "type": "boolean",
            "description": "Skip replies.",
            "default": false
          },
          "excludeBots": {
            "title": "Exclude bot accounts",
            "type": "boolean",
            "description": "Skip posts by accounts flagged as bots (RSS mirrors etc.).",
            "default": true
          },
          "excludeSensitive": {
            "title": "Exclude sensitive posts",
            "type": "boolean",
            "description": "Skip posts marked sensitive.",
            "default": false
          },
          "localOnly": {
            "title": "Local posts only",
            "type": "boolean",
            "description": "For hashtags: only posts written on that instance (not federated copies).",
            "default": false
          },
          "maxItemsPerSource": {
            "title": "Max items per hashtag/instance, account, or trend list",
            "minimum": 1,
            "type": "integer",
            "description": "Cap per source.",
            "default": 200
          },
          "maxTotalItems": {
            "title": "Max items in total",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap for the whole run, to control cost."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}