@heavstaltech/api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HEAVSTAL TECHβ„’
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # @heavstaltech/api
2
+
3
+ ![NPM Version](https://img.shields.io/npm/v/@heavstaltech/api?style=flat-square)
4
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/HeavstalTech/heavstaltech-api/test.yml?style=flat-square&label=tests)
5
+ ![License](https://img.shields.io/npm/l/@heavstaltech/api?style=flat-square)
6
+
7
+ A powerful, all-in-one scraping and utility library built by **HEAVSTAL TECH**.
8
+ This module provides easy access to media downloaders (TikTok, YouTube, Instagram, Facebook), search engines, and AI tools.
9
+
10
+ It is designed to work seamlessly in both **CommonJS (`require`)** and **ES Modules (`import`)** environments.
11
+
12
+ ---
13
+
14
+ ## 🌐 Heavstal Tech Ecosystem
15
+
16
+ This package is part of the **Heavstal Tech** ecosystem.
17
+
18
+ **Explore More APIs:**
19
+ Visit our official API Hub to discover more tools, endpoints, and detailed documentation:
20
+ πŸ‘‰ **[https://heavstal-tech.vercel.app/apis](https://heavstal-tech.vercel.app/apis)**
21
+
22
+ ---
23
+
24
+ ## πŸ“¦ Installation
25
+
26
+ Install via npm:
27
+
28
+ ```bash
29
+ npm install @heavstaltech/api
30
+ ```
31
+
32
+ ---
33
+
34
+ ## πŸš€ Usage (ESM vs CJS)
35
+
36
+ This library is a **hybrid module**. You can use it in legacy Node.js projects or modern TypeScript/ESM projects without any configuration.
37
+
38
+ ### CommonJS (`require`)
39
+ ```javascript
40
+ const { downloader, search, tools } = require('@heavstaltech/api');
41
+
42
+ // or require specific functions
43
+ const { tiktok } = require('@heavstaltech/api');
44
+ ```
45
+
46
+ ### ES Modules / TypeScript (`import`)
47
+ ```typescript
48
+ import { downloader, search, tools } from '@heavstaltech/api';
49
+
50
+ // or import specific functions
51
+ import { tiktok, remini } from '@heavstaltech/api';
52
+ ```
53
+
54
+ ---
55
+
56
+ ## πŸ“š API Documentation
57
+
58
+ ### 1. Social Media Downloaders
59
+
60
+ #### TikTok (Video & Slides)
61
+ Supports downloading videos without watermarks, searching for videos, and fetching slide images.
62
+
63
+ ```javascript
64
+ // 1. Search or Download via URL
65
+ const result = await downloader.tiktok("https://vt.tiktok.com/ZS...");
66
+ // OR search: await downloader.tiktok("funny cat videos");
67
+
68
+ console.log(result);
69
+ /* Output:
70
+ {
71
+ author: { name: 'HEAVSTAL TECH', ... },
72
+ status: true,
73
+ title: 'Video Title',
74
+ no_watermark: 'https://...',
75
+ audio: 'https://...'
76
+ }
77
+ */
78
+
79
+ // 2. TikTok Slides
80
+ const slide = await downloader.tiktokSlide("https://vt.tiktok.com/ZS...");
81
+ console.log(slide);
82
+ ```
83
+
84
+ #### Instagram (Reels, Images, Videos)
85
+ Downloads content from Instagram public posts.
86
+
87
+ ```javascript
88
+ const ig = await downloader.igdl("https://www.instagram.com/p/Cp...");
89
+
90
+ ig.forEach(media => {
91
+ console.log(`Type: ${media.type} | URL: ${media.url}`);
92
+ });
93
+ ```
94
+
95
+ #### Facebook (Watch & Public Videos)
96
+ Downloads public Facebook videos in SD or HD.
97
+
98
+ ```javascript
99
+ const fb = await downloader.fbdl("https://fb.watch/...");
100
+ console.log(fb);
101
+ ```
102
+
103
+ ---
104
+
105
+ ### 2. YouTube (Search & Download)
106
+
107
+ **Note:** Powered by `@distube/ytdl-core` and `yt-search`.
108
+
109
+ #### Search
110
+ ```javascript
111
+ const results = await search.youtube("No Copyright Sounds");
112
+ console.log(results[0]); // Returns video details
113
+ ```
114
+
115
+ #### Download Audio (MP3)
116
+ ```javascript
117
+ const audio = await downloader.ytmp3("https://youtu.be/...");
118
+ console.log(audio.url); // Direct download link
119
+ ```
120
+
121
+ #### Download Video (MP4)
122
+ ```javascript
123
+ const video = await downloader.ytmp4("https://youtu.be/...");
124
+ console.log(video.url); // Direct download link
125
+ ```
126
+
127
+ #### Play (Search & Auto-Download)
128
+ Searches for a query and immediately returns the download link for the first result.
129
+ ```javascript
130
+ // Get Audio
131
+ const song = await downloader.play("Adele Hello", "mp3");
132
+
133
+ // Get Video
134
+ const vid = await downloader.play("Adele Hello", "mp4");
135
+ ```
136
+
137
+ ---
138
+
139
+ ### 3. Search & Lyrics
140
+
141
+ #### Guitar Chords & Lyrics
142
+ Fetches chords and lyrics from Gitagram.
143
+ ```javascript
144
+ const song = await search.chords("Ed Sheeran Perfect");
145
+ console.log(song.chord);
146
+ ```
147
+
148
+ #### Wattpad
149
+ Search for stories on Wattpad.
150
+ ```javascript
151
+ const stories = await search.wattpad("Werewolf");
152
+ console.log(stories);
153
+ ```
154
+
155
+ ---
156
+
157
+ ### 4. Utilities & AI Tools
158
+
159
+ #### Remini (AI Image Enhancer)
160
+ Enhances low-quality images using AI. Returns a `Buffer`.
161
+ ```javascript
162
+ const fs = require('fs');
163
+
164
+ // Methods: 'enhance', 'recolor', 'dehaze'
165
+ const buffer = await tools.remini("https://example.com/blurry.jpg", "enhance");
166
+
167
+ fs.writeFileSync("enhanced.jpg", buffer);
168
+ ```
169
+
170
+ #### Screenshot Website
171
+ Takes a screenshot of any URL.
172
+ ```javascript
173
+ const buffer = await tools.ssweb("https://google.com", "desktop");
174
+ // options: 'desktop', 'tablet', 'phone'
175
+ ```
176
+
177
+ #### Stylish Text
178
+ Converts normal text into fancy fonts.
179
+ ```javascript
180
+ const fonts = await tools.styleText("Heavstal Tech");
181
+ console.log(fonts);
182
+ ```
183
+
184
+ ---
185
+
186
+ ## πŸ“ License
187
+
188
+ This project is licensed under the **MIT License**.
189
+
190
+ ---
191
+
192
+ <div align="center">
193
+ <p>Maintained by <a href="https://heavstal-tech.vercel.app">HEAVSTAL TECH</a></p>
194
+ <p><i>Building Tomorrow's Web, Today.</i></p>
195
+ </div>
@@ -0,0 +1,157 @@
1
+ interface Author {
2
+ name: string;
3
+ source: string;
4
+ }
5
+ declare const AUTHOR: Author;
6
+ interface TikTokResult {
7
+ author: Author;
8
+ status: boolean;
9
+ title: string;
10
+ cover?: string;
11
+ origin_cover?: string;
12
+ no_watermark?: string;
13
+ watermark?: string;
14
+ music?: string;
15
+ views?: number | string;
16
+ likes?: number | string;
17
+ comments?: number | string;
18
+ shares?: number | string;
19
+ downloads?: number | string;
20
+ uniqueId?: string;
21
+ profileUrl?: string;
22
+ profileImage?: string;
23
+ hashtags?: string[];
24
+ slideImages?: string[];
25
+ author_name?: string;
26
+ }
27
+ interface SocialResult {
28
+ author: Author;
29
+ status: boolean;
30
+ type: 'video' | 'image';
31
+ title?: string;
32
+ thumbnail?: string;
33
+ url: string;
34
+ }
35
+ interface YouTubeResult {
36
+ author: Author;
37
+ title: string;
38
+ thumbnail: string;
39
+ channel: string;
40
+ published: string;
41
+ views: string;
42
+ url: string;
43
+ duration?: number | string;
44
+ status?: boolean;
45
+ }
46
+ interface YouTubeSearchResult {
47
+ type: 'video' | 'channel' | 'list' | 'live';
48
+ url: string;
49
+ title: string;
50
+ description?: string;
51
+ image?: string;
52
+ thumbnail?: string;
53
+ seconds?: number;
54
+ timestamp?: string;
55
+ views?: number;
56
+ ago?: string;
57
+ author?: {
58
+ name: string;
59
+ url: string;
60
+ };
61
+ }
62
+ interface UtilsResult {
63
+ author: Author;
64
+ status: boolean;
65
+ data: Buffer | string | any;
66
+ }
67
+
68
+ /**
69
+ * Main TikTok Function
70
+ * Supports: URL Download & Search Query
71
+ */
72
+ declare const tiktok: (input: string) => Promise<TikTokResult>;
73
+ /**
74
+ * TikTok Slide Downloader
75
+ */
76
+ declare const tiktokSlide: (url: string) => Promise<TikTokResult>;
77
+
78
+ /**
79
+ * Facebook Video Downloader
80
+ * Source: getmyfb.com
81
+ */
82
+ declare const fbdl: (url: string) => Promise<SocialResult[]>;
83
+ /**
84
+ * Instagram Downloader
85
+ * Source: indown.io
86
+ */
87
+ declare const igdl: (url: string) => Promise<SocialResult[]>;
88
+
89
+ declare const search$1: (query: string) => Promise<YouTubeSearchResult[]>;
90
+ declare const ytmp3: (url: string) => Promise<YouTubeResult>;
91
+ declare const ytmp4: (url: string) => Promise<YouTubeResult>;
92
+ /**
93
+ * YouTube Play (Search & Download)
94
+ * Searches for a query, grabs the first result, and returns the download link
95
+ */
96
+ declare const play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
97
+
98
+ declare const ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
99
+ declare const remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
100
+ declare const styleText: (text: string) => Promise<{
101
+ author: Author;
102
+ name: string;
103
+ result: string;
104
+ }[]>;
105
+ declare const wattpad: (query: string) => Promise<any[]>;
106
+ declare const chords: (query: string) => Promise<any>;
107
+
108
+ declare const downloader: {
109
+ tiktok: (input: string) => Promise<TikTokResult>;
110
+ tiktokSlide: (url: string) => Promise<TikTokResult>;
111
+ igdl: (url: string) => Promise<SocialResult[]>;
112
+ fbdl: (url: string) => Promise<SocialResult[]>;
113
+ ytmp3: (url: string) => Promise<YouTubeResult>;
114
+ ytmp4: (url: string) => Promise<YouTubeResult>;
115
+ play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
116
+ };
117
+ declare const search: {
118
+ youtube: (query: string) => Promise<YouTubeSearchResult[]>;
119
+ wattpad: (query: string) => Promise<any[]>;
120
+ chords: (query: string) => Promise<any>;
121
+ };
122
+ declare const tools: {
123
+ ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
124
+ remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
125
+ styleText: (text: string) => Promise<{
126
+ author: Author;
127
+ name: string;
128
+ result: string;
129
+ }[]>;
130
+ };
131
+ declare const _default: {
132
+ downloader: {
133
+ tiktok: (input: string) => Promise<TikTokResult>;
134
+ tiktokSlide: (url: string) => Promise<TikTokResult>;
135
+ igdl: (url: string) => Promise<SocialResult[]>;
136
+ fbdl: (url: string) => Promise<SocialResult[]>;
137
+ ytmp3: (url: string) => Promise<YouTubeResult>;
138
+ ytmp4: (url: string) => Promise<YouTubeResult>;
139
+ play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
140
+ };
141
+ search: {
142
+ youtube: (query: string) => Promise<YouTubeSearchResult[]>;
143
+ wattpad: (query: string) => Promise<any[]>;
144
+ chords: (query: string) => Promise<any>;
145
+ };
146
+ tools: {
147
+ ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
148
+ remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
149
+ styleText: (text: string) => Promise<{
150
+ author: Author;
151
+ name: string;
152
+ result: string;
153
+ }[]>;
154
+ };
155
+ };
156
+
157
+ export { AUTHOR, type Author, type SocialResult, type TikTokResult, type UtilsResult, type YouTubeResult, type YouTubeSearchResult, chords, _default as default, downloader, fbdl, igdl, play, remini, search, ssweb, styleText, tiktok, tiktokSlide, tools, wattpad, search$1 as ytSearch, ytmp3, ytmp4 };
@@ -0,0 +1,157 @@
1
+ interface Author {
2
+ name: string;
3
+ source: string;
4
+ }
5
+ declare const AUTHOR: Author;
6
+ interface TikTokResult {
7
+ author: Author;
8
+ status: boolean;
9
+ title: string;
10
+ cover?: string;
11
+ origin_cover?: string;
12
+ no_watermark?: string;
13
+ watermark?: string;
14
+ music?: string;
15
+ views?: number | string;
16
+ likes?: number | string;
17
+ comments?: number | string;
18
+ shares?: number | string;
19
+ downloads?: number | string;
20
+ uniqueId?: string;
21
+ profileUrl?: string;
22
+ profileImage?: string;
23
+ hashtags?: string[];
24
+ slideImages?: string[];
25
+ author_name?: string;
26
+ }
27
+ interface SocialResult {
28
+ author: Author;
29
+ status: boolean;
30
+ type: 'video' | 'image';
31
+ title?: string;
32
+ thumbnail?: string;
33
+ url: string;
34
+ }
35
+ interface YouTubeResult {
36
+ author: Author;
37
+ title: string;
38
+ thumbnail: string;
39
+ channel: string;
40
+ published: string;
41
+ views: string;
42
+ url: string;
43
+ duration?: number | string;
44
+ status?: boolean;
45
+ }
46
+ interface YouTubeSearchResult {
47
+ type: 'video' | 'channel' | 'list' | 'live';
48
+ url: string;
49
+ title: string;
50
+ description?: string;
51
+ image?: string;
52
+ thumbnail?: string;
53
+ seconds?: number;
54
+ timestamp?: string;
55
+ views?: number;
56
+ ago?: string;
57
+ author?: {
58
+ name: string;
59
+ url: string;
60
+ };
61
+ }
62
+ interface UtilsResult {
63
+ author: Author;
64
+ status: boolean;
65
+ data: Buffer | string | any;
66
+ }
67
+
68
+ /**
69
+ * Main TikTok Function
70
+ * Supports: URL Download & Search Query
71
+ */
72
+ declare const tiktok: (input: string) => Promise<TikTokResult>;
73
+ /**
74
+ * TikTok Slide Downloader
75
+ */
76
+ declare const tiktokSlide: (url: string) => Promise<TikTokResult>;
77
+
78
+ /**
79
+ * Facebook Video Downloader
80
+ * Source: getmyfb.com
81
+ */
82
+ declare const fbdl: (url: string) => Promise<SocialResult[]>;
83
+ /**
84
+ * Instagram Downloader
85
+ * Source: indown.io
86
+ */
87
+ declare const igdl: (url: string) => Promise<SocialResult[]>;
88
+
89
+ declare const search$1: (query: string) => Promise<YouTubeSearchResult[]>;
90
+ declare const ytmp3: (url: string) => Promise<YouTubeResult>;
91
+ declare const ytmp4: (url: string) => Promise<YouTubeResult>;
92
+ /**
93
+ * YouTube Play (Search & Download)
94
+ * Searches for a query, grabs the first result, and returns the download link
95
+ */
96
+ declare const play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
97
+
98
+ declare const ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
99
+ declare const remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
100
+ declare const styleText: (text: string) => Promise<{
101
+ author: Author;
102
+ name: string;
103
+ result: string;
104
+ }[]>;
105
+ declare const wattpad: (query: string) => Promise<any[]>;
106
+ declare const chords: (query: string) => Promise<any>;
107
+
108
+ declare const downloader: {
109
+ tiktok: (input: string) => Promise<TikTokResult>;
110
+ tiktokSlide: (url: string) => Promise<TikTokResult>;
111
+ igdl: (url: string) => Promise<SocialResult[]>;
112
+ fbdl: (url: string) => Promise<SocialResult[]>;
113
+ ytmp3: (url: string) => Promise<YouTubeResult>;
114
+ ytmp4: (url: string) => Promise<YouTubeResult>;
115
+ play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
116
+ };
117
+ declare const search: {
118
+ youtube: (query: string) => Promise<YouTubeSearchResult[]>;
119
+ wattpad: (query: string) => Promise<any[]>;
120
+ chords: (query: string) => Promise<any>;
121
+ };
122
+ declare const tools: {
123
+ ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
124
+ remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
125
+ styleText: (text: string) => Promise<{
126
+ author: Author;
127
+ name: string;
128
+ result: string;
129
+ }[]>;
130
+ };
131
+ declare const _default: {
132
+ downloader: {
133
+ tiktok: (input: string) => Promise<TikTokResult>;
134
+ tiktokSlide: (url: string) => Promise<TikTokResult>;
135
+ igdl: (url: string) => Promise<SocialResult[]>;
136
+ fbdl: (url: string) => Promise<SocialResult[]>;
137
+ ytmp3: (url: string) => Promise<YouTubeResult>;
138
+ ytmp4: (url: string) => Promise<YouTubeResult>;
139
+ play: (query: string, type?: "mp3" | "mp4") => Promise<YouTubeResult>;
140
+ };
141
+ search: {
142
+ youtube: (query: string) => Promise<YouTubeSearchResult[]>;
143
+ wattpad: (query: string) => Promise<any[]>;
144
+ chords: (query: string) => Promise<any>;
145
+ };
146
+ tools: {
147
+ ssweb: (url: string, device?: "desktop" | "tablet" | "phone") => Promise<Buffer>;
148
+ remini: (imageUrl: string, method?: "enhance" | "recolor" | "dehaze") => Promise<Buffer>;
149
+ styleText: (text: string) => Promise<{
150
+ author: Author;
151
+ name: string;
152
+ result: string;
153
+ }[]>;
154
+ };
155
+ };
156
+
157
+ export { AUTHOR, type Author, type SocialResult, type TikTokResult, type UtilsResult, type YouTubeResult, type YouTubeSearchResult, chords, _default as default, downloader, fbdl, igdl, play, remini, search, ssweb, styleText, tiktok, tiktokSlide, tools, wattpad, search$1 as ytSearch, ytmp3, ytmp4 };