{
  "openapi": "3.0.1",
  "info": {
    "title": "RedGIFs Niche and Keyword Video Fetcher",
    "description": "Fetch RedGIFs niche/keyword metadata and optionally Download MP4 Videos by Niche or Keyword.",
    "version": "0.1",
    "x-build-id": "4i9ZykUT0FBn2JfaT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdesigndetail~redgifs-video-fetcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdesigndetail-redgifs-video-fetcher",
        "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/webdesigndetail~redgifs-video-fetcher/runs": {
      "post": {
        "operationId": "runs-sync-webdesigndetail-redgifs-video-fetcher",
        "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/webdesigndetail~redgifs-video-fetcher/run-sync": {
      "post": {
        "operationId": "run-sync-webdesigndetail-redgifs-video-fetcher",
        "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": [
          "keywords",
          "proxyConfiguration",
          "contentRightsAcknowledged"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords or niche slugs",
            "minItems": 1,
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "One or more authorized keywords. A keyword is converted to a RedGIFs niche slug first; optional search fallback is controlled by matchMode.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "matchMode": {
            "title": "Keyword matching mode",
            "enum": [
              "nicheOnly",
              "nicheThenSearch"
            ],
            "type": "string",
            "description": "Use only a matching niche, or fall back to the RedGIFs keyword-search endpoint if the niche does not exist.",
            "default": "nicheThenSearch"
          },
          "sort": {
            "title": "Result order",
            "enum": [
              "hot",
              "latest",
              "top"
            ],
            "type": "string",
            "description": "Order requested from RedGIFs for every keyword.",
            "default": "hot"
          },
          "maxItemsPerKeyword": {
            "title": "Maximum items per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap applied independently to each keyword after deduplication.",
            "default": 100
          },
          "downloadVideos": {
            "title": "Download video files",
            "type": "boolean",
            "description": "When enabled, authorized MP4 files are streamed through the same sticky Apify Proxy session into the default key-value store.",
            "default": true
          },
          "videoQuality": {
            "title": "Video quality",
            "enum": [
              "best",
              "hd",
              "sd"
            ],
            "type": "string",
            "description": "Best prefers HD and falls back to SD when HD is unavailable.",
            "default": "best"
          },
          "maxVideoBytes": {
            "title": "Maximum bytes per video",
            "minimum": 1048576,
            "maximum": 2147483648,
            "type": "integer",
            "description": "A download is stopped and recorded as skipped if it exceeds this number of bytes.",
            "default": 262144000
          },
          "maxTotalDownloadBytes": {
            "title": "Maximum total download bytes",
            "minimum": 1048576,
            "maximum": 20000000000,
            "type": "integer",
            "description": "Run-wide budget for stored video bytes. Metadata collection can continue after this budget is reached.",
            "default": 1073741824
          },
          "downloadConcurrency": {
            "title": "Download concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of video streams allowed at once. Keep this low to control bandwidth, storage, and proxy usage.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "HTTP timeout",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout in seconds for metadata and media HTTP operations.",
            "default": 45
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bounded retry count for transient timeouts, rate limits, and server failures.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Required. This Actor accepts only the integrated Apify Proxy (useApifyProxy must be true); custom or direct connections are rejected at runtime.",
            "default": {
              "useApifyProxy": true
            }
          },
          "contentRightsAcknowledged": {
            "title": "Rights and lawful-use acknowledgement",
            "type": "boolean",
            "description": "Required and must be true. You confirm that all users are adults where required, RedGIFs has authorized this access, and you have creator/rightsholder permission to download and store every requested file."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}