{
  "openapi": "3.0.1",
  "info": {
    "title": "X / Twitter Scraper — Posts, Profiles & Monitoring",
    "description": "Scrape public X/Twitter profiles, posts, paginated public timelines and visible replies without login or cookies. Monitor new posts and public metric changes.",
    "version": "1.0",
    "x-build-id": "FB22voTdd6rQJs24p"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yearly_register~x-twitter-scraper-dev/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yearly_register-x-twitter-scraper-dev",
        "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/yearly_register~x-twitter-scraper-dev/runs": {
      "post": {
        "operationId": "runs-sync-yearly_register-x-twitter-scraper-dev",
        "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/yearly_register~x-twitter-scraper-dev/run-sync": {
      "post": {
        "operationId": "run-sync-yearly_register-x-twitter-scraper-dev",
        "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": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "What do you want to scrape?",
            "type": "array",
            "description": "Add public X/Twitter handles, profile URLs, or post URLs. Mix targets in one run. No X login or cookies required.",
            "default": [
              "@openai"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Global cap on records delivered to the dataset; records beyond this cap are not marked as seen in monitoring.",
            "default": 100
          },
          "maxPosts": {
            "title": "Posts per profile",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum posts per profile. Profile timelines continue through public guest cursors when available.",
            "default": 25
          },
          "maxPages": {
            "title": "Timeline pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum guest cursor pages per profile after the public HTML window. Stops earlier at the post cap or date boundary.",
            "default": 3
          },
          "scrapeReplies": {
            "title": "Include visible post replies",
            "type": "boolean",
            "description": "For post URL targets, include connected replies available on the public page. This is not the full conversation.",
            "default": false
          },
          "includeNestedReplies": {
            "title": "Include visible nested replies",
            "type": "boolean",
            "description": "Include connected nested replies only when they appear in the public page payload.",
            "default": true
          },
          "maxReplies": {
            "title": "Maximum visible replies",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on replies emitted per post URL target.",
            "default": 100
          },
          "maxReplyDepth": {
            "title": "Maximum visible reply depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Bound traversal of reply relationships present in the public page payload.",
            "default": 5
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Include records on or after this date."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Include records on or before this date."
          },
          "monitor": {
            "title": "Only return new or changed records",
            "type": "boolean",
            "description": "Turn this scrape into a persistent monitor. Reuse the same state key on scheduled runs.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Key identifying this monitoring state.",
            "default": "x-monitor"
          },
          "emitMode": {
            "title": "What should monitor runs return?",
            "enum": [
              "all",
              "new",
              "changed",
              "new_and_changed"
            ],
            "type": "string",
            "description": "Select all, new, changed, or both new and changed records.",
            "default": "all"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify proxy; direct requests by default.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum simultaneous target requests.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout in seconds.",
            "default": 30
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bounded retries per failed request.",
            "default": 4
          },
          "maxStateRecords": {
            "title": "Maximum monitoring state records",
            "minimum": 100,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum snapshot entries retained in state.",
            "default": 50000
          },
          "changeRetentionDays": {
            "title": "Change retention days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Days to keep previous snapshot entries.",
            "default": 30
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Filter posts below this like count."
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Filter posts below this reply count."
          },
          "minReposts": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Filter posts below this repost count."
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Filter posts below this view count."
          },
          "verifiedOnly": {
            "title": "Verified authors only",
            "type": "boolean",
            "description": "Keep records from verified authors only.",
            "default": false
          },
          "includeAuthors": {
            "title": "Include authors",
            "type": "array",
            "description": "Only include posts by these usernames.",
            "items": {
              "type": "string"
            }
          },
          "excludeAuthors": {
            "title": "Exclude authors",
            "type": "array",
            "description": "Exclude posts by these usernames.",
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "Include keywords",
            "type": "array",
            "description": "Only include posts matching these keywords.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Exclude posts matching these keywords.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Only include these language codes.",
            "items": {
              "type": "string"
            }
          },
          "mediaTypes": {
            "title": "Media types",
            "type": "array",
            "description": "Only include posts with these media types.",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "gif"
              ]
            }
          },
          "repliesOnly": {
            "title": "Replies only",
            "type": "boolean",
            "description": "Only include reply posts.",
            "default": false
          },
          "rootsOnly": {
            "title": "Root posts only",
            "type": "boolean",
            "description": "Only include non-reply posts.",
            "default": false
          },
          "includeReposts": {
            "title": "Include reposts",
            "type": "boolean",
            "description": "Include reposts in results.",
            "default": true
          },
          "includeQuotes": {
            "title": "Include quotes",
            "type": "boolean",
            "description": "Include quote posts in results.",
            "default": true
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "default",
              "newest",
              "oldest",
              "mostLiked",
              "mostReplied",
              "mostReposted",
              "mostViewed",
              "engagement"
            ],
            "type": "string",
            "description": "Order the delivered results.",
            "default": "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}