{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-aisa-youtube",
    "name": "Search YouTube videos, channels, and playlists",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/0xjordansg-yolo/openclaw-aisa-youtube",
    "canonicalUrl": "https://clawhub.ai/0xjordansg-yolo/openclaw-aisa-youtube",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openclaw-aisa-youtube",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-aisa-youtube",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "_meta.json",
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-aisa-youtube"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openclaw-aisa-youtube",
    "agentPageUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "YouTube Search (via AIsa)",
        "body": "Search YouTube videos, channels, and playlists through AIsa's unified API. No Google API key or OAuth setup needed — just your AIsa API key."
      },
      {
        "title": "Quick Start",
        "body": "# Search for videos (using requests — recommended)\npython <<'EOF'\nimport os, json, requests\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers={'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'},\n    params={'engine': 'youtube', 'q': 'coding tutorial'}\n).json()\nprint(json.dumps(results, indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://api.aisa.one/apis/v1/youtube/search\n\nAll YouTube search requests go through this single endpoint. AIsa handles authentication with the underlying YouTube data source — you only need your AIsa API key."
      },
      {
        "title": "Authentication",
        "body": "All requests require the AIsa API key in the Authorization header:\n\nAuthorization: Bearer $AISA_API_KEY\n\nEnvironment Variable: Set your API key as AISA_API_KEY:\n\nexport AISA_API_KEY=\"YOUR_AISA_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at AIsa Marketplace\nNavigate to your Dashboard\nCopy your API key"
      },
      {
        "title": "YouTube Search",
        "body": "GET /apis/v1/youtube/search\n\nQuery Parameters\n\nParameterTypeRequiredDescriptionenginestringYesMust be youtubeqstringYesSearch query (same syntax as YouTube search box)spstringNoYouTube filter token for pagination or advanced filtersglstringNoCountry code for localized results (e.g., us, jp, gb). Not all country codes are supported — see notes belowhlstringNoInterface language (e.g., en, zh, ja)\n\nExample: Basic Search\n\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=machine+learning+tutorial\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nExample: Search with Country & Language\n\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+news&gl=us&hl=en\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nExample: Pagination with sp Token\n\n# Use the sp token from a previous response to get the next page\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=python+tutorial&sp=EgIQAQ%3D%3D\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nResponse\n\nThe API returns structured YouTube search results including video metadata, channel info, thumbnails, and pagination tokens.\n\nNote: The response structure may vary by query language. English queries typically return results in the videos array. Some non-English queries may return results grouped in a sections array instead. Always check for both fields.\n\n{\n  \"search_metadata\": {\n    \"status\": \"Success\",\n    \"total_time_taken\": 1.2\n  },\n  \"search_parameters\": {\n    \"engine\": \"youtube\",\n    \"q\": \"machine learning tutorial\"\n  },\n  \"next_page_token\": \"CBQQABoCEgA%3D\",\n  \"videos\": [\n    {\n      \"position_on_page\": 1,\n      \"title\": \"Machine Learning Full Course for Beginners\",\n      \"link\": \"https://www.youtube.com/watch?v=abc123xyz\",\n      \"channel\": {\n        \"name\": \"Tech Academy\",\n        \"link\": \"https://www.youtube.com/channel/UCxyz123\",\n        \"thumbnail\": \"https://yt3.ggpht.com/...\"\n      },\n      \"published_date\": \"2 months ago\",\n      \"views\": 1500000,\n      \"length\": \"3:45:20\",\n      \"description\": \"Complete machine learning tutorial...\",\n      \"thumbnail\": {\n        \"static\": \"https://i.ytimg.com/vi/abc123xyz/hq720.jpg\",\n        \"rich\": \"https://i.ytimg.com/an_webp/abc123xyz/mqdefault_6s.webp\"\n      }\n    }\n  ]\n}\n\nAlternate response structure (non-English / some queries):\n\nSome queries return results grouped in sections instead of a flat videos array:\n\n{\n  \"sections\": [\n    {\n      \"title\": \"搜索结果\",\n      \"videos\": [\n        {\n          \"title\": \"编程教程...\",\n          \"link\": \"https://www.youtube.com/watch?v=...\",\n          ...\n        }\n      ]\n    }\n  ]\n}\n\nParsing both formats:\n\n# Handle both response structures\nvideos = results.get('videos', [])\nif not videos and 'sections' in results:\n    for section in results['sections']:\n        videos.extend(section.get('videos', []))"
      },
      {
        "title": "Advanced Search Tips",
        "body": "YouTube's q parameter supports the same search syntax as the YouTube search box:\n\nSearch SyntaxDescriptionExampleBasic keywordsStandard searchq=python tutorialExact phraseQuote for exact matchq=\"machine learning basics\"Channel filterSearch within a channelq=channel:GoogleDevelopers pythonDuration hintCombine with keywordsq=python tutorial long"
      },
      {
        "title": "Using the sp Filter Token",
        "body": "The sp parameter accepts YouTube's encoded filter tokens. Common values:\n\nFiltersp ValueDescriptionVideos onlyEgIQAQ%3D%3DFilter to video results onlyChannels onlyEgIQAg%3D%3DFilter to channel results onlyPlaylists onlyEgIQAw%3D%3DFilter to playlist results onlyLive nowEgJAAQ%3D%3DCurrently live streamsThis weekEgIIAw%3D%3DUploaded this weekThis monthEgIIBA%3D%3DUploaded this monthShort (<4 min)EgIYAQ%3D%3DShort duration videosLong (>20 min)EgIYAg%3D%3DLong duration videos\n\nYou can also obtain sp tokens from the next_page_token field in previous API responses for pagination.\n\nPagination\n\nUse the next_page_token from a response to fetch the next page of results:\n\n# First page\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'python tutorial'}\n).json()\n\n# Get next page token\nnext_token = results.get('next_page_token')\nif next_token:\n    page2 = requests.get(\n        'https://api.aisa.one/apis/v1/youtube/search',\n        headers=headers,\n        params={'engine': 'youtube', 'q': 'python tutorial', 'sp': next_token}\n    ).json()"
      },
      {
        "title": "JavaScript",
        "body": "const headers = {\n  'Authorization': `Bearer ${process.env.AISA_API_KEY}`\n};\n\n// Basic YouTube search\nconst results = await fetch(\n  'https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+agents+tutorial',\n  { headers }\n).then(r => r.json());\n\nconsole.log(results.videos);\n\n// Search with filters\nconst filtered = await fetch(\n  'https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=deep+learning&gl=us&hl=en&sp=EgIQAQ%3D%3D',\n  { headers }\n).then(r => r.json());"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\nheaders = {'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'}\n\n# Basic YouTube search\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'AI agents tutorial'}\n).json()\n\nfor video in results.get('videos', []):\n    print(f\"{video['title']} - {video.get('views', 'N/A')} views\")\n\n# Search with country and language\nresults_jp = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'プログラミング', 'gl': 'jp', 'hl': 'ja'}\n).json()"
      },
      {
        "title": "Python (urllib, no dependencies)",
        "body": "Note: urllib may encounter 403 errors due to its default User-Agent. Using requests (above) is recommended. If you must use urllib, always set a custom User-Agent header.\n\nimport urllib.request, urllib.parse, os, json\n\ndef youtube_search(query, gl=None, hl=None, sp=None):\n    \"\"\"Search YouTube via AIsa API.\"\"\"\n    params = {'engine': 'youtube', 'q': query}\n    if gl: params['gl'] = gl\n    if hl: params['hl'] = hl\n    if sp: params['sp'] = sp\n    \n    url = f'https://api.aisa.one/apis/v1/youtube/search?{urllib.parse.urlencode(params)}'\n    req = urllib.request.Request(url)\n    req.add_header('Authorization', f'Bearer {os.environ[\"AISA_API_KEY\"]}')\n    req.add_header('User-Agent', 'AIsa-Skill/1.0')\n    return json.load(urllib.request.urlopen(req))\n\n# Search\nresults = youtube_search('OpenClaw tutorial', gl='us', hl='en')\n\n# Handle both response formats\nvideos = results.get('videos', [])\nif not videos and 'sections' in results:\n    for section in results['sections']:\n        videos.extend(section.get('videos', []))\n\nprint(json.dumps(videos[:3], indent=2))"
      },
      {
        "title": "Combining with Other AIsa APIs",
        "body": "One of the key advantages of AIsa is the unified API key. Use the same AISA_API_KEY to combine YouTube search with other AIsa capabilities:"
      },
      {
        "title": "YouTube Search + LLM Summary",
        "body": "import os, requests, json\n\nheaders = {'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'}\n\n# 1. Search YouTube\nyt_results = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'latest AI developments 2026'}\n).json()\n\n# 2. Summarize with LLM (same API key!)\nvideo_titles = [v['title'] for v in yt_results.get('videos', [])[:5]]\nsummary = requests.post(\n    'https://api.aisa.one/v1/chat/completions',\n    headers={**headers, 'Content-Type': 'application/json'},\n    json={\n        'model': 'qwen3-flash',\n        'messages': [\n            {'role': 'user', 'content': f'Summarize the trending AI topics based on these YouTube videos: {json.dumps(video_titles)}'}\n        ]\n    }\n).json()\n\nprint(summary['choices'][0]['message']['content'])"
      },
      {
        "title": "YouTube Search + Web Search",
        "body": "# Search both YouTube and the web for comprehensive research\nyt_results = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'AI agent frameworks 2026'}\n).json()\n\nweb_results = requests.get(\n    'https://api.aisa.one/apis/v1/search/smart',\n    headers=headers,\n    params={'q': 'AI agent frameworks 2026'}\n).json()"
      },
      {
        "title": "Notes",
        "body": "All requests are pay-per-use through your AIsa balance — no separate YouTube API quota management\nThe engine parameter must always be set to youtube\nVideo URLs follow the format https://www.youtube.com/watch?v={videoId}\nChannel URLs follow the format https://www.youtube.com/channel/{channelId}\nUse next_page_token from previous responses as the sp value for pagination\nThe gl (country) parameter does not support all ISO country codes. Known unsupported values include cn (China). If you get Unsupported value errors, try omitting gl or use a different country code\nNon-English queries may return results in a sections array instead of a flat videos array — always handle both formats\nIMPORTANT: Python urllib may return 403 errors due to its default User-Agent. Use the requests library instead, or add a custom User-Agent header\nIMPORTANT: When using curl commands, ensure environment variables like $AISA_API_KEY are properly expanded\nIMPORTANT: When piping curl output to jq, use -s flag and ensure the API key is set"
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning200Successful search response400Invalid request parameters (missing engine or q)401Unauthorized — invalid or missing AIsa API key429Rate limited500Internal server error"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the AISA_API_KEY environment variable is set:\n\necho $AISA_API_KEY\n\nVerify the API key works with a simple test:\n\npython <<'EOF'\nimport os, json, requests\ntry:\n    result = requests.get(\n        'https://api.aisa.one/apis/v1/youtube/search',\n        headers={'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'},\n        params={'engine': 'youtube', 'q': 'test'}\n    ).json()\n    videos = result.get('videos', [])\n    print(f\"✅ API key is valid. Results: {len(videos)} videos found\")\nexcept Exception as e:\n    print(f\"❌ Error: {e}\")\nEOF"
      },
      {
        "title": "Troubleshooting: No Results",
        "body": "Verify your query is not empty\nTry a broader search term\nIf using gl, verify the country code is supported — not all ISO codes work (e.g., cn is unsupported). Try omitting gl to test\nEnsure engine=youtube is included in every request\nCheck if results are in sections instead of videos (common for non-English queries)"
      },
      {
        "title": "Resources",
        "body": "AIsa API Documentation\nAIsa Dashboard / Marketplace\nYouTube Search API Reference\nAIsa Smart Search API\nAIsa Chat Completions API\nOpenClaw Skills"
      }
    ],
    "body": "YouTube Search (via AIsa)\n\nSearch YouTube videos, channels, and playlists through AIsa's unified API. No Google API key or OAuth setup needed — just your AIsa API key.\n\nQuick Start\n# Search for videos (using requests — recommended)\npython <<'EOF'\nimport os, json, requests\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers={'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'},\n    params={'engine': 'youtube', 'q': 'coding tutorial'}\n).json()\nprint(json.dumps(results, indent=2))\nEOF\n\nBase URL\nhttps://api.aisa.one/apis/v1/youtube/search\n\n\nAll YouTube search requests go through this single endpoint. AIsa handles authentication with the underlying YouTube data source — you only need your AIsa API key.\n\nAuthentication\n\nAll requests require the AIsa API key in the Authorization header:\n\nAuthorization: Bearer $AISA_API_KEY\n\n\nEnvironment Variable: Set your API key as AISA_API_KEY:\n\nexport AISA_API_KEY=\"YOUR_AISA_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at AIsa Marketplace\nNavigate to your Dashboard\nCopy your API key\nAPI Reference\nYouTube Search\nGET /apis/v1/youtube/search\n\nQuery Parameters\nParameter\tType\tRequired\tDescription\nengine\tstring\tYes\tMust be youtube\nq\tstring\tYes\tSearch query (same syntax as YouTube search box)\nsp\tstring\tNo\tYouTube filter token for pagination or advanced filters\ngl\tstring\tNo\tCountry code for localized results (e.g., us, jp, gb). Not all country codes are supported — see notes below\nhl\tstring\tNo\tInterface language (e.g., en, zh, ja)\nExample: Basic Search\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=machine+learning+tutorial\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nExample: Search with Country & Language\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+news&gl=us&hl=en\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nExample: Pagination with sp Token\n# Use the sp token from a previous response to get the next page\ncurl -s -X GET \"https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=python+tutorial&sp=EgIQAQ%3D%3D\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\"\n\nResponse\n\nThe API returns structured YouTube search results including video metadata, channel info, thumbnails, and pagination tokens.\n\nNote: The response structure may vary by query language. English queries typically return results in the videos array. Some non-English queries may return results grouped in a sections array instead. Always check for both fields.\n\n{\n  \"search_metadata\": {\n    \"status\": \"Success\",\n    \"total_time_taken\": 1.2\n  },\n  \"search_parameters\": {\n    \"engine\": \"youtube\",\n    \"q\": \"machine learning tutorial\"\n  },\n  \"next_page_token\": \"CBQQABoCEgA%3D\",\n  \"videos\": [\n    {\n      \"position_on_page\": 1,\n      \"title\": \"Machine Learning Full Course for Beginners\",\n      \"link\": \"https://www.youtube.com/watch?v=abc123xyz\",\n      \"channel\": {\n        \"name\": \"Tech Academy\",\n        \"link\": \"https://www.youtube.com/channel/UCxyz123\",\n        \"thumbnail\": \"https://yt3.ggpht.com/...\"\n      },\n      \"published_date\": \"2 months ago\",\n      \"views\": 1500000,\n      \"length\": \"3:45:20\",\n      \"description\": \"Complete machine learning tutorial...\",\n      \"thumbnail\": {\n        \"static\": \"https://i.ytimg.com/vi/abc123xyz/hq720.jpg\",\n        \"rich\": \"https://i.ytimg.com/an_webp/abc123xyz/mqdefault_6s.webp\"\n      }\n    }\n  ]\n}\n\n\nAlternate response structure (non-English / some queries):\n\nSome queries return results grouped in sections instead of a flat videos array:\n\n{\n  \"sections\": [\n    {\n      \"title\": \"搜索结果\",\n      \"videos\": [\n        {\n          \"title\": \"编程教程...\",\n          \"link\": \"https://www.youtube.com/watch?v=...\",\n          ...\n        }\n      ]\n    }\n  ]\n}\n\n\nParsing both formats:\n\n# Handle both response structures\nvideos = results.get('videos', [])\nif not videos and 'sections' in results:\n    for section in results['sections']:\n        videos.extend(section.get('videos', []))\n\nAdvanced Search Tips\n\nYouTube's q parameter supports the same search syntax as the YouTube search box:\n\nSearch Syntax\tDescription\tExample\nBasic keywords\tStandard search\tq=python tutorial\nExact phrase\tQuote for exact match\tq=\"machine learning basics\"\nChannel filter\tSearch within a channel\tq=channel:GoogleDevelopers python\nDuration hint\tCombine with keywords\tq=python tutorial long\nUsing the sp Filter Token\n\nThe sp parameter accepts YouTube's encoded filter tokens. Common values:\n\nFilter\tsp Value\tDescription\nVideos only\tEgIQAQ%3D%3D\tFilter to video results only\nChannels only\tEgIQAg%3D%3D\tFilter to channel results only\nPlaylists only\tEgIQAw%3D%3D\tFilter to playlist results only\nLive now\tEgJAAQ%3D%3D\tCurrently live streams\nThis week\tEgIIAw%3D%3D\tUploaded this week\nThis month\tEgIIBA%3D%3D\tUploaded this month\nShort (<4 min)\tEgIYAQ%3D%3D\tShort duration videos\nLong (>20 min)\tEgIYAg%3D%3D\tLong duration videos\n\nYou can also obtain sp tokens from the next_page_token field in previous API responses for pagination.\n\nPagination\n\nUse the next_page_token from a response to fetch the next page of results:\n\n# First page\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'python tutorial'}\n).json()\n\n# Get next page token\nnext_token = results.get('next_page_token')\nif next_token:\n    page2 = requests.get(\n        'https://api.aisa.one/apis/v1/youtube/search',\n        headers=headers,\n        params={'engine': 'youtube', 'q': 'python tutorial', 'sp': next_token}\n    ).json()\n\nCode Examples\nJavaScript\nconst headers = {\n  'Authorization': `Bearer ${process.env.AISA_API_KEY}`\n};\n\n// Basic YouTube search\nconst results = await fetch(\n  'https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+agents+tutorial',\n  { headers }\n).then(r => r.json());\n\nconsole.log(results.videos);\n\n// Search with filters\nconst filtered = await fetch(\n  'https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=deep+learning&gl=us&hl=en&sp=EgIQAQ%3D%3D',\n  { headers }\n).then(r => r.json());\n\nPython\nimport os\nimport requests\n\nheaders = {'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'}\n\n# Basic YouTube search\nresults = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'AI agents tutorial'}\n).json()\n\nfor video in results.get('videos', []):\n    print(f\"{video['title']} - {video.get('views', 'N/A')} views\")\n\n# Search with country and language\nresults_jp = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'プログラミング', 'gl': 'jp', 'hl': 'ja'}\n).json()\n\nPython (urllib, no dependencies)\n\nNote: urllib may encounter 403 errors due to its default User-Agent. Using requests (above) is recommended. If you must use urllib, always set a custom User-Agent header.\n\nimport urllib.request, urllib.parse, os, json\n\ndef youtube_search(query, gl=None, hl=None, sp=None):\n    \"\"\"Search YouTube via AIsa API.\"\"\"\n    params = {'engine': 'youtube', 'q': query}\n    if gl: params['gl'] = gl\n    if hl: params['hl'] = hl\n    if sp: params['sp'] = sp\n    \n    url = f'https://api.aisa.one/apis/v1/youtube/search?{urllib.parse.urlencode(params)}'\n    req = urllib.request.Request(url)\n    req.add_header('Authorization', f'Bearer {os.environ[\"AISA_API_KEY\"]}')\n    req.add_header('User-Agent', 'AIsa-Skill/1.0')\n    return json.load(urllib.request.urlopen(req))\n\n# Search\nresults = youtube_search('OpenClaw tutorial', gl='us', hl='en')\n\n# Handle both response formats\nvideos = results.get('videos', [])\nif not videos and 'sections' in results:\n    for section in results['sections']:\n        videos.extend(section.get('videos', []))\n\nprint(json.dumps(videos[:3], indent=2))\n\nCombining with Other AIsa APIs\n\nOne of the key advantages of AIsa is the unified API key. Use the same AISA_API_KEY to combine YouTube search with other AIsa capabilities:\n\nYouTube Search + LLM Summary\nimport os, requests, json\n\nheaders = {'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'}\n\n# 1. Search YouTube\nyt_results = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'latest AI developments 2026'}\n).json()\n\n# 2. Summarize with LLM (same API key!)\nvideo_titles = [v['title'] for v in yt_results.get('videos', [])[:5]]\nsummary = requests.post(\n    'https://api.aisa.one/v1/chat/completions',\n    headers={**headers, 'Content-Type': 'application/json'},\n    json={\n        'model': 'qwen3-flash',\n        'messages': [\n            {'role': 'user', 'content': f'Summarize the trending AI topics based on these YouTube videos: {json.dumps(video_titles)}'}\n        ]\n    }\n).json()\n\nprint(summary['choices'][0]['message']['content'])\n\nYouTube Search + Web Search\n# Search both YouTube and the web for comprehensive research\nyt_results = requests.get(\n    'https://api.aisa.one/apis/v1/youtube/search',\n    headers=headers,\n    params={'engine': 'youtube', 'q': 'AI agent frameworks 2026'}\n).json()\n\nweb_results = requests.get(\n    'https://api.aisa.one/apis/v1/search/smart',\n    headers=headers,\n    params={'q': 'AI agent frameworks 2026'}\n).json()\n\nNotes\nAll requests are pay-per-use through your AIsa balance — no separate YouTube API quota management\nThe engine parameter must always be set to youtube\nVideo URLs follow the format https://www.youtube.com/watch?v={videoId}\nChannel URLs follow the format https://www.youtube.com/channel/{channelId}\nUse next_page_token from previous responses as the sp value for pagination\nThe gl (country) parameter does not support all ISO country codes. Known unsupported values include cn (China). If you get Unsupported value errors, try omitting gl or use a different country code\nNon-English queries may return results in a sections array instead of a flat videos array — always handle both formats\nIMPORTANT: Python urllib may return 403 errors due to its default User-Agent. Use the requests library instead, or add a custom User-Agent header\nIMPORTANT: When using curl commands, ensure environment variables like $AISA_API_KEY are properly expanded\nIMPORTANT: When piping curl output to jq, use -s flag and ensure the API key is set\nError Handling\nStatus\tMeaning\n200\tSuccessful search response\n400\tInvalid request parameters (missing engine or q)\n401\tUnauthorized — invalid or missing AIsa API key\n429\tRate limited\n500\tInternal server error\nTroubleshooting: API Key Issues\nCheck that the AISA_API_KEY environment variable is set:\necho $AISA_API_KEY\n\nVerify the API key works with a simple test:\npython <<'EOF'\nimport os, json, requests\ntry:\n    result = requests.get(\n        'https://api.aisa.one/apis/v1/youtube/search',\n        headers={'Authorization': f'Bearer {os.environ[\"AISA_API_KEY\"]}'},\n        params={'engine': 'youtube', 'q': 'test'}\n    ).json()\n    videos = result.get('videos', [])\n    print(f\"✅ API key is valid. Results: {len(videos)} videos found\")\nexcept Exception as e:\n    print(f\"❌ Error: {e}\")\nEOF\n\nTroubleshooting: No Results\nVerify your query is not empty\nTry a broader search term\nIf using gl, verify the country code is supported — not all ISO codes work (e.g., cn is unsupported). Try omitting gl to test\nEnsure engine=youtube is included in every request\nCheck if results are in sections instead of videos (common for non-English queries)\nResources\nAIsa API Documentation\nAIsa Dashboard / Marketplace\nYouTube Search API Reference\nAIsa Smart Search API\nAIsa Chat Completions API\nOpenClaw Skills"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/0xjordansg-yolo/openclaw-aisa-youtube",
    "publisherUrl": "https://clawhub.ai/0xjordansg-yolo/openclaw-aisa-youtube",
    "owner": "0xjordansg-yolo",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-aisa-youtube",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-aisa-youtube/agent.md"
  }
}