#youtube #api #wrapper #invidious


Get information about videos from YouTube with this simple Invidious API wrapper. Does not use the YouTube API (No tokens required)

7 unstable releases (3 breaking)

0.4.1 Dec 9, 2022
0.4.0 Oct 22, 2022
0.3.2 Sep 1, 2022
0.3.1 Jul 30, 2022
0.1.0 Apr 23, 2022

#58 in Video

Download history 104/week @ 2022-12-06 41/week @ 2022-12-13 45/week @ 2022-12-20 35/week @ 2022-12-27 23/week @ 2023-01-03 23/week @ 2023-01-10 23/week @ 2023-01-17 46/week @ 2023-01-24 37/week @ 2023-01-31 50/week @ 2023-02-07 59/week @ 2023-02-14 52/week @ 2023-02-21 68/week @ 2023-02-28 54/week @ 2023-03-07 49/week @ 2023-03-14 29/week @ 2023-03-21

214 downloads per month
Used in youtube-tui

GPL-3.0 license

2.5K SLoC



Rust bindings for the invidious API. Get information about videos, channels, and playlists from YouTube without using the YouTube official API.


Blocking API

use invidious::reqwest::blocking::Client;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
   let client = Client::new(String::from("https://vid.puffyan.us"));
   let search_results = client.search(Some("q=rust programming"))?.items;
   let video = client.video("5C_HPTJg5ek", None)?;


Async API

use invidious::reqwest::asynchronous::Client;
use std::error::Error;

async fn main() {
  let client = Client::new(String::from("https://vid.puffyan.us"));
  let channel_videos = client.channel_videos("UCAkuTH35kk3W1EL9vq6dj6A", Some("sort_by=popular&page=2"))

  let playlist = client.playlist("PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI", None)
    .unwrap(); // Returns Playlist

General Usage

client.function_name(id: &str, args: Option<&str>) -> Result<T, Box<dyn Error>>

  • id is the id of the video, channel, or playlist, and is only used when applicable.
  • args is an optional string of additional arguments to be passed to the API. For example, sort_by=popular&page=2 (Arguments are separated by &)

How this works

Uses the Invidious api to get information about videos, channels, and playlists. The Invidious API is a REST API, so the invidious crate uses the reqwest crate to make requests to the Invidious API, and then uses the serde_json crate to parse the JSON returned by the Invidious API.

Official documentation of the Invidious API can be found here: https://docs.invidious.io/api


  • reqwest: use the reqwest crate to send requests, may increase complie time and size
  • curl: use the curl command to send reqwests, but curl may not be present in some systems
  • curl_async: async support for curl, uses external crate which increases compile time and size

All features are enabled by default


GNU General Public License v3.0

License: GPL-3.0


~276K SLoC