{
  "openapi": "3.0.1",
  "info": {
    "title": "Lemmy Scraper: Posts, Comments & Communities",
    "description": "Scrape Lemmy posts, comments and communities from any instance: titles, text, links, scores, authors, reply trees, federated links, subscriber and activity counts. Communities, posts, instance feeds and keyword search, no login. Export to JSON, CSV or Excel, or via API.",
    "version": "1.0",
    "x-build-id": "H6bXbyhRrGafcyfOk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~lemmy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-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/steadyscrape~lemmy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-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/steadyscrape~lemmy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-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": {
          "targets": {
            "title": "Lemmy links or handles",
            "type": "array",
            "description": "One per line, from any Lemmy instance: a community link (<code>https://lemmy.world/c/technology</code>) or handle (<code>technology@lemmy.world</code>, <code>!asklemmy@lemmy.ml</code>), a community of another instance as one instance shows it (<code>https://sh.itjust.works/c/technology@lemmy.world</code>), a post link (<code>https://lemmy.world/post/53761662</code>), an instance for its front-page feed (<code>lemmy.ml</code>), or an instance's community list (<code>https://lemmy.world/communities</code>) for every community with its subscriber and activity counts.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search with the instance's own search (one search per line): the posts it finds, and with <b>Latest comments</b> the comments it finds.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchInstance": {
            "title": "Instance to search",
            "type": "string",
            "description": "The instance whose search is used for the search terms, e.g. <code>lemmy.world</code>, <code>lemmy.ml</code>, <code>sh.itjust.works</code>.",
            "default": "lemmy.world"
          },
          "includePosts": {
            "title": "Scrape posts",
            "type": "boolean",
            "description": "Deliver the posts of each community, feed, search and post link (priced as <code>post</code>). Turn off to get only comments.",
            "default": true
          },
          "maxPostsPerTarget": {
            "title": "Maximum posts per community, feed or search",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each community, feed or search after this many posts. 0 means no maximum (up to 10,000).",
            "default": 100
          },
          "sort": {
            "title": "Post sort",
            "enum": [
              "New",
              "Hot",
              "Active",
              "Scaled",
              "Controversial",
              "Old",
              "MostComments",
              "NewComments",
              "TopHour",
              "TopSixHour",
              "TopTwelveHour",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopThreeMonths",
              "TopSixMonths",
              "TopNineMonths",
              "TopYear",
              "TopAll"
            ],
            "type": "string",
            "description": "Lemmy's own sorts. <b>New</b> suits monitoring; <b>Top…</b> sorts by score within a time window.",
            "default": "New"
          },
          "comments": {
            "title": "Comments",
            "enum": [
              "none",
              "latest",
              "ofEachPost"
            ],
            "type": "string",
            "description": "<b>Latest comments</b>: the newest comments of each community, feed or search across all its posts (50 per request, the fastest way to collect comments), and all comments of each post link. <b>Comments of each post</b>: the comment thread of every post scraped, one request or more per post, so on an instance that asks 60 seconds between requests 20 posts take about 20 minutes. Priced as <code>comment</code>.",
            "default": "none"
          },
          "maxComments": {
            "title": "Maximum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Latest comments: per community, feed or search. Comments of each post: per post. 0 means every comment.",
            "default": 100
          },
          "commentSort": {
            "title": "Comment sort (comments of a post)",
            "enum": [
              "Top",
              "Hot",
              "New",
              "Old",
              "Controversial"
            ],
            "type": "string",
            "description": "The order a post's comments are read in, which decides which ones a maximum keeps. Latest comments are always newest first.",
            "default": "Top"
          },
          "listingType": {
            "title": "Listing",
            "enum": [
              "Local",
              "All"
            ],
            "type": "string",
            "description": "<b>Local</b>: what the instance itself hosts. <b>All</b>: everything it receives from the instances it federates with. Applies to instance feeds, searches and community lists; a community link always reads that community.",
            "default": "Local"
          },
          "communitySort": {
            "title": "Community list sort",
            "enum": [
              "TopAll",
              "TopMonth",
              "TopWeek",
              "Hot",
              "Active",
              "New",
              "Old",
              "MostComments"
            ],
            "type": "string",
            "description": "For community-list links. <b>Top: all time</b> lists the most subscribed first.",
            "default": "TopAll"
          },
          "maxCommunities": {
            "title": "Maximum communities per list",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each community list after this many communities (priced as <code>community</code>). 0 means every community.",
            "default": 100
          },
          "includeNsfw": {
            "title": "Include NSFW",
            "type": "boolean",
            "description": "Ask post lists and community lists for NSFW content too (instances that allow it).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}