NB Scraper Docs - v1.3.0
    Preparing search index...

    Function getYoutubePost

    • Scrapes a YouTube community post to extract its content. Supports text, single/multiple images, polls, and video shares.

      Parameters

      • url: string

        The URL of the YouTube community post.

      Returns Promise<NBScraperResponse<YouTubePostData>>

      A promise that resolves to the scraped post data.

      import { getYoutubePost } from 'nb-scraper';

      async function fetchPost() {
      const url = "http://youtube.com/post/UgkxChSWx6pfUUCxxHeR3LsodyV6Aqwf4GOS?si=tSbmlFuR2dYH_wtk";
      const result = await getYoutubePost(url);

      if (result.status) {
      console.log(`Post by ${result.data.author}`);
      console.log(`Content: ${result.data.text}`);
      console.log(`Post Type: ${result.data.postType}`);
      } else {
      console.error(result.error);
      }
      }

      fetchPost();

      wolep