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

er-api-sdk

v1.0.7

Published

A Lightweight Typescript/Javascript SDK for AI, media, games, and utilities

Readme

ER-API SDK

NPM Version TypeScript Documentation

A lightweight TypeScript/JavaScript SDK for accessing AI models, media downloads, image generation, games, and utilities through the ER-API platform.

Installation

npm install er-api-sdk   # npm
yarn add er-api-sdk      # yarn
pnpm add er-api-sdk      # pnpm

Key Features

  • AI Models: Easy access to various AI models (Gemini 2.0, Claude, Mistral, etc.)
  • Media Downloads: Download videos/audio from TikTok, Spotify, YouTube, etc.
  • Image Generation: Create images from text prompts
  • Games & Entertainment: Access word games and other interactive content
  • Utilities: Various helper functions and tools

Usage Examples

Basic Usage (No API Key Required)

Many endpoints work without an API key:

// CommonJS
const { ttdl, text2img, tebakkata } = require('er-api-sdk');

// ESM
// import { ttdl, text2img, tebakkata } from 'er-api-sdk';

// Download TikTok video
const tiktokData = await ttdl('https://www.tiktok.com/@user/video/12345');

// Generate an image from text
const imageBuffer = await text2img('beautiful mountain landscape');

// Play a word game
const game = await tebakkata();

Using AI Models (API Key Optional)

Basic AI requests work without an API key, but custom parameters require one:

// CommonJS
const { deepseek, llama3, deepcoder } = require('er-api-sdk');

// ESM
// import { deepseek, llama3, deepcoder } from 'er-api-sdk';

// Basic AI requests (no API key needed)
const response = await deepseek('Explain quantum computing');
const code = await deepcoder('Write a function to sort an array in JavaScript');

// For custom parameters, you need an API key:
const { ErApiSdk } = require('er-api-sdk');
ErApiSdk.openRouter.setApiKey('YOUR_API_KEY');

const customResponse = await llama3('Tell me about space exploration', {
  temperature: 0.7,
  max_tokens: 500
});

With Environment Variables

The recommended way to use API keys is through environment variables:

// Set in .env file:
// OPENROUTER_API_KEY=your_api_key_here

// In your code:
const { ErApiSdk } = require('er-api-sdk');
const sdk = ErApiSdk.fromEnv();

// Now you can use advanced features
const response = await sdk.llama3('Explain quantum computing', {
  temperature: 0.8,
  max_tokens: 1000
});

Media Downloads

const { ermp3, ermp4, spotify } = require('er-api-sdk');

// Download YouTube audio
const audioData = await ermp3('https://www.youtube.com/watch?v=dQw4w9WgXcQ');

// Download YouTube video
const videoData = await ermp4('https://www.youtube.com/watch?v=dQw4w9WgXcQ');

// Download from Spotify
const spotifyData = await spotify('https://open.spotify.com/track/...');

Image Generation

const { brat, text2img } = require('er-api-sdk');

// Generate an image with Brat AI
const bratImage = await brat('hello world');

// Create a text-to-image
const textImage = await text2img('mountain landscape');

Games & Entertainment

const { family100, truth, dare, tebakkata } = require('er-api-sdk');

// Family 100 game
const familyGame = await family100();

// Truth or Dare
const truthQuestion = await truth();
const dareChallenge = await dare();

// Word guessing game
const wordGame = await tebakkata();

API Key

To use AI models with custom parameters, you need an API key from ER-API Platform.

Setting your API key:

  1. Environment variable (recommended):

    OPENROUTER_API_KEY=your_api_key_here
  2. Direct in code:

    const { ErApiSdk } = require('er-api-sdk');
    ErApiSdk.openRouter.setApiKey('YOUR_API_KEY');

Documentation

For detailed API documentation, visit our Documentation.