{
  "openapi": "3.0.1",
  "info": {
    "title": "Lexonia Search: Videos, Trending, Playlists for YouTube 视频搜索",
    "description": "YouTube comments with likes, replies and dates, and YouTube video search through Google's official API, never blocked: channels on a topic or by name, every video of a channel, views, likes and dates, playlist videos, trending by country, live streams. Works in Claude, ChatGPT, Qwen and DeepSeek.",
    "version": "0.1",
    "x-build-id": "mkXaEFicd8Oej2LKx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lexonia~youtube-search-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lexonia-youtube-search-api",
        "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/lexonia~youtube-search-api/runs": {
      "post": {
        "operationId": "runs-sync-lexonia-youtube-search-api",
        "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/lexonia~youtube-search-api/run-sync": {
      "post": {
        "operationId": "run-sync-lexonia-youtube-search-api",
        "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": {
          "searchQueries": {
            "title": "Search YouTube for (one phrase per line)",
            "type": "array",
            "description": "What to search for, any language, the words you would type into YouTube. Each phrase is a separate search (one of the 100 free daily searches per 50 videos). Good: \"home espresso machine review\". Too vague: \"coffee\". Assistants: ONLY the person's own topic, never one from the examples; if none, leave empty and the app asks. Ask for country, period or length only if they matter. Offer the comments once (\"50 a video, $0.001 each?\") and set commentsPerVideo from the answer.",
            "items": {
              "type": "string"
            }
          },
          "channelSearchQueries": {
            "title": "Find channels on a topic (not videos)",
            "type": "array",
            "description": "Returns CHANNELS: name, @handle, subscribers, video count, total views, country, description and link, one row per channel, $0.001 each; one search of your quota per phrase. Good: \"home espresso\", \"Japanese woodworking\". Assistants: set this when the person says channels, creators, YouTubers or \"who makes videos about\"; leave it empty for videos. For a channel's videos afterwards, pass its link in channelUrls.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "Or: every recent video from these channels",
            "type": "array",
            "description": "Channel links or handles to pull a creator's own uploads; costs NO search quota, the cheap way to read a channel in depth. Any form: https://www.youtube.com/@mkbhd, @mkbhd, or a channel ID like UCBJycsmduvYEL83R_U4JriQ. Assistants: ONLY a channel the person gave, never one from the examples; if none, leave empty.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Or: these specific videos",
            "type": "array",
            "description": "Full details for videos you already have links to. Costs one unit per 50 videos and no search quota. Accepts watch links, youtu.be links, Shorts links or bare video IDs. Assistants: ONLY what the person said. Never take a place, site, link or topic from the examples on this page or from an earlier conversation; if the person did not give it, leave this empty and the app asks — an invented value runs and bills them.",
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "Or: every video in these playlists",
            "type": "array",
            "description": "Playlist links (with \"list=\" in the address) or bare playlist ids; every video comes back with its stats. One unit per 50 videos, NO search quota. A channel link goes in channelUrls. Assistants: ONLY a link the person gave, never one from the examples; if none, leave empty.",
            "items": {
              "type": "string"
            }
          },
          "trendingRegions": {
            "title": "Or: what is trending in these countries",
            "type": "array",
            "description": "Two-letter country codes — YouTube's own trending chart for each, up to 200 videos per country, optionally one category below. Costs one unit per 50 videos and NO search quota. Good: \"US\", \"BR\", \"JP\", \"DE\". Not this: a city or a language — trending is per country. Assistants: for \"what is trending in <country>\": the two-letter code; costs no search quota.",
            "items": {
              "type": "string"
            }
          },
          "trendingCategory": {
            "title": "Category (trending chart and searches)",
            "enum": [
              "any",
              "music",
              "gaming",
              "film",
              "news",
              "sports",
              "tech",
              "education",
              "entertainment",
              "howto",
              "people",
              "comedy",
              "pets",
              "autos",
              "travel",
              ""
            ],
            "type": "string",
            "description": "Narrow the trending chart OR a search to one of YouTube's own categories. \"Any\" is everything. Assistants: set it when the person names a kind of video — \"travel videos\" → travel, \"music videos\" → music, \"gaming videos\" → gaming; leave \"any\" otherwise. Good: \"the most-viewed travel videos this week in the US\" → travel. Bad: setting a category the person did not mention.",
            "default": "any"
          },
          "maxResults": {
            "title": "How many videos per search or channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper limit per phrase and per channel. Every 50 videos from a search costs one of your 100 daily searches; channel videos cost none. Good starting point: 50. Raise it when you are reading one channel deeply, lower it when you are sampling many phrases. Assistants: size it to the ask — \"find me X\" or a named video means 5; \"a few\" means 10; ask \"how many?\" only above 50. Never leave 50 for a person looking for one video (25 Sep: a one-video ask returned 50 rows). Free plan: up to 50.",
            "default": 50
          },
          "apiKey": {
            "title": "Your Google API key",
            "type": "string",
            "description": "Optional. Left empty, the Actor runs on a shared trial key: searches return up to 25 videos a phrase; trending, playlists, channels and video links are not limited. Your own key lifts the search limit and gives your project 100 searches and 10,000 other units a day, free: switch the API on at console.cloud.google.com/apis/library/youtube.googleapis.com, create a key at console.cloud.google.com/apis/credentials, paste it here (about five minutes, no card)."
          },
          "order": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating",
              "title",
              ""
            ],
            "type": "string",
            "description": "How YouTube ranks what it returns. relevance: YouTube's best match, right for most work. date: what is being published now. viewCount: what already won. rating: best received. Assistants: relevance when the person says \"find\" or names a specific video or a person plus a title (most-viewed would bury the exact video under the artist's hits); viewCount only for \"most viewed\", \"popular\", \"top\"; date for \"newest\", \"this week\".",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Only videos published after",
            "type": "string",
            "description": "Cuts off older videos. Use it to see a trend rather than an archive — for example the last 90 days. Format: 2026-06-01T00:00:00Z. Leave empty for no limit."
          },
          "publishedBefore": {
            "title": "Only videos published before",
            "type": "string",
            "description": "The other end of a date window, same format: 2026-09-01T00:00:00Z. Leave empty for no limit."
          },
          "regionCode": {
            "title": "Search as if in this country",
            "type": "string",
            "description": "A two-letter country code that makes YouTube rank results the way it would for someone there — US, GB, DE, UA, JP. Worth setting when the audience you care about is in one country. Leave empty to search without a country bias. Assistants: this is where the VIEWERS are, not what the videos are about — for videos about a place, put the place in the search words (\"USA road trip\", \"Japan street food\"); set the code only when the person names whose viewing matters."
          },
          "relevanceLanguage": {
            "title": "Prefer results in this language",
            "type": "string",
            "description": "A two-letter language code — en, uk, de, zh, ja. Nudges YouTube towards that language without hiding everything else. Leave empty for no preference."
          },
          "videoDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              ""
            ],
            "type": "string",
            "description": "Filter by rough length. 'short' is under 4 minutes, 'medium' 4–20, 'long' over 20. Use 'long' for interviews, reviews and documentaries; 'short' mostly returns Shorts.",
            "default": "any"
          },
          "liveStreams": {
            "title": "Live streams only",
            "enum": [
              "",
              "live",
              "upcoming",
              "completed"
            ],
            "type": "string",
            "description": "Applies to the search phrases: only streams that are live right now, scheduled (upcoming), or already ended (completed). Leave the phrases empty to get the top streams of that kind. Each page still costs one search. Good: \"live\" with the phrase \"chess\". Not this: expecting a recording — a live stream that has ended is \"completed\". Assistants: for \"who is streaming X right now\": set live, keep the topic in searchQueries; leave the topic empty for the top streams overall.",
            "default": ""
          },
          "excludeShorts": {
            "title": "Leave out Shorts",
            "type": "boolean",
            "description": "ON drops every video of 60 seconds or less after the numbers come back. Useful when you want real videos rather than clips — Shorts skew view counts and rarely carry a contact in the description.",
            "default": false
          },
          "commentsPerVideo": {
            "title": "Comments under each video",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many comments to read under each video returned: 0 (default) reads none. Up to 500 a video, $0.001 each, on the row and in one COMMENTS.csv. A video with comments switched off says so and costs nothing. Assistants: offer it once before every search or channel run, with the price, and set it from the answer; when they ask what viewers say, think or complain about, it is a yes. 50 a video is a good first read. Good: 50. Bad: 500 on 200 videos when they asked for \"a feel for the comments\".",
            "default": 0
          },
          "commentOrder": {
            "title": "Comments: which first",
            "enum": [
              "top",
              "newest",
              ""
            ],
            "type": "string",
            "description": "Top = the comments YouTube ranks highest (most liked and replied). Newest = the latest. Assistants: \"what do people think\" means top; \"what are they saying now\" or \"after the update\" means newest.",
            "default": "top"
          },
          "includeChannelDetails": {
            "title": "Include the creator's channel details",
            "type": "boolean",
            "description": "ON (default) adds subscriber count, total views, country, and the channel description — which is where creators usually publish a business email or their own site. Costs one unit per 50 channels and almost never worth switching off.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}