{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter Automation API (POST, REPLY, LIKE,  RETWEET, SCRAP))",
    "description": "A powerful and flexible Twitter/X automation API built as an Apify Actor. This API enables you to scrape tweets, post new tweets, reply to tweets, like tweets, and retweet using Playwright browser automation.",
    "version": "0.0",
    "x-build-id": "MuMNrm6e7tbgiS9hY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hamdo~twitter-automation-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hamdo-twitter-automation-api",
        "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/hamdo~twitter-automation-api/runs": {
      "post": {
        "operationId": "runs-sync-hamdo-twitter-automation-api",
        "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/hamdo~twitter-automation-api/run-sync": {
      "post": {
        "operationId": "run-sync-hamdo-twitter-automation-api",
        "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": [
          "mode"
        ],
        "properties": {
          "ct0": {
            "title": "Twitter ct0 Cookie",
            "type": "string",
            "description": "Twitter ct0 cookie value for authentication. Required for all interaction modes (post, reply, like, retweet) and recommended for scraping modes. Get this from your browser cookies after logging into Twitter/X. Consider using Secret Inputs in Apify Console for sensitive data.",
            "default": ""
          },
          "auth_token": {
            "title": "Twitter auth_token Cookie",
            "type": "string",
            "description": "Twitter auth_token cookie value for authentication. Required for all interaction modes (post, reply, like, retweet) and recommended for scraping modes. Get this from your browser cookies after logging into Twitter/X. Consider using Secret Inputs in Apify Console for sensitive data.",
            "default": ""
          },
          "mode": {
            "title": "Operation Mode",
            "enum": [
              "user",
              "single",
              "post",
              "reply",
              "like",
              "retweet"
            ],
            "type": "string",
            "description": "Choose the operation mode. This determines which other fields are required.",
            "default": "user"
          },
          "tweetUrl": {
            "title": "Tweet URL (Single)",
            "type": "string",
            "description": "Full URL of a single tweet. Required for modes: 'single', 'like' (single tweet), or 'retweet' (single tweet).",
            "default": ""
          },
          "tweetUrls": {
            "title": "Tweet URLs (Multiple)",
            "maxItems": 5,
            "type": "array",
            "description": "Array of tweet URLs (maximum 5). Use this for liking or retweeting multiple tweets. Required when mode is 'like' or 'retweet' and you want to process multiple tweets. Alternative: use 'tweetUrl' for a single tweet.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "delayBetweenActions": {
            "title": "Delay Between Actions (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Delay in seconds between processing each tweet when using 'tweetUrls'. Helps avoid rate limiting. Only used when processing multiple tweets.",
            "default": 2
          },
          "username": {
            "title": "Twitter Username",
            "type": "string",
            "description": "Twitter username without @ symbol. Required when mode is 'user'.",
            "default": ""
          },
          "maxTweets": {
            "title": "Maximum Number of Tweets",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of tweets to scrape. Only used when mode is 'user'.",
            "default": 3
          },
          "maxDaysOld": {
            "title": "Maximum Days Old",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Only scrape tweets from the last N days. Set to 0 for no limit. Only used when mode is 'user'.",
            "default": 2
          },
          "tweetText": {
            "title": "Tweet Text",
            "type": "string",
            "description": "Text content for the new tweet. Required when mode is 'post'.",
            "default": ""
          },
          "replyTweetUrl": {
            "title": "Reply Tweet URL",
            "type": "string",
            "description": "URL of the tweet to reply to. Required when mode is 'reply'.",
            "default": ""
          },
          "replyText": {
            "title": "Reply Text",
            "type": "string",
            "description": "Text content for the reply. Required when mode is 'reply'.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}