Universal social media downloader API
npm install allmediadl


A universal All social media downloader package for Node.js.
Download media from 19+ platforms including LinkedIn, Threads, Reddit, Facebook, Instagram, TikTok, YouTube, Pinterest, Twitter, and more β with auto-detection and easy-to-use API.
---

---
- Auto-Detection: Automatically detects platform from URL
- 19+ Platforms Supported:
- Bluesky
- CapCut
- Dailymotion
- Douyin
- Facebook & Instagram
- Kuaishou
- LinkedIn
- Pinterest
- Reddit
- Snapchat
- Soundcloud
- Spotify
- Threads
- TikTok
- Tumblr
- Twitter (X)
- YouTube
- Smart Redirect Handling: Handles YouTube and other platform redirects seamlessly
- Easy Integration: Simple function-based API
- TypeScript Ready: Works seamlessly with TypeScript projects
---
``bash`
npm install allmediadl
Or with yarn:
`bash`
yarn add allmediadl
Or with pnpm:
`bash`
pnpm add allmediadl
---
The easiest way to use socialmediadl is with the auto-detection feature:
`javascript
const allmediadl = require('allmediadl');
async function downloadMedia() {
try {
// Auto-detect platform and download
const url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
const result = await allmediadl.download(url);
console.log('Platform:', result.platform); // 'youtube'
console.log('Data:', result.data); // Media download info
} catch (error) {
console.error('Error:', error.message);
}
}
downloadMedia();
`
Response Format:
`javascript`
{
platform: 'youtube', // Detected platform name
data: {
// Platform-specific media download information
// (varies by platform)
}
}
For more control, use platform-specific functions:
`javascript
const {
fetchYoutubeData,
fetchTiktokData,
fetchMetaData,
fetchTwitterData
} = require('allmediadl');
async function examples() {
// YouTube
const youtubeData = await fetchYoutubeData('https://youtube.com/watch?v=...');
// TikTok
const tiktokData = await fetchTiktokData('https://tiktok.com/@user/video/...');
// Facebook/Instagram
const metaData = await fetchMetaData('https://instagram.com/p/...');
// Twitter/X
const twitterData = await fetchTwitterData('https://twitter.com/user/status/...');
}
`
Always wrap your calls in try-catch blocks:
`javascript
const allmediadl = require('allmediadl');
async function safeDownload(url) {
try {
const result = await allmediadl.download(url);
return result;
} catch (error) {
if (error.message.includes('not supported')) {
console.error('Platform not supported:', url);
} else {
console.error('Download error:', error.message);
}
return null;
}
}
`
---
#### allmediadl.download(url)
Auto-detects platform and downloads media.
Parameters:
- url (string): The social media URL
Returns:
`javascript`
Promise<{
platform: string, // Detected platform name
data: object // Media download information
}>
Throws:
- Error if URL is missing
- Error if platform is not supported
---
All platform functions return a Promise with platform-specific data:
| Function | Platform | Example URL |
|----------|----------|-------------|
| fetchBlueskyData(url) | Bluesky | https://bsky.app/... |fetchCapcutData(url)
| | CapCut | https://capcut.com/... |fetchDailymotionData(url)
| | Dailymotion | https://dailymotion.com/... |fetchDouyinData(url)
| | Douyin | https://douyin.com/... |fetchMetaData(url)
| | Facebook/Instagram | https://instagram.com/p/... |fetchKuaishouData(url)
| | Kuaishou | https://kuaishou.com/... |fetchLinkedinData(url)
| | LinkedIn | https://linkedin.com/... |fetchPinterestMedia(url)
| | Pinterest | https://pinterest.com/pin/... |fetchRedditData(url)
| | Reddit | https://reddit.com/r/... |fetchSnapchatData(url)
| | Snapchat | https://snapchat.com/... |fetchSoundcloudData(url)
| | Soundcloud | https://soundcloud.com/... |fetchSpotify(url)
| | Spotify | https://spotify.com/track/... |fetchThreadsData(url)
| | Threads | https://threads.net/... |fetchTiktokData(url)
| | TikTok | https://tiktok.com/@user/video/... |fetchTumblrData(url)
| | Tumblr | https://tumblr.com/... |fetchTwitterData(url)
| | Twitter/X | https://twitter.com/user/status/... |fetchYoutubeData(url)
| | YouTube | https://youtube.com/watch?v=... |
Example:
`javascript
const { fetchYoutubeData } = require('allmediadl');
const data = await fetchYoutubeData('https://youtube.com/watch?v=...');
console.log(data);
`
---
`javascript
const allmediadl = require('allmediadl');
// Main function
allmediadl.download(url)
// All platform-specific functions
const {
fetchBlueskyData,
fetchCapcutData,
fetchDailymotionData,
fetchDouyinData,
fetchMetaData,
fetchKuaishouData,
fetchLinkedinData,
fetchPinterestMedia,
fetchRedditData,
fetchSnapchatData,
fetchSoundcloudData,
fetchSpotify,
fetchThreadsData,
fetchTiktokData,
fetchTumblrData,
fetchTwitterData,
fetchYoutubeData
} = allmediadl;
`
---
- Smart URL Detection: Automatically identifies platform from URL patterns
- Enhanced Axios Configuration: Handles redirects from YouTube and other platforms
- Modular Architecture: Each platform has its own service module
- Error Handling: Comprehensive error handling with meaningful messages
- No Server Required: Pure module package, no HTTP server needed
---
``
.
βββ config/ # Configuration files (axios setup)
βββ services/ # Platform-specific downloader functions
βββ index.js # Main module exports
βββ test.js # Example test file
βββ package.json # Package metadata
βββ README.md # Documentation
---
Run the included test file to see examples:
`bash`
node test.js
Or create your own test:
`javascript
const allmediadl = require('allmediadl');
async function myTest() {
const result = allmediadl.download('YOUR_URL_HERE');
console.log(result);
}
myTest();
``
---
Contributions are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests for improvements
- Add support for new platforms
---
Rakib Adil
GitHub: @bruxa6t9
Repository: AllMediadl
---
ST || Sheikh Tamim
---
This project is open source and available for use.
---
If you find this package useful, please consider giving it a β on GitHub!
