{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Video & Image Downloader",
    "description": "Download every video, photo and GIF from X (Twitter) accounts or single posts. One row per file: direct link, size, format, duration, plus the post text and engagement behind it. Videos at the best available quality, photos at original size. Filter by type, width or date. No login needed.",
    "version": "0.0",
    "x-build-id": "5uIMlEuTQDjL1aBhX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/guezi~x-media-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-guezi-x-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/guezi~x-media-downloader/runs": {
      "post": {
        "operationId": "runs-sync-guezi-x-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/guezi~x-media-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-guezi-x-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",
        "required": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "Accounts and post links",
            "type": "array",
            "description": "What to pull media from. Mix freely: an account name, an @name, a link to a profile, or a link to a single post. Each account contributes the media from its recent posts; each post link contributes just that post's media.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerProfile": {
            "title": "Maximum posts with media per account",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many media-carrying posts to take from each account, newest first. One post can hold up to four files, so this is a limit on posts, not on files. Ignored for post links. X publishes only a limited recent window per account, so a high value returns everything X makes available rather than the account's full history.",
            "default": 50
          },
          "mediaTypes": {
            "title": "File types to collect",
            "type": "array",
            "description": "Which kinds of file to return. Leave all three selected to collect everything.",
            "items": {
              "type": "string",
              "enum": [
                "photo",
                "video",
                "gif"
              ],
              "enumTitles": [
                "Photos",
                "Videos",
                "GIFs"
              ]
            },
            "default": [
              "photo",
              "video",
              "gif"
            ]
          },
          "minWidth": {
            "title": "Minimum width in pixels",
            "minimum": 0,
            "maximum": 8192,
            "type": "integer",
            "description": "Skip files narrower than this, measured on the file you would download. Set 0 to keep every size. Files whose size X does not publish are skipped while this is set.",
            "default": 0
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only keep media from posts published on or after this date (YYYY-MM-DD). Leave empty for no lower bound. A value that is not a readable date is reported in the log and no lower bound is applied."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only keep media from posts published on or before this date (YYYY-MM-DD). Leave empty for no upper bound. A value that is not a readable date is reported in the log and no upper bound is applied."
          },
          "includeReposts": {
            "title": "Include media from reposts",
            "type": "boolean",
            "description": "Also collect files from reposts. This applies to post links as well as accounts, so while it is off a link to a repost is reported as skipped rather than collected. The original author is credited on every row.",
            "default": false
          },
          "accountsAtOnce": {
            "title": "Accounts collected at once",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many accounts to work through in parallel. Raise it for large lists.",
            "default": 3
          },
          "countryCode": {
            "title": "Browse from",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "de",
              "fr",
              "es",
              "it",
              "nl",
              "br",
              "mx",
              "in",
              "jp",
              "sg",
              "ae"
            ],
            "type": "string",
            "description": "The country to browse from. Affects which posts X shows publicly in a few regions.",
            "default": "us"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}