npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

supadata-api-wrapper

v1.0.3

Published

Node.js wrapper for Supadata API v1

Readme

Supadata API Wrapper

A Node.js wrapper for the Supadata API v1, designed for fetching web content and generating YouTube video transcripts.

supdata.ai is a Web & YouTube to text API for makers

Features

  • Simple API client for all Supadata endpoints
  • Promise-based interface with proper error handling
  • TypeScript-friendly JSDoc comments
  • Examples for common use cases

Installation

# Clone the repository
git clone https://github.com/servatj/supadata-api-client.git

# Navigate to the directory
cd supadata-api-client

# Install dependencies
npm install

# Copy and edit the environment variables
cp .env.example .env
# Edit the .env file with your API key

Or if you're using it as a package:

npm install supadata-api-client

Configuration

Create a .env file in the root directory with your Supadata API key:

SUPADATA_API_KEY=your_api_key_here

Basic Usage

const SupadataClient = require('supadata-api-wrapper');

// Initialize the client with your API key
const client = new SupadataClient('your_api_key_here');

// Or load from environment variables
// const client = new SupadataClient(process.env.SUPADATA_API_KEY);

// Example: Get a YouTube video transcript
async function getTranscript() {
  try {
    const transcript = await client.getTranscript('dQw4w9WgXcQ');
    console.log(transcript);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

getTranscript();

API Reference

Initialization

const client = new SupadataClient(apiKey, options);

Parameters:

  • apiKey (string, required): Your Supadata API key
  • options (object, optional):
    • baseUrl (string, optional): Custom API base URL (default: 'https://api.supadata.ai')

Methods

YouTube Transcript

// Get transcript for a YouTube video
const transcript = await client.getTranscript('videoId');

// Translate a YouTube video transcript
const translatedTranscript = await client.translateTranscript('videoId', 'targetLanguage');

Web Content

// Get content from a URL
const content = await client.getUrlContent('https://example.com', options);

// Map a website structure
const siteMap = await client.mapWebsite('https://example.com', options);

// Start a website crawl
const crawlJob = await client.crawlWebsite('https://example.com', options);

// Get crawl results
const crawlResults = await client.getCrawlResult('jobId');

YouTube Data

// Get YouTube video data
const video = await client.getVideo('videoId');

// Get YouTube channel data
const channel = await client.getChannel('channelId');

// Get YouTube playlist data
const playlist = await client.getPlaylist('playlistId');

// Get videos from a channel
const channelVideos = await client.getChannelVideos('channelId', options);

// Get videos from a playlist
const playlistVideos = await client.getPlaylistVideos('playlistId', options);

API Status

// Check if your API key is valid
const status = await client.checkApiKey();

Error Handling

The client includes enhanced error handling that provides meaningful error messages:

try {
  const transcript = await client.getTranscript('invalid_video_id');
} catch (error) {
  console.error(error.message); // Formatted error message
  console.error(error.status);  // HTTP status code if available
  console.error(error.data);    // Error response data if available
}

Examples

Check the examples directory for more usage examples:

# Run the basic usage example
node examples/basic-usage.js transcript dQw4w9Wg

Testing

This package includes comprehensive unit tests using Jest. To run the tests:

npm test

This will run all tests and generate a coverage report in the coverage directory. </rewritten_file>