Skip to content

samzong/yt-search-api

Repository files navigation

yt-search-api

yt-search-api logo

A high-performance API service for yt-dlp proxying online search services. (such as YouTube)

Release Version MIT License Node Version Ask DeepWiki

Introduction

yt-search-api is a lightweight video search proxy API service designed for applications that need to integrate multi-platform video search functionality. Currently supports YouTube search, with plans to expand to more platforms in the future.

Deploy with Vercel

Core Features

  • 🚀 High Performance: Supports high concurrency with multiple users
  • 🔒 Security: Simple token authentication mechanism
  • 🔄 Cache Optimization: Built-in smart caching strategy to reduce repeated requests
  • 🔌 Extensibility: Modular design, easy to extend support for more video platforms

Tech Stack

  • Node.js (>=18) + TypeScript
  • Fastify framework
  • Memory cache (lru-cache)
  • Jest testing framework

API Documentation

Search Endpoint

Request:

GET /search?platform=youtube&q=keyword

Parameters:

  • platform (required): Search platform, currently supports youtube
  • q (required): Search keyword

Authentication:

Add the following field to the request header:

Authorization: Bearer your_token

Response Example:

{
  "items": [
    {
      "videoId": "dQw4w9WgXcQ",
      "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "title": "Video Title",
      "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg",
      "platform": "youtube"
    }
  ],
  "nextPageToken": "CAUQAA",
  "totalResults": 1000
}

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A high-performance API service for yt-dlp proxying online search services.(such as YouTube)

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors