{
  "openapi": "3.0.1",
  "info": {
    "title": "Lexonia Search: Videos, Trending, Playlists for YouTube 视频搜索",
    "description": "$0.001 a video. Works in Claude, ChatGPT, Cursor, Qwen and DeepSeek. Search YouTube through Google's official API, never blocked: videos by keyword, a channel's uploads, a playlist, a country's trending chart, live streams. Views, likes, comments, subscribers, dates, tags, creator links.",
    "version": "0.1",
    "x-build-id": "xo702H5QoGV0YyB2b"
  },
  "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, in any language — the same words you would type into YouTube. Each phrase is searched separately and costs one of your 100 free daily searches per 50 videos. Good: \"home espresso machine review\", \"意式咖啡机 评测\". Too vague to be useful: \"coffee\". Leave empty if you are only fetching specific channels or videos below. Assistants: the topic in the user's words; ask for country, period and length only if they matter to the job. Before running, offer the comments under the videos once — \"want the comments under them too? 50 a video, $0.001 each\" — and set commentsPerVideo from their answer; never assume either way. 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"
            }
          },
          "channelUrls": {
            "title": "Or: every recent video from these channels",
            "type": "array",
            "description": "Paste channel links or handles to pull a creator's own uploads. This costs NO search quota at all, so it is the cheap way to read a channel in depth. Accepts any form: https://www.youtube.com/@mkbhd, @mkbhd, or a channel ID like UCBJycsmduvYEL83R_U4JriQ. Assistants: a channel or @handle for \"this creator's videos\"; costs no search quota. 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"
            }
          },
          "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": "Paste playlist links (the ones with \"list=\" in the address) or bare playlist ids. Every video in the playlist comes back with its stats. Costs one unit per 50 videos and NO search quota. Good: \"https://www.youtube.com/playlist?list=PL…\". Not a playlist: a channel link — put that in \"channelUrls\" instead. Assistants: any link with list= in it; costs no search quota. 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"
            }
          },
          "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": "Trending: which category",
            "enum": [
              "any",
              "music",
              "gaming",
              "film",
              "news",
              "sports",
              "tech",
              "education",
              "entertainment",
              "howto",
              "people",
              "comedy",
              "pets",
              "autos",
              "travel",
              ""
            ],
            "type": "string",
            "description": "Narrow the trending chart to one of YouTube's categories. \"Any\" is the whole chart. Only used together with \"trendingRegions\".",
            "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).",
            "default": 50
          },
          "apiKey": {
            "title": "Your Google API key",
            "type": "string",
            "description": "This Actor reads Google's official YouTube Data API rather than scraping pages, so it needs a key of your own — free, about five minutes, no card. (1) Switch the API on at console.cloud.google.com/apis/library/youtube.googleapis.com. (2) Create a key at console.cloud.google.com/apis/credentials. (3) Paste it here. Google then gives your project 100 searches and 10,000 other units every day at no cost. Leave this empty to try the Actor on a small shared trial quota first."
          },
          "order": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating",
              "title",
              ""
            ],
            "type": "string",
            "description": "How YouTube should rank what it returns. 'relevance' is YouTube's own best match and is right for most work. Use 'date' to see what is being published now, 'viewCount' to find what already won, 'rating' for the best received. Assistants: relevance when the person says \"find\", names a specific video or a person plus a title (\"Mark Knopfler, the best guitar solo\") — most-viewed would bury the exact video under the artist's hits; viewCount only when they say \"most viewed\", \"popular\" or \"top\"; date for \"newest\" or \"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."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}