{
  "openapi": "3.0.1",
  "info": {
    "title": "9GAG Media Downloader",
    "description": "Extract and download high-quality images and videos from 9GAG posts. Supports hot, trending, fresh feeds and search. Provides detailed metadata including upvotes, comments, tags, and media URLs.",
    "version": "1.3",
    "x-build-id": "0vFRcMPnnw09aac2C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codingfrontend~9gag-media-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codingfrontend-9gag-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/codingfrontend~9gag-media-downloader/runs": {
      "post": {
        "operationId": "runs-sync-codingfrontend-9gag-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/codingfrontend~9gag-media-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-codingfrontend-9gag-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": {
          "section": {
            "title": "Section",
            "enum": [
              "hot",
              "trending",
              "fresh",
              "top",
              "news",
              "search"
            ],
            "type": "string",
            "description": "Public feed to collect when startUrls is empty.",
            "default": "hot"
          },
          "query": {
            "title": "Search Query",
            "maxLength": 200,
            "type": "string",
            "description": "Required for search mode unless startUrls are supplied.",
            "default": ""
          },
          "tags": {
            "title": "Tags",
            "maxItems": 20,
            "type": "array",
            "description": "The first tag selects a public 9GAG group feed.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "default": []
          },
          "startUrls": {
            "title": "Start URLs",
            "maxItems": 50,
            "type": "array",
            "description": "Optional 9GAG feed, search, tag, interest, or direct post URLs. Each entry must be an object with a url property. Supported routes are /hot, /trending, /fresh, /top, /news, /search?query=..., /tag/{tag}, /interest/{interest}, and /gag/{postId}. Custom URLs take precedence over Section, Search Query, and Tags.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "9GAG URL",
                  "type": "string",
                  "description": "HTTPS URL on 9gag.com.",
                  "pattern": "^https://(?:www\\.)?9gag\\.com(?:/|$)"
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "maxItems": {
            "title": "Maximum Posts",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of valid posts across all selected targets.",
            "default": 50
          },
          "maxPages": {
            "title": "Max Feed Pages",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum feed pages per feed target; 0 derives a bound from maxItems. Direct post URLs use one page.",
            "default": 0
          },
          "mediaTypes": {
            "title": "Media Types",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional photo/video filter. An empty list includes both types.",
            "items": {
              "type": "string",
              "enum": [
                "photo",
                "video"
              ]
            },
            "default": []
          },
          "deduplicate": {
            "title": "Deduplicate Posts",
            "type": "boolean",
            "description": "Remove repeated post IDs across pages and targets.",
            "default": true
          },
          "includeCreator": {
            "title": "Include Creator",
            "type": "boolean",
            "description": "Include public creator fields exposed by 9GAG.",
            "default": true
          },
          "includeMediaVariants": {
            "title": "Include Media Variants",
            "type": "boolean",
            "description": "Include the nested media object with image, thumbnail, and video variants when available.",
            "default": true
          },
          "includeTopComment": {
            "title": "Include Top Comment",
            "type": "boolean",
            "description": "Include the public top comment when present in feed data.",
            "default": false
          },
          "pageDelayMs": {
            "title": "Delay Between Requests (ms)",
            "minimum": 250,
            "maximum": 5000,
            "type": "integer",
            "description": "Pause before each request and retry to pace collection.",
            "default": 500
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (seconds)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to wait for one public 9GAG request.",
            "default": 60
          },
          "maxRetries": {
            "title": "Retry Attempts",
            "minimum": 0,
            "maximum": 2,
            "type": "integer",
            "description": "Additional attempts for selected temporary server errors. Access-denial and rate-limit responses are not retried.",
            "default": 2
          },
          "maxResponseBytes": {
            "title": "Maximum Response Size (bytes)",
            "minimum": 100000,
            "maximum": 20000000,
            "type": "integer",
            "description": "Largest public response accepted for one request.",
            "default": 5000000
          },
          "locale": {
            "title": "Request Locale",
            "pattern": "^[a-z]{2,3}(?:-[A-Z]{2})?$",
            "type": "string",
            "description": "Language and optional region sent with requests, for example en-US.",
            "default": "en-US"
          },
          "proxyConfiguration": {
            "title": "Proxy Settings",
            "type": "object",
            "description": "Optional Apify Proxy or custom proxy URLs. Apify groups and country require useApifyProxy to be true. Custom proxy URLs cannot be combined with Apify Proxy settings. Apify Proxy may incur additional charges.",
            "default": {
              "useApifyProxy": false
            }
          },
          "includePostDetails": {
            "title": "Include Post Page Details",
            "type": "boolean",
            "description": "Fetch the matching public post page for complete descriptions, publication/modification dates and additional media. Adds at most one request per selected unique post. A failed detail request preserves the feed record and makes the run partial. Direct post URLs already require a page request.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}