{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk File Downloader (Apify storage only)",
    "description": "Download files from URLs you supply into this run's Apify key-value store and list them in a dataset. v1 does not upload to S3. Hard cap 5 MB; oversize Content-Length is aborted before the body. Mid-fail or timed-out downloads are billed; instant 404s, blocks and skipped files are free.",
    "version": "0.1",
    "x-build-id": "QMsVYUws0lni0F8QE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gramsesh~file-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gramsesh-file-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/gramsesh~file-downloader/runs": {
      "post": {
        "operationId": "runs-sync-gramsesh-file-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/gramsesh~file-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-gramsesh-file-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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "File URLs",
            "type": "array",
            "description": "Direct links to files you have the right to download (your own storage, a CDN, or a public-domain source). A small example.com page is prefilled for a trial run. Social and streaming platform pages are rejected.",
            "items": {
              "type": "string"
            }
          },
          "filenamePrefix": {
            "title": "Key prefix",
            "type": "string",
            "description": "Optional prefix for key-value store keys (for example 'batch1'). Keys look like 0001-filename.ext."
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of downloads in flight. Default 3, hard maximum 5.",
            "default": 3
          },
          "perHostRatePerSecond": {
            "title": "Per-host rate (requests per second)",
            "minimum": 0.1,
            "maximum": 3,
            "type": "number",
            "description": "Maximum downloads per second to any one host. Default 1, hard maximum 3. robots.txt crawl-delay, if present, is also honored.",
            "default": 1
          },
          "timeoutSecs": {
            "title": "Timeout per file (seconds)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Default 8, hard maximum 10. Enough for a 5 MB file on a slow link. The run also stops at a 60-second wall-clock hang cap.",
            "default": 8
          },
          "maxRedirects": {
            "title": "Max redirects",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Each hop is re-checked for SSRF. Default 5, hard maximum 10.",
            "default": 5
          },
          "maxFiles": {
            "title": "Max files per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Further URLs are skipped and are free. Default 50, hard maximum 100.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max size per file (MB)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Default and hard maximum 5 MB. Files with a Content-Length over the cap are aborted before the body.",
            "default": 5
          },
          "maxTotalMb": {
            "title": "Max total bytes per run (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "1 MB = 1,000,000 bytes. Further files are skipped once this budget is used. Default 100, hard maximum 500.",
            "default": 100
          },
          "allowedContentTypes": {
            "title": "Allowed content types",
            "type": "array",
            "description": "Optional allow-list (for example image/png or image/*). If set, any other type is rejected without being stored.",
            "items": {
              "type": "string"
            }
          },
          "deniedContentTypes": {
            "title": "Denied content types",
            "type": "array",
            "description": "Optional deny-list (for example text/html). Matching responses are not stored.",
            "items": {
              "type": "string"
            }
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "On by default. The Actor fetches /robots.txt for each host (SSRF-checked, not billed as a file) and skips disallowed paths. It also honors crawl-delay, X-Robots-Tag none/noindex/noarchive, and an HTML meta robots noindex when present in the first 8 KB. A missing robots.txt is treated as allow.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}