{
  "openapi": "3.0.1",
  "info": {
    "title": "Lemmy Scraper - Posts, Comments, Votes from Any Instance",
    "description": "Scrape Lemmy posts and comments from any instance without login: by community, keyword search, post link or front page, with any sort (Hot, New, Top...). Get title, body, link, upvotes, downvotes, score, comment count, author, community and dates. Error rows are free.",
    "version": "0.1",
    "x-build-id": "YnZf54g2n6HuilFD7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapewise~lemmy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapewise-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/scrapewise~lemmy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapewise-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/scrapewise~lemmy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapewise-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": {
          "communities": {
            "title": "Communities",
            "type": "array",
            "description": "Lemmy communities, one per line: a name on the chosen instance (technology), a federated name (linux@lemmy.ml) or a community link (https://lemmy.world/c/technology). Leave everything empty to scrape the instance front page.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Optional. Keywords to search in posts across the instance, for example open source or self hosting. With exactly one community above, the search runs inside that community.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Post or community links",
            "type": "array",
            "description": "Optional. Links from any Lemmy instance: posts (https://lemmy.world/post/123), comments (https://lemmy.world/comment/456) or communities (https://lemmy.ml/c/linux). Each link is read from its own instance.",
            "items": {
              "type": "string"
            }
          },
          "instance": {
            "title": "Instance",
            "type": "string",
            "description": "The Lemmy server to read from, for example lemmy.world, lemmy.ml, sh.itjust.works or programming.dev. Federated communities from other servers are visible through it.",
            "default": "lemmy.world"
          },
          "sort": {
            "title": "Sort posts by",
            "enum": [
              "Hot",
              "Active",
              "New",
              "Old",
              "Scaled",
              "Controversial",
              "MostComments",
              "NewComments",
              "TopHour",
              "TopSixHour",
              "TopTwelveHour",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopThreeMonths",
              "TopSixMonths",
              "TopNineMonths",
              "TopYear",
              "TopAll"
            ],
            "type": "string",
            "description": "Same sort options as the Lemmy web page. For search, Hot, New, Old and the Top options apply.",
            "default": "Hot"
          },
          "listingType": {
            "title": "Front page and search scope",
            "enum": [
              "All",
              "Local"
            ],
            "type": "string",
            "description": "For the front page and for search: All includes posts federated from other instances; Local keeps only posts from communities hosted on this instance.",
            "default": "All"
          },
          "maxPostsPerSource": {
            "title": "Posts per community, search or front page",
            "minimum": 0,
            "type": "integer",
            "description": "How many posts to collect from each community, search term or the front page. 0 = as many as the instance returns.",
            "default": 30
          },
          "maxItems": {
            "title": "Max items in the run",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap for the whole run, posts and comments together. 0 = no cap.",
            "default": 0
          },
          "skipNsfw": {
            "title": "Skip NSFW posts",
            "type": "boolean",
            "description": "On: posts marked NSFW (or from NSFW communities) are left out and never charged.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "On: each post with comments also gets its comments as separate rows (text, votes, author, depth and parent comment).",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "How many comments to collect per post when comments are on. 0 = all of them.",
            "default": 20
          },
          "commentSort": {
            "title": "Sort comments by",
            "enum": [
              "Top",
              "Hot",
              "New",
              "Old",
              "Controversial"
            ],
            "type": "string",
            "description": "Order of the comments of each post.",
            "default": "Top"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy by default. Lemmy's API is public, so you rarely need to change this.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}