{
  "openapi": "3.0.1",
  "info": {
    "title": "Lemmy Mastodon Posts Scraper",
    "description": "Collect public posts from Lemmy communities, search results and front pages, or Mastodon hashtags and local timelines. Records include text, author, community or hashtag, score, reply count, publication time and links. Uses each instance’s public JSON API without logging in.",
    "version": "0.1",
    "x-build-id": "ZsSuiagfeAj9KZ7g4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~lemmy-mastodon-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-lemmy-mastodon-posts-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/axiomworks~lemmy-mastodon-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-lemmy-mastodon-posts-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/axiomworks~lemmy-mastodon-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-lemmy-mastodon-posts-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": [
          "instance"
        ],
        "properties": {
          "instance": {
            "title": "Instance",
            "type": "string",
            "description": "Required. Bare hostname of the Lemmy or Mastodon server, no https:// and no path, e.g. 'lemmy.world' or 'mastodon.social'. Must run the software chosen in 'platform'. A wrong or unreachable host ends SUCCEEDED with 0 results and a message saying what to change."
          },
          "platform": {
            "title": "Platform",
            "enum": [
              "lemmy",
              "mastodon"
            ],
            "type": "string",
            "description": "Software the instance runs: 'lemmy' (use communities or searchQuery) or 'mastodon' (use hashtags, handles, or nothing for the public timeline). Default 'lemmy'. Fields for the other platform are ignored.",
            "default": "lemmy"
          },
          "communities": {
            "title": "Lemmy communities",
            "type": "array",
            "description": "Lemmy only. Community names, e.g. ['technology'] or ['news@lemmy.world'] (a leading ! is accepted). Posts are read per community, sharing the maxItems budget. Empty = instance front page, or search results when searchQuery is set. Unknown communities are skipped.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Mastodon hashtags",
            "type": "array",
            "description": "Mastodon only. Hashtags, e.g. ['caturday','python'] (a leading # is accepted). All share the maxItems budget. Leave empty (and handles empty) to read the instance's local public timeline; some servers disable that and return 0 results.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Lemmy search query",
            "type": "string",
            "description": "Lemmy only. Keyword search over post titles and bodies, e.g. 'linux'. Combined with communities when both are given. Empty = plain listings sorted by 'sort'."
          },
          "sort": {
            "title": "Sort (Lemmy)",
            "enum": [
              "Hot",
              "New",
              "TopDay",
              "TopWeek"
            ],
            "type": "string",
            "description": "Lemmy only. Post ordering, one of Hot, New, TopDay, TopWeek. Default 'Hot'. Use 'New' for monitoring. Ignored for Mastodon, which is always newest first.",
            "default": "Hot"
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts with a score (Lemmy score, or Mastodon favourites) below this number, e.g. 10. Skipped posts are not returned or charged and do not count toward maxItems. Default 0 keeps everything.",
            "default": 0
          },
          "enrichSentiment": {
            "title": "Add sentiment",
            "type": "boolean",
            "description": "If true, adds a 'sentiment' field (positive, neutral or negative) per post using a third-party AI processor, billed as an extra event only where it succeeds. Default false: no sentiment, no AI calls.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Total posts to return across ALL communities, hashtags and handles combined, 1-10000, default 50. The run stops once this many are saved; you are charged only for posts returned. Use a small value like 20 for quick tests.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for requests, e.g. {\"useApifyProxy\": true}. Default is no proxy because public Lemmy/Mastodon APIs answer directly. Enable Apify Proxy if an instance rate-limits or blocks (blocked requests retry on a new IP).",
            "default": {
              "useApifyProxy": false
            }
          },
          "handles": {
            "title": "Mastodon accounts",
            "type": "array",
            "description": "Mastodon only. Public account handles or profile URLs, e.g. ['Gargron'] or ['https://mastodon.social/@Gargron']. Resolved on the selected instance and sharing the maxItems budget. Empty = use hashtags or the public timeline.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}