Skip to main content
View on GitHub -> YouTube search without separate Google setup. Search videos, channels, and playlists through AIsa with one API key.

Install

First, install the AIsa CLI if you have not already:
Then install the skill:

What can agents do with it?

Content research

Find videos and channels around a topic.

Trend discovery

Identify what is gaining attention on YouTube.

Competitor tracking

Monitor channels and content formats in a niche.

Topic exploration

Gather video-first evidence for research workflows.

Quick Start

Base URL

All YouTube search requests go through this single endpoint. AIsa handles authentication with the underlying YouTube data source — you only need your AIsa API key.

Authentication

All requests require the AIsa API key in the Authorization header:
Environment Variable: Set your API key as AISA_API_KEY:

Getting Your API Key

  1. Sign in or create an account at AIsa Console
  2. Navigate to your Dashboard
  3. Copy your API key

API Reference

Query Parameters

Example: Search with Country & Language

Example: Pagination with sp Token

Response

The API returns structured YouTube search results including video metadata, channel info, thumbnails, and pagination tokens. Note: 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.
Alternate response structure (non-English / some queries): Some queries return results grouped in sections instead of a flat videos array:
Parsing both formats:

Advanced Search Tips

YouTube’s q parameter supports the same search syntax as the YouTube search box:

Using the sp Filter Token

The sp parameter accepts YouTube’s encoded filter tokens. Common values: You can also obtain sp tokens from the next_page_token field in previous API responses for pagination.

Pagination

Use the next_page_token from a response to fetch the next page of results:

Code Examples

JavaScript

Python

Python (urllib, no dependencies)

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.

Combining with Other AIsa APIs

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:

YouTube Search + LLM Summary

Notes

  • All requests are pay-per-use through your AIsa balance — no separate YouTube API quota management
  • The engine parameter must always be set to youtube
  • Video URLs follow the format https://www.youtube.com/watch?v={videoId}
  • Channel URLs follow the format https://www.youtube.com/channel/{channelId}
  • Use next_page_token from previous responses as the sp value for pagination
  • The 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
  • Non-English queries may return results in a sections array instead of a flat videos array — always handle both formats
  • IMPORTANT: Python urllib may return 403 errors due to its default User-Agent. Use the requests library instead, or add a custom User-Agent header
  • IMPORTANT: When using curl commands, ensure environment variables like $AISA_API_KEY are properly expanded
  • IMPORTANT: When piping curl output to jq, use -s flag and ensure the API key is set

Error Handling

Troubleshooting: API Key Issues

  1. Check that the AISA_API_KEY environment variable is set:
  1. Verify the API key works with a simple test:

Troubleshooting: No Results

  1. Verify your query is not empty
  2. Try a broader search term
  3. If using gl, verify the country code is supported — not all ISO codes work (e.g., cn is unsupported). Try omitting gl to test
  4. Ensure engine=youtube is included in every request
  5. Check if results are in sections instead of videos (common for non-English queries)

Resources

Get started

  1. Sign up at aisa.one (new accounts start with $2 free credit).
  2. Generate an API key from the console.
  3. Set your key and install the skill:
  4. Start a new agent session so the runtime loads the updated skill instructions.

YouTube SERP

Existing SERP-oriented YouTube skill.

AIsa YouTube Search

AIsa-branded YouTube search workflow.

YouTube Search endpoint

Endpoint reference for YouTube search.