{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Media Downloader",
    "description": "Download high-quality images, videos, and GIFs from X/Twitter — including tweets, replies, quote tweets, threads, and public profiles in high to low quality",
    "version": "0.0",
    "x-build-id": "a3dFBc1vbdKBAjkZK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikolabs~x-twitter-media-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikolabs-x-twitter-media-downloader",
        "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/mikolabs~x-twitter-media-downloader/runs": {
      "post": {
        "operationId": "runs-sync-mikolabs-x-twitter-media-downloader",
        "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/mikolabs~x-twitter-media-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-mikolabs-x-twitter-media-downloader",
        "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": {
          "tweetUrls": {
            "title": "Tweet URLs or IDs",
            "type": "array",
            "description": "Enter X/Twitter URLs or tweet IDs. Supports: https://x.com/username/status/123, https://twitter.com/username/status/123, or just the tweet ID.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "downloadMedia": {
            "title": "Download & ZIP media files",
            "type": "boolean",
            "description": "When enabled, all media files are downloaded and bundled into a ZIP archive stored in the Key-Value Store. Videos are fetched in every available resolution via twittervideodownloader.com. Images and GIFs are downloaded directly. The ZIP download URL is added to each dataset record as 'media_zip_url'.",
            "default": true
          },
          "videoResolutions": {
            "title": "Video resolutions to download",
            "type": "array",
            "description": "Filter which video resolutions to include in the ZIP. Select from common options or enter custom resolutions (e.g. '720x1280'). Leave empty to download all available resolutions. Only applies when 'Download & ZIP media files' is enabled.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "320x568",
                "480x852",
                "720x1280",
                "1080x1920",
                "1440x2560",
                "2160x3840"
              ],
              "enumTitles": [
                "320p",
                "480p",
                "720p",
                "1080p",
                "2k",
                "4k"
              ]
            },
            "default": [
              "320x568"
            ]
          },
          "extractMainTweet": {
            "title": "Extract main tweet",
            "type": "boolean",
            "description": "Extract media from the main tweet (top post).",
            "default": true
          },
          "extractRepliesMedia": {
            "title": "Extract replies",
            "type": "boolean",
            "description": "Extract media from reply tweets (comments).",
            "default": false
          },
          "maxReplies": {
            "title": "Maximum replies",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of replies to process for media extraction.",
            "default": 10
          },
          "twitterHandles": {
            "title": "Twitter usernames",
            "type": "array",
            "description": "Enter Twitter usernames to scrape media from (without @). Required if 'Extract Profile Media' is enabled.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "extractProfileMedia": {
            "title": "Extract profile media",
            "type": "boolean",
            "description": "Extract media from the provided Twitter usernames' profiles.",
            "default": false
          },
          "profileMediaMaxItems": {
            "title": "Profile media max items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of media items to extract from each profile.",
            "default": 10
          },
          "mediaTypeFilter": {
            "title": "Media type filter",
            "enum": [
              "all",
              "images",
              "videos",
              "gifs"
            ],
            "type": "string",
            "description": "Filter media by type (Images, Videos, or GIFs).",
            "default": "all"
          },
          "includeImages": {
            "title": "Include images",
            "type": "boolean",
            "description": "Include image media in results when filter is set to 'All'.",
            "default": true
          },
          "includeVideos": {
            "title": "Include videos",
            "type": "boolean",
            "description": "Include video media in results when filter is set to 'All'.",
            "default": true
          },
          "includeGifs": {
            "title": "Include GIFs",
            "type": "boolean",
            "description": "Include GIF media in results when filter is set to 'All'.",
            "default": true
          },
          "includeAllQualityVersions": {
            "title": "Include all quality versions",
            "type": "boolean",
            "description": "Include all available quality versions (original, high, medium, low).",
            "default": false
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of likes a tweet must have (Profile Scraper only).",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of retweets a tweet must have (Profile Scraper only).",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of replies a tweet must have (Profile Scraper only).",
            "default": 0
          },
          "onlyVerified": {
            "title": "Verified authors only",
            "type": "boolean",
            "description": "Only include tweets from verified accounts (Profile Scraper only).",
            "default": false
          },
          "tweetLanguage": {
            "title": "Tweet language",
            "type": "string",
            "description": "Filter tweets by language code (e.g., 'en', 'es').",
            "default": ""
          },
          "includeTweetMetadata": {
            "title": "Include tweet metadata",
            "type": "boolean",
            "description": "Include metadata (username, text, date, stats) in results.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Select proxies to be used. Residential proxies are highly recommended."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}