SDKs · CLI · MCP

Libraries that install

Ready-made tools for programmers, so you do not have to build every request by hand. Pick the one for the language you use. Every install command here was tested on 9 October 2026, and anything we could not test is labelled.

Package name correction: the TypeScript package on npm is ytapis-core. An npm package called ytapis does not exist, so npm install ytapis fails.

The npm ytapis-cli and ytapis-mcp packages (version 2.0.0) depend on an old ytapis-core@1, which breaks them. The fix is in the CLI and MCP section.

LanguageInstallRegistry status (9 Oct 2026)Tested here
TypeScript / JSnpm install ytapis-corePublished · v2.0.0Yes · search, video, stats
Pythonpip install ytapisPublished · v2.0.0Yes · search, get_video
CLIytapis-cli (npm)Published · v2.0.0Needs override
MCP serverytapis-mcp (npm)Published · v2.0.0Needs override
Dart / Flutterdart pub add ytapisPublished on pub.devNot run here
Gogo get github.com/pgboyahpgr-commits/ytapis/goSource folder in repoNot run here
C# / .NETdotnet add package YtapisNot found on NuGet—
Kotlin / JVMMaven coordinates from the repoNot found on Maven Central—
Rustcargo add ytapisNot found on crates.io—
PHPcomposer require geethudinoyt/ytapisNot found on Packagist—
C++ / LuaCopy from the repoSource in repoNot run here

“Not found” means the package name did not resolve at check time. If you have published under a different name, update this table, or tell us and we will fix the page.

TypeScript / JavaScript

ytapis-core

Verified on Node.js 20. Exports search, video, comments, transcript, channel and Shorts helpers, plus createClient for a shared cache and withRetry for backoff.

1 · Install

$npm install ytapis-core

2 · Use

search.mjs
import { search, getVideo, getVideoStats } from 'ytapis-core';

const { results } = await search('cats', { limit: 5 });
console.log(results[0].title, results[0].viewCount);

const video = await getVideo('dQw4w9WgXcQ');
console.log(video.title, video.isVerified);

const stats = await getVideoStats('dQw4w9WgXcQ');
console.log(stats.views, stats.likes);

Run it with node search.mjs from a folder where you ran the install. Tested on 9 October 2026: search returned results, getVideo returned the right title, and stats came back as numbers.

More exports

Verified in the installed package:

search(query, {limit})searchContinuesearchTrendingsearchShortssearchChannelsearchPlaylistgetVideogetVideoStatsgetLiveStreamInfogetCommentsgetRelatedVideosgetChannelMetadatagetTranscriptcreateClientwithRetryLRUCache

Trending and transcript calls returned empty lists when we tested them. Handle the empty case (see Errors & limits).

Python 3

ytapis

Returns typed objects, so you use video.view_count instead of parsing JSON. Also exports search_continue and search_dicts for raw dictionaries.

1 · Install

$pip install ytapis

2 · Use

demo.py
from ytapis import search, get_video

for v in search("cats", limit=5):
    print(v.title, "|", v.view_count, "|", v.duration)

video = get_video("dQw4w9WgXcQ")
print(video.title, video.is_verified)

Tested on 9 October 2026 with Python 3.13. search returned a list of VideoResult objects, and get_video returned the expected title.

Signatures (verified)

ytapis exports
search(query: str, limit: int = 15, gl=None, hl=None) -> list[VideoResult]
get_video(video_id: str) -> VideoResult
search_continue(continuation: str, limit: int = 15, ...) -> SearchResponse
search_dicts(query: str, limit: int = 15) -> list[dict]

Some Python helpers from the README (get_comments, get_transcript) are not exported at the top level in 2.0.0, so this page leaves them out.

CLI & MCP server

Working install for the CLI and MCP

Version 2.0.0 of both npm packages depends on ytapis-core@^1, which is missing functions such as getVideo. Pinning core to 2.0.0 with an npm overrides entry fixes both. We verified the result.

1 · Create a tools folder

package.json
{
  "name": "ytapis-tools",
  "private": true,
  "overrides": {
    "ytapis-core": "2.0.0"
  }
}

2 · Install both packages

$npm install ytapis-cli@2.0.0 ytapis-mcp@2.0.0

3 · Try the CLI

$npx ytapis search cats --limit 5
$npx ytapis video dQw4w9WgXcQ

Verified: search printed real results and video printed title, views and duration.

4 · Connect the MCP server

Add this to your MCP client config, such as Claude Desktop’s claude_desktop_config.json. Replace the path with the absolute path to your ytapis-tools folder.

MCP client config
{
  "mcpServers": {
    "ytapis": {
      "command": "node",
      "args": ["/absolute/path/to/ytapis-tools/node_modules/ytapis-mcp/dist/index.js"]
    }
  }
}

Verified: the server starts with no import errors. We did not test it inside a live Claude Desktop session, so check the tool list after restarting the client.

Dart · Flutter

ytapis on pub.dev

The package is published. The sample below comes from the README and was not run in our sandbox, so test it in your own project first.

$dart pub add ytapis
main.dart
import 'package:ytapis/ytapis.dart';

Future<void> main() async {
  final results = await search('flutter tutorial', limit: 5);
  final video = await getVideo('dQw4w9WgXcQ');
  print(video.title);
}

Go

The repository has a go/ folder with the client. We did not run the module in our sandbox, so use the README’s example as a starting point.

$go get github.com/pgboyahpgr-commits/ytapis/go
main.go
import ytapi "github.com/pgboyahpgr-commits/ytapis/go"

results, _ := ytapi.Search("cats", "", "", 5)
for _, v := range results {
    fmt.Println(v.Title)
}
Plain HTTP

No SDK? No problem.

Every library wraps the HTTP endpoints. If your language has an HTTP client, you can use ytapis directly.

Python with requests

requests
import requests

res = requests.get(
    "https://ytapis.djalokyt27.workers.dev/",
    params={"q": "coding", "limit": 5},
    timeout=20,
)
res.raise_for_status()
for video in res.json():
    print(video["title"])

Any language, with curl

curl
curl -s 'https://ytapis.djalokyt27.workers.dev/?q=coding&limit=5' | head -c 400

Tip: always URL-encode query text. Use encodeURIComponent in JavaScript or the params argument in Python.