SDK

Core Node.js SDK for btch-downloader.

Methods

(async, static) aio(url) → {Promise.<AioResponse>}

All-In-One (AIO) downloader for various social platforms.

Parameters:
NameTypeDescription
urlstring

The media URL to download.

Deprecated
  • All-In-One support is no longer actively maintained.
Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing media info.

Type: 
Promise.<AioResponse>
Examples

ESM

import { aio } from 'btch-downloader';

const url = 'https://vt.tiktok.com/ZSkGPK9Kj/';
aio(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { aio } = require('btch-downloader');

const url = 'https://vt.tiktok.com/ZSkGPK9Kj/';
aio(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) capcut(url) → {Promise.<CapCutResponse>}

CapCut template downloader

Parameters:
NameTypeDescription
urlstring

The CapCut template URL (e.g., https://www.capcut.com/template-detail/7299286607478181121)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing template video links and metadata.

Type: 
Promise.<CapCutResponse>
Examples

ESM

import { capcut } from 'btch-downloader';

const url = 'https://www.capcut.com/template-detail/7299286607478181121';
capcut(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { capcut } = require('btch-downloader');

const url = 'https://www.capcut.com/template-detail/7299286607478181121';
capcut(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) cocofun(url) → {Promise.<CocofunResponse>}

Cocofun content downloader

Parameters:
NameTypeDescription
urlstring

The Cocofun post URL (e.g., https://www.icocofun.com/share/post/379250110809)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing media links and post metadata.

Type: 
Promise.<CocofunResponse>
Examples

ESM

import { cocofun } from 'btch-downloader';

const url = 'https://www.icocofun.com/share/post/379250110809';
cocofun(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { cocofun } = require('btch-downloader');

const url = 'https://www.icocofun.com/share/post/379250110809';
cocofun(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) douyin(url) → {Promise.<DouyinResponse>}

Douyin (抖音) downloader for videos and images

Parameters:
NameTypeDescription
urlstring

The Douyin post URL (e.g., https://v.douyin.com/ikq8axJ/)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing media links and post metadata.

Type: 
Promise.<DouyinResponse>
Examples

ESM

import { douyin } from 'btch-downloader';

const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { douyin } = require('btch-downloader');

const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) fbdown(url) → {Promise.<FacebookResponse>}

Facebook video downloader

Parameters:
NameTypeDescription
urlstring

The Facebook video URL (e.g., https://www.facebook.com/watch/?v=1393572814172251)

Throws:

If the URL is invalid or the media is not accessible.

Type
Error
Returns:

A JSON object containing Normal and HD quality download links.

Type: 
Promise.<FacebookResponse>
Examples

ESM

import { fbdown } from 'btch-downloader';

const url = 'https://www.facebook.com/watch/?v=1393572814172251';
fbdown(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { fbdown } = require('btch-downloader');

const url = 'https://www.facebook.com/watch/?v=1393572814172251';
fbdown(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) gdrive(url) → {Promise.<GoogleDriveResponse>}

Google Drive file downloader

Parameters:
NameTypeDescription
urlstring

The Google Drive file URL (e.g., https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view)

Throws:

If the URL is invalid or the file is not public.

Type
Error
Returns:

A JSON object containing file metadata and download link.

Type: 
Promise.<GoogleDriveResponse>
Examples

ESM

import { gdrive } from 'btch-downloader';

const url = 'https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view';
gdrive(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { gdrive } = require('btch-downloader');

const url = 'https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view';
gdrive(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) igdl(url) → {Promise.<InstagramResponse>}

Instagram content downloader (Reels, Posts, TV, Stories)

Parameters:
NameTypeDescription
urlstring

The Instagram media URL (e.g., https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==)

Throws:

If the URL is invalid or the media is not accessible.

Type
Error
Returns:

A JSON object containing an array of media items (links and thumbnails).

Type: 
Promise.<InstagramResponse>
Examples

ESM

import { igdl } from 'btch-downloader';

const url = 'https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==';
igdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { igdl } = require('btch-downloader');

const url = 'https://www.instagram.com/reel/DKPtUL_S9Nh/?igsh=MTE1dTVkb2E4NTFmcw==';
igdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) kuaishou(url) → {Promise.<KuaishouResponse>}

Kuaishou (快手) video downloader

Parameters:
NameTypeDescription
urlstring

The Kuaishou video URL (e.g., https://v.kuaishou.com/JT195ZHT)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing video metadata and download link.

Type: 
Promise.<KuaishouResponse>
Examples

ESM

import { kuaishou } from 'btch-downloader';

const url = 'https://v.kuaishou.com/JT195ZHT';
kuaishou(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { kuaishou } = require('btch-downloader');

const url = 'https://v.kuaishou.com/JT195ZHT';
kuaishou(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) mediafire(url) → {Promise.<MediaFireResponse>}

MediaFire file downloader

Parameters:
NameTypeDescription
urlstring

The MediaFire file URL (e.g., https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file)

Deprecated
  • MediaFire support is no longer actively maintained.
Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing file metadata and download link.

Type: 
Promise.<MediaFireResponse>
Examples

ESM

import { mediafire } from 'btch-downloader';

const url = 'https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file';
mediafire(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { mediafire } = require('btch-downloader');

const url = 'https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file';
mediafire(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) pinterest(query) → {Promise.<PinterestResponse>}

Pinterest content downloader or search

Parameters:
NameTypeDescription
querystring

The Pinterest pin URL or a search query.

Throws:

If the input is invalid or the request fails.

Type
Error
Returns:

A JSON object containing pin media or search results.

Type: 
Promise.<PinterestResponse>
Examples

ESM (URL)

import { pinterest } from 'btch-downloader';

const url = 'https://pin.it/4CVodSq';
pinterest(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

ESM (Search)

import { pinterest } from 'btch-downloader';

const query = 'Zhao Lusi';
pinterest(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS (URL)

const { pinterest } = require('btch-downloader');

const url = 'https://pin.it/4CVodSq';
pinterest(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS (Search)

const { pinterest } = require('btch-downloader');

const query = 'Zhao Lusi';
pinterest(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) snackvideo(url) → {Promise.<SnackVideoResponse>}

SnackVideo content downloader

Parameters:
NameTypeDescription
urlstring

The SnackVideo post URL (e.g., https://s.snackvideo.com/p/j9jKr9dR)

Throws:

If the URL is invalid or the content is not accessible.

Type
Error
Returns:

A JSON object containing video links and metadata.

Type: 
Promise.<SnackVideoResponse>
Examples

ESM

import { snackvideo } from 'btch-downloader';

const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { snackvideo } = require('btch-downloader');

const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) soundcloud(url) → {Promise.<SoundCloudResponse>}

SoundCloud track downloader

Parameters:
NameTypeDescription
urlstring

The SoundCloud track URL (e.g., https://soundcloud.com/issabella-marchelina/sisa-rasa-mahalini-official-audio)

Throws:

If the URL is invalid or the media is not accessible.

Type
Error
Returns:

A JSON object containing track info and download links.

Type: 
Promise.<SoundCloudResponse>
Examples

ESM

import { soundcloud } from 'btch-downloader';

const url = 'https://soundcloud.com/issabella-marchelina/sisa-rasa-mahalini-official-audio';
soundcloud(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { soundcloud } = require('btch-downloader');

const url = 'https://soundcloud.com/issabella-marchelina/sisa-rasa-mahalini-official-audio';
soundcloud(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) spotify(url) → {Promise.<SpotifyResponse>}

Spotify track downloader

Parameters:
NameTypeDescription
urlstring

The Spotify track URL (e.g., https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing track metadata and download links.

Type: 
Promise.<SpotifyResponse>
Examples

ESM

import { spotify } from 'btch-downloader';

const url = 'https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt';
spotify(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { spotify } = require('btch-downloader');

const url = 'https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt';
spotify(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) threads(url) → {Promise.<ThreadsResponse>}

Threads (by Instagram) content downloader

Parameters:
NameTypeDescription
urlstring

The Threads post URL (e.g., https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI/)

Throws:

If the URL is invalid or the content is not accessible.

Type
Error
Returns:

A JSON object containing media links and post metadata.

Type: 
Promise.<ThreadsResponse>
Examples

ESM

import { threads } from 'btch-downloader';

const url = 'https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI/';
threads(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { threads } = require('btch-downloader');

const url = 'https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI/';
threads(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) ttdl(url) → {Promise.<TikTokResponse>}

TikTok video downloader

Parameters:
NameTypeDescription
urlstring

The TikTok video URL (e.g., https://www.tiktok.com/@omagadsus/video/7025456384175017243)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing video info, thumbnails, and download links.

Type: 
Promise.<TikTokResponse>
Examples

ESM

import { ttdl } from 'btch-downloader';

const url = 'https://www.tiktok.com/@omagadsus/video/7025456384175017243';
ttdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { ttdl } = require('btch-downloader');

const url = 'https://www.tiktok.com/@omagadsus/video/7025456384175017243';
ttdl(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) twitter(url) → {Promise.<TwitterResponse>}

Twitter (X) video downloader

Parameters:
NameTypeDescription
urlstring

The Twitter/X video URL (e.g., https://twitter.com/gofoodindonesia/status/1229369819511709697)

Throws:

If the URL is invalid or the media is not accessible.

Type
Error
Returns:

A JSON object containing the video title and download link.

Type: 
Promise.<TwitterResponse>
Examples

ESM

import { twitter } from 'btch-downloader';

const url = 'https://twitter.com/gofoodindonesia/status/1229369819511709697';
twitter(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { twitter } = require('btch-downloader');

const url = 'https://twitter.com/gofoodindonesia/status/1229369819511709697';
twitter(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) xiaohongshu(url) → {Promise.<XiaohongshuResponse>}

Xiaohongshu (Little Red Book / 小红书) downloader

Parameters:
NameTypeDescription
urlstring

The Xiaohongshu post URL (e.g., http://xhslink.com/o/21DKXV988zp)

Throws:

If the URL is invalid or the content is not accessible.

Type
Error
Returns:

A JSON object containing image/video links and post metadata.

Type: 
Promise.<XiaohongshuResponse>
Examples

ESM

import { xiaohongshu } from 'btch-downloader';

const url = 'http://xhslink.com/o/21DKXV988zp';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { xiaohongshu } = require('btch-downloader');

const url = 'http://xhslink.com/o/21DKXV988zp';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) youtube(url) → {Promise.<YouTubeResponse>}

YouTube video and audio downloader

Parameters:
NameTypeDescription
urlstring

The YouTube video URL (e.g., https://youtu.be/C8mJ8943X80)

Throws:

If the URL is invalid or the request fails.

Type
Error
Returns:

A JSON object containing video/audio download links, title, and thumbnail.

Type: 
Promise.<YouTubeResponse>
Examples

ESM

import { youtube } from 'btch-downloader';

const url = 'https://youtube.com/watch?v=C8mJ8943X80';
youtube(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { youtube } = require('btch-downloader');

const url = 'https://youtube.com/watch?v=C8mJ8943X80';
youtube(url).then(data => console.log(data)).catch(err => console.error(err)); // JSON

(async, static) yts(query) → {Promise.<YtsResponse>}

YouTube search engine

Parameters:
NameTypeDescription
querystring

The search query for YouTube videos (e.g., Somewhere Only We Know)

Throws:

If the request fails.

Type
Error
Returns:

A JSON object containing a list of search results.

Type: 
Promise.<YtsResponse>
Examples

ESM

import { yts } from 'btch-downloader';

const query = 'Somewhere Only We Know';
yts(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON

CJS

const { yts } = require('btch-downloader');

const query = 'Somewhere Only We Know';
yts(query).then(data => console.log(data)).catch(err => console.error(err)); // JSON