{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon Public Posts & Hashtags",
    "description": "Mastodon public posts and hashtag scraper for selected instances. Export public post fields, source context and diagnostic rows as JSON.",
    "version": "1.0",
    "x-build-id": "B05wJwVcI3mqDfwEU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~mastodon-public-posts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-mastodon-public-posts",
        "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/grit-77~mastodon-public-posts/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-mastodon-public-posts",
        "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/grit-77~mastodon-public-posts/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-mastodon-public-posts",
        "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": [
          "instances"
        ],
        "properties": {
          "instances": {
            "title": "Mastodon instances",
            "type": "array",
            "description": "HTTPS origins or hostnames of public Mastodon servers. Requests stay on these instances.",
            "items": {
              "type": "string"
            },
            "default": [
              "https://fosstodon.org"
            ]
          },
          "mode": {
            "title": "Timeline type",
            "enum": [
              "public",
              "hashtag",
              "account"
            ],
            "type": "string",
            "description": "Public timeline, one timeline per hashtag, or statuses from named accounts on each instance.",
            "default": "public"
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Required in hashtag mode. Leading # is optional; Unicode hashtags are supported.",
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "description": "Required in account mode. Use username, @user@domain, or id:123 for a server-local account ID. Each value is looked up on each instance.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum dataset rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Global cap across all sources, including uncharged error rows.",
            "default": 100
          },
          "concurrency": {
            "title": "Concurrent sources",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Sources processed in parallel. Requests to one instance are serialized and share its rate limit.",
            "default": 3
          },
          "maxPagesPerSource": {
            "title": "Maximum pages per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop each source after this many pages even when results are duplicates or filtered.",
            "default": 10
          },
          "local": {
            "title": "Local timeline only",
            "type": "boolean",
            "description": "Restrict public and hashtag results to statuses from that instance.",
            "default": true
          },
          "onlyMedia": {
            "title": "Only posts with media",
            "type": "boolean",
            "description": "Request posts containing media attachments.",
            "default": false
          },
          "includeBoosts": {
            "title": "Include boosts",
            "type": "boolean",
            "description": "Export the original public post behind a boost with boostedBy context. Duplicate original posts are exported once.",
            "default": true
          },
          "excludeReplies": {
            "title": "Exclude replies",
            "type": "boolean",
            "description": "Filter out replies across all modes.",
            "default": false
          },
          "sinceId": {
            "title": "Lower status ID bound",
            "type": "string",
            "description": "Optional server-local numeric since_id. IDs are not portable between instances."
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each API request.",
            "default": 30
          },
          "maxRetries": {
            "title": "Retries after transient errors",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retry HTTP 429, HTTP 5xx, timeouts and connection failures with exponential backoff.",
            "default": 3
          },
          "maxRateLimitWaitSecs": {
            "title": "Maximum rate-limit wait (seconds)",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "If a server asks for a longer wait, stop that source with an error row instead of retrying early.",
            "default": 300
          },
          "minRequestIntervalSecs": {
            "title": "Minimum interval per instance (seconds)",
            "minimum": 0,
            "maximum": 10,
            "type": "number",
            "description": "Minimum delay between requests to one instance, in addition to rate-limit headers.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}