{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X) Profile Posts Scraper",
    "description": "Paste an X profile URL and get that account's posts for any period. Date-range filtering, Posts/Replies/Media tabs, retweet, reply, language and engagement filters, auto-pagination. Returns text, author, likes, retweets, replies, quotes, views and media.",
    "version": "0.0",
    "x-build-id": "8i8K4rl3CP4SVNGkS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/outspoken_strategy~twitter-profile-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-outspoken_strategy-twitter-profile-posts-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/outspoken_strategy~twitter-profile-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-outspoken_strategy-twitter-profile-posts-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/outspoken_strategy~twitter-profile-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-outspoken_strategy-twitter-profile-posts-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": {
          "profileUrl": {
            "title": "Profile URL (single)",
            "type": "string",
            "description": "The X/Twitter profile page to scrape, e.g. https://x.com/nasa. An @handle or a bare handle also works, and so does any URL on the profile (a status link is resolved to its author). You can paste several profiles, one per line. For a clean list use \"profileUrls\" below instead."
          },
          "profileUrls": {
            "title": "Profile URLs (multiple)",
            "type": "array",
            "description": "Several profiles to scrape — each is scraped separately and the results are combined. \"Number of posts\" applies PER profile.",
            "items": {
              "type": "string"
            }
          },
          "tab": {
            "title": "Profile tab",
            "enum": [
              "posts",
              "replies",
              "media"
            ],
            "type": "string",
            "description": "Which part of the profile to scrape: \"Posts\" (the main timeline), \"Posts & replies\" (includes the account's replies), or \"Media\" (only posts containing photos/videos).",
            "default": "posts"
          },
          "numberOfTweets": {
            "title": "Number of posts",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of posts to return per profile (after filtering).",
            "default": 100
          },
          "scrapeAll": {
            "title": "Scrape all (auto-paginate)",
            "type": "boolean",
            "description": "Keep scrolling/paginating until the target count is reached, the date range is passed, or the feed runs dry. When unchecked only the first page of the profile is returned.",
            "default": true
          },
          "timeSince": {
            "title": "From date (since)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return posts published on or after this date (format: yyyy-mm-dd). Inclusive."
          },
          "timeUntil": {
            "title": "To date (until)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return posts published on or before this date (format: yyyy-mm-dd). Inclusive — posts made on this day are returned."
          },
          "scrapeMode": {
            "title": "Scrape mode",
            "enum": [
              "auto",
              "search",
              "timeline"
            ],
            "type": "string",
            "description": "\"Auto\" (recommended) uses advanced search when a date range is set and the profile timeline otherwise. \"Search\" always uses from:handle advanced search — best for date ranges and engagement filters. \"Timeline\" always scrolls the profile page itself — best for simply grabbing the newest posts, and the only mode that sees pinned posts.",
            "default": "auto"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Include posts that are replies to someone. Forced on when the \"Posts & replies\" tab is selected.",
            "default": false
          },
          "includeRetweets": {
            "title": "Include retweets",
            "type": "boolean",
            "description": "Include the account's retweets of other people's posts. The original post is exposed in the \"retweeted_status\" field.",
            "default": true
          },
          "includePinned": {
            "title": "Include pinned post",
            "type": "boolean",
            "description": "Include the profile's pinned post. It can be much older than the rest of the timeline, so uncheck it to keep a date-filtered run clean.",
            "default": true
          },
          "onlyProfileAuthor": {
            "title": "Only posts authored by this profile",
            "type": "boolean",
            "description": "Drop posts written by other accounts. The \"Posts & replies\" tab pulls in the parent posts of each reply as conversation context; this filter removes them. Leave checked unless you want that context.",
            "default": true
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Restrict results to a language (ISO 639-1 code, e.g. \"en\", \"fr\")."
          },
          "minFaves": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes. 0 disables the filter.",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many retweets. 0 disables the filter.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many replies. 0 disables the filter.",
            "default": 0
          },
          "mediaHasMedia": {
            "title": "Has media only",
            "type": "boolean",
            "description": "Only posts containing a photo or video. Forced on when the \"Media\" tab is selected.",
            "default": false
          },
          "mediaHasLinks": {
            "title": "Has links only",
            "type": "boolean",
            "description": "Only posts containing links.",
            "default": false
          },
          "contentQuestionMarks": {
            "title": "Questions only",
            "type": "boolean",
            "description": "Only posts phrased as questions (adds the ? search operator). Search mode only.",
            "default": false
          },
          "cookies": {
            "title": "Twitter/X session cookies",
            "type": "array",
            "description": "Cookies of a logged-in X session, exported with a browser extension such as Cookie-Editor or EditThisCookie (JSON array of {name, value, domain, ...}). REQUIRED in practice: X profiles are login-walled for anonymous visitors. The \"auth_token\" and \"ct0\" cookies carry the session. Alternatively set the TW_COOKIES secret environment variable on the actor (same JSON, or a 'name=value; name2=value2' string) to avoid passing cookies in every run. Use a throwaway account, never your personal one."
          },
          "twUsername": {
            "title": "X username (automated login)",
            "type": "string",
            "description": "Username/email/phone of a throwaway X account. If set together with twPassword (or via the TW_USERNAME/TW_PASSWORD secret env vars), the actor logs in itself and caches the session, so you don't need to paste cookies. The account must have 2FA disabled. Prefer setting these as secret environment variables on the actor rather than per run."
          },
          "twPassword": {
            "title": "X password (automated login)",
            "type": "string",
            "description": "Password for the account in twUsername. Stored encrypted. Prefer the TW_PASSWORD secret environment variable instead of putting it in run input."
          },
          "twEmail": {
            "title": "X email (login identity check)",
            "type": "string",
            "description": "Email of the account, used only when X asks to confirm the identity during automated login (\"Enter your phone number or email\"). Also settable via the TW_EMAIL env var."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy to route traffic through. Residential proxies with a country set are strongly recommended for X — the random global residential pool often hands out dead exit IPs, so the actor defaults RESIDENTIAL to US exits when no country is chosen.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "headless": {
            "title": "Run browser headless",
            "type": "boolean",
            "description": "Uncheck to run a headed browser (useful only for local debugging).",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}