{
  "openapi": "3.0.1",
  "info": {
    "title": "Viral Audio Scraper",
    "version": "0.1",
    "x-build-id": "6TmUJ6tzKowP7BsXf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/andrew_babo~viral-audio-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-andrew_babo-viral-audio-scraper",
        "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/andrew_babo~viral-audio-scraper/runs": {
      "post": {
        "operationId": "runs-sync-andrew_babo-viral-audio-scraper",
        "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/andrew_babo~viral-audio-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-andrew_babo-viral-audio-scraper",
        "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": {
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which short-video platforms to scan. Each platform runs independently: if one is blocked or changes its layout, the run still finishes successfully with the results of the others plus a warning row.",
            "items": {
              "type": "string",
              "enum": [
                "tiktok",
                "youtube",
                "instagram"
              ],
              "enumTitles": [
                "TikTok",
                "YouTube Shorts",
                "Instagram Reels"
              ]
            },
            "default": [
              "tiktok",
              "youtube"
            ]
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code used to personalize what is trending, e.g. \"VN\", \"US\", \"JP\". TikTok is scanned through a residential IP in this country; YouTube results use the same regional context.",
            "default": "VN"
          },
          "limit": {
            "title": "Max sounds",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of ranked sounds in the output (across all selected platforms).",
            "default": 50
          },
          "scrollRounds": {
            "title": "TikTok scan depth",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "How many batches of TikTok trending videos to scan. One round is roughly 15-25 videos.",
            "default": 8
          },
          "youtubeQueries": {
            "title": "YouTube Shorts seed queries",
            "type": "array",
            "description": "Search phrases used to collect Shorts for the sound ranking. Leave empty to use sensible defaults (trending sound / viral song Shorts).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "instagramQueries": {
            "title": "Instagram hashtag keywords",
            "type": "array",
            "description": "Hashtag keywords to scan for trending Reels audio (e.g. \"viral\", \"remix\", \"trending\"). Optional; combine with profiles for better coverage.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "instagramReelUrls": {
            "title": "Instagram Reel URLs",
            "type": "array",
            "description": "Direct links to public Reels whose audio you want identified (paste URLs or shortcodes). Works without login via the public embed page.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "instagramProfiles": {
            "title": "Instagram profiles to scan",
            "type": "array",
            "description": "Public Instagram usernames whose recent Reels are scanned for song attribution. Instagram has no public trending chart for logged-out visitors, so the ranking is built from the accounts you list here (trend-setting creators in your niche work best).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "downloadAudio": {
            "title": "Download audio files",
            "type": "boolean",
            "description": "When enabled, the actor downloads each sound's audio into the run's key-value store and adds a permanent audioDownloadUrl. Off by default: items still include a direct audioUrl when the platform exposes one.",
            "default": false
          },
          "originalSoundsOnly": {
            "title": "Only original sounds",
            "type": "boolean",
            "description": "Restrict output to creator-made original sounds (no licensed commercial songs). Useful when you need copyright-safer audio.",
            "default": false
          },
          "failOnZeroResults": {
            "title": "Fail run on zero results",
            "type": "boolean",
            "description": "Off by default: when every platform is blocked, the run writes an explanatory status row and finishes successfully (keeps schedules green). Turn on to fail hard instead.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}