{
  "openapi": "3.0.1",
  "info": {
    "title": "Lemmy Scraper & Keyword Monitor: Posts, Comments, Any Instance",
    "description": "Search Lemmy posts or comments by keyword across several instances at once, export communities with full comment threads, and run as a monitor that outputs only new items since the last run (repeat items are free). No login. $0.50 per 1,000 items.",
    "version": "1.0",
    "x-build-id": "sYo2GfOtdbTP3hLRy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tali-works~lemmy-scraper-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tali-works-lemmy-scraper-monitor",
        "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/tali-works~lemmy-scraper-monitor/runs": {
      "post": {
        "operationId": "runs-sync-tali-works-lemmy-scraper-monitor",
        "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/tali-works~lemmy-scraper-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-tali-works-lemmy-scraper-monitor",
        "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": {
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords or brand names to search for (Lemmy full-text search). Each keyword is searched on every instance below.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "posts",
              "comments"
            ],
            "type": "string",
            "description": "Search posts (titles and bodies) or comments.",
            "default": "posts"
          },
          "communities": {
            "title": "Communities",
            "type": "array",
            "description": "Export posts from communities: 'technology@lemmy.world', '!linux@lemmy.ml', a community URL, or a bare name (uses the first instance).",
            "items": {
              "type": "string"
            }
          },
          "instances": {
            "title": "Instances to search",
            "type": "array",
            "description": "Lemmy servers to query. Different servers federate different communities, so searching 2-3 big ones finds more. Results are de-duplicated across servers (duplicates are free). Default: lemmy.world.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "New",
              "Hot",
              "Active",
              "TopDay",
              "TopWeek",
              "TopMonth",
              "TopYear",
              "TopAll",
              "MostComments",
              "NewComments",
              "Old"
            ],
            "type": "string",
            "description": "Order of posts (and of comment search results).",
            "default": "New"
          },
          "includeComments": {
            "title": "Include comment threads",
            "type": "boolean",
            "description": "For every post found, also export its comments (with depth and parent).",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Only used with 'Include comment threads'.",
            "default": 100
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "Top",
              "Hot",
              "New",
              "Old",
              "Controversial"
            ],
            "type": "string",
            "description": "Order of comments within a thread.",
            "default": "Top"
          },
          "onlyNew": {
            "title": "Monitor mode: only new items",
            "type": "boolean",
            "description": "Remember what earlier runs returned (in the named key-value store 'lemmy-monitor-state') and output only posts/comments not seen before. First run = baseline. Schedule it hourly/daily for brand or keyword alerts. Already-seen items are not charged.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. Runs with the same name share memory. By default the memory is keyed by your keywords/communities/instances."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Skip items published before this date."
          },
          "minScore": {
            "title": "Min score",
            "type": "integer",
            "description": "Skip items with a lower score (upvotes minus downvotes)."
          },
          "excludeBots": {
            "title": "Exclude bot accounts",
            "type": "boolean",
            "description": "Skip posts/comments by accounts flagged as bots (e.g. RSS mirror bots).",
            "default": true
          },
          "excludeNsfw": {
            "title": "Exclude NSFW",
            "type": "boolean",
            "description": "Skip NSFW posts.",
            "default": true
          },
          "maxItemsPerSource": {
            "title": "Max posts per keyword/instance or community",
            "minimum": 1,
            "type": "integer",
            "description": "Cap per keyword-instance pair or per community (comments not counted).",
            "default": 500
          },
          "maxTotalItems": {
            "title": "Max items in total",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap for the whole run, to control cost."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}