{
  "openapi": "3.0.1",
  "info": {
    "title": "Lemmy Scraper: Posts, Comments, Communities & Users",
    "description": "Scrape any Lemmy instance (lemmy.world, lemmy.ml, beehaw.org and other Lemmyverse nodes) via the official /api/v3/* REST API. Posts with upvote/downvote counts, comment trees, communities with subscriber counts, user profiles, full-text search. No auth, no proxies. Pay per result.",
    "version": "0.1",
    "x-build-id": "AuIrMhlWyUxabaL23"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/perconey~lemmy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-perconey-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/perconey~lemmy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-perconey-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/perconey~lemmy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-perconey-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",
        "required": [
          "action",
          "instance"
        ],
        "properties": {
          "action": {
            "title": "What do you want to scrape?",
            "enum": [
              "getPosts",
              "getSiteInfo",
              "listCommunities",
              "getCommunityDetail",
              "getCommunityPosts",
              "getPostDetail",
              "getUserProfile",
              "searchPosts"
            ],
            "type": "string",
            "description": "Pick the type of data. getSiteInfo / getPosts / listCommunities need no queries. The others require at least one entry in queries.",
            "default": "getPosts"
          },
          "instance": {
            "title": "Lemmy instance",
            "type": "string",
            "description": "Which Lemmy-protocol server to query. Default https://lemmy.world. Other major instances: https://lemmy.ml, https://beehaw.org, https://sh.itjust.works, https://lemm.ee, https://feddit.org. For getCommunityDetail / getCommunityPosts / getUserProfile, paste the username or community with its home instance (e.g. nutomic@lemmy.ml) and the actor routes the call automatically.",
            "default": "https://lemmy.world"
          },
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "Depends on action. getSiteInfo / getPosts / listCommunities: leave empty. getCommunityDetail / getCommunityPosts: community name (e.g. 'technology' or 'technology@lemmy.world' or full URL). getUserProfile: username (e.g. 'nutomic' or 'nutomic@lemmy.ml'). getPostDetail: numeric post id or full URL (https://lemmy.world/post/...). searchPosts: free text.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items per query",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many items per query. For getPostDetail+includeComments and getUserProfile+includeSubmissions this caps the secondary fetch.",
            "default": 30
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "Hot",
              "Active",
              "New",
              "Old",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopYear",
              "TopAll",
              "MostComments",
              "NewComments"
            ],
            "type": "string",
            "description": "Sort key for list/feed/search actions. Valid: Hot, Active, New, Old, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments. Default Hot for posts, TopAll for communities.",
            "default": "Hot"
          },
          "searchType": {
            "title": "Search type (searchPosts only)",
            "enum": [
              "Posts",
              "Comments",
              "Communities",
              "Users",
              "All"
            ],
            "type": "string",
            "description": "What to search for. Posts is the default. All searches across posts + comments + communities + users in one call.",
            "default": "Posts"
          },
          "includeComments": {
            "title": "Include comment tree (getPostDetail only)",
            "type": "boolean",
            "description": "Walk the post's comment tree. Each comment counts as one more result-item, capped by maxItems.",
            "default": false
          },
          "includeSubmissions": {
            "title": "Include recent posts/comments (getUserProfile only)",
            "type": "boolean",
            "description": "After the user profile, also fetch their recent posts and comments. Each counts toward maxItems.",
            "default": false
          },
          "token": {
            "title": "Lemmy JWT (optional)",
            "type": "string",
            "description": "Lemmy session JWT. Only needed for actions that the instance restricts to logged-in users (some lock followers/saved). Almost all public reads work anonymously."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}