{
  "openapi": "3.0.1",
  "info": {
    "title": "X Comments Scraper",
    "description": "Scrape public replies and comment threads from X (Twitter) posts by URL or ID: reply text, date, likes, views, author, parent and reply depth. Optional original-post details. No login, no cookies. Pay only for replies saved.",
    "version": "0.1",
    "x-build-id": "gNZoEj9X9lcU0oNYC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~x-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-x-comments-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/coregent~x-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-x-comments-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/coregent~x-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-x-comments-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": {
          "postUrls": {
            "title": "Post URLs",
            "maxItems": 100,
            "type": "array",
            "description": "X (Twitter) post URLs whose replies you want, one per entry (e.g. <code>https://x.com/nasa/status/1234567890123456789</code>). twitter.com, mobile and /i/status/ links work too.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postIds": {
            "title": "Post IDs",
            "maxItems": 100,
            "type": "array",
            "description": "Numeric X post IDs, as an alternative to URLs (e.g. <code>1234567890123456789</code>). Duplicates across both lists are fetched once.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSource": {
            "title": "Maximum replies per post",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stops each post after this many saved replies.",
            "default": 10
          },
          "maxResults": {
            "title": "Maximum replies (total)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops the whole run after this many saved replies, across all posts. Posts are read in turns, one page each, so one big thread can't use up the whole limit.",
            "default": 100
          },
          "sortBy": {
            "title": "Reply order",
            "enum": [
              "relevance",
              "latest"
            ],
            "type": "string",
            "description": "<b>Relevance</b> is X's default reply order (top replies first). <b>Latest</b> returns the newest replies first; use it with \"Replies posted after\" to collect only new replies on a schedule.",
            "default": "relevance"
          },
          "since": {
            "title": "Replies posted after",
            "type": "string",
            "description": "Only replies posted on or after this date (UTC), or within a relative period before the run, such as <code>7 days</code>."
          },
          "until": {
            "title": "Replies posted before",
            "type": "string",
            "description": "Only replies posted before this date (UTC, not included), or before a relative period ago, such as <code>1 day</code>."
          },
          "language": {
            "title": "Language",
            "enum": [
              "any",
              "en",
              "es",
              "pt",
              "fr",
              "de",
              "it",
              "nl",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "id",
              "tr",
              "ru",
              "pl",
              "uk",
              "th",
              "vi",
              "fa",
              "ur",
              "tl",
              "sv",
              "da",
              "fi",
              "no",
              "el",
              "he",
              "cs",
              "ro",
              "hu",
              "bn",
              "ta",
              "ms",
              "ca"
            ],
            "type": "string",
            "description": "Only replies in this language, as detected by X.",
            "default": "any"
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only replies with at least this many likes. 0 = no minimum.",
            "default": 0
          },
          "excludeAuthorReplies": {
            "title": "Exclude the post author's own replies",
            "type": "boolean",
            "description": "Drop replies written by the author of the original post (for example a thread they continued themselves).",
            "default": false
          },
          "skipIds": {
            "title": "Reply IDs to skip",
            "type": "array",
            "description": "Reply IDs you already have. They are left out and never charged, so a repeat run only returns new replies.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "skipUrls": {
            "title": "Reply URLs to skip",
            "type": "array",
            "description": "Reply URLs you already have, as an alternative to IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "debug": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Saves the data provider's raw response for each post to the run's key-value store (DEBUG_RAW_PAGE_&lt;post ID&gt;). For troubleshooting only.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}