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

aparat-api

v1.0.0

Published

A Node.js library for interacting with the Aparat video platform API.

Downloads

6

Readme

Aparat Video Platform NodeJs Api

This is a Node.js library for interacting with the Aparat video platform API. You can use it to manage user profiles, search videos, upload videos, fetch video details, and more.

Features 🚀

  • ⭐ Login to the Aparat platform
  • ⭐ Fetch user profiles and categories
  • ⭐ Search for users and videos
  • ⭐ Upload videos
  • ⭐ Fetch video details
  • ⭐ Fetch comments and tags associated with videos

Installation 🔧

Install the package using npm:

npm install aparat-api

Usage 📚

Import and Initialization

Start by importing the Aparat class from the library and creating an instance of it:

const Aparat = require('aparat-api');
const aparat = new Aparat();

Login to Aparat 🔐

You must log in before accessing most of the platform’s features. Here’s how you can log in:

(async () => {
  try {
    const profile = await aparat.login('your_username', 'your_password');
    if (profile) {
      console.log(`Logged in as ${profile.username}`);
    } else {
      console.log('Login failed.');
    }
  } catch (error) {
    console.error('An error occurred during login:', error);
  }
})();

Fetch User Profile 👤

You can retrieve a user's profile using their username:

(async () => {
  try {
    const userProfile = await aparat.profile('some_username');
    if (userProfile) {
      console.log(`Profile of ${userProfile.username}:`, userProfile);
    } else {
      console.log('User not found.');
    }
  } catch (error) {
    console.error('An error occurred while fetching the profile:', error);
  }
})();

Search Users 🔍

You can search for users by a keyword:

(async () => {
  try {
    const users = await aparat.userBySearch('search_term', 5);
    if (users.length > 0) {
      console.log('Users found:', users);
    } else {
      console.log('No users found.');
    }
  } catch (error) {
    console.error('An error occurred while searching for users:', error);
  }
})();

Fetch Video Details 📹

Retrieve video details using a video hash:

(async () => {
  try {
    const video = await aparat.video('video_hash_here');
    if (video) {
      console.log('Video details:', video);
    } else {
      console.log('Video not found.');
    }
  } catch (error) {
    console.error('An error occurred while fetching the video details:', error);
  }
})();

Upload a Video 📤

To upload a video, first fetch the upload form, and then send the video file with the form:

(async () => {
  try {
    // Login first
    const profile = await aparat.login('your_username', 'your_password');
    
    if (!profile) {
      console.log('Login failed. Please check your credentials.');
      return;
    }
    
    // Fetch the upload form
    const uploadForm = await aparat.uploadForm(profile.username, profile.ltokem);
    if (!uploadForm) {
      console.log('Failed to retrieve the upload form.');
      return;
    }

    // Upload the video
    const uploadedVideo = await aparat.uploadPost(
      'path/to/your/video.mp4',  // Path to video file
      'My Awesome Video',         // Video title
      1,                          // Category ID
      uploadForm,                 // Upload form object
      {
        tags: ['example', 'tags'],  // Optional tags
        allow_comment: true,        // Allow comments
        description: 'This is a test video.',  // Video description
        video_pass: false           // Optional: Password protection
      }
    );

    console.log('Video uploaded successfully:', uploadedVideo);
  } catch (error) {
    console.error('An error occurred while uploading the video:', error);
  }
})();

Fetch Videos by User 📽️

You can fetch the list of videos uploaded by a specific user:

(async () => {
  try {
    const videos = await aparat.videoByUser('some_username', 10);
    if (videos.length > 0) {
      console.log('Videos by user:', videos);
    } else {
      console.log('No videos found.');
    }
  } catch (error) {
    console.error('An error occurred while fetching videos by user:', error);
  }
})();

Contributing

Contributions are welcome! Here's how you can contribute to this project:

Fork the repository. Create a new branch (git checkout -b feature-branch). Make your changes. Commit your changes (git commit -am 'Add new feature'). Push to the branch (git push origin feature-branch). Submit a pull request. Please ensure your pull request adheres to the following guidelines:

Describe clearly what problem you're solving with this PR. Keep the PR focused on a single feature or bug fix.

Repository Stats 📊

  • npm version
  • License NPM Downloads stars last commit

License 📜

This library is provided under the MIT License.