@jerrycoder/instagram-api 2.5.5
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/README.md +114 -0
- package/index.js +18 -0
- package/index.mjs +18 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @jerrycoder/instagram-api
|
|
2
|
+
|
|
3
|
+
Unofficial Instagram Downloader API โ fetch Reels, Posts, Stories using JerryCoder API.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## ๐ API Website
|
|
7
|
+
[https://jerrycoder.oggyapi.workers.dev](https://jerrycoder.oggyapi.workers.dev)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## ๐ Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @jerrycoder/instagram-api
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
โก Quick Usage
|
|
17
|
+
|
|
18
|
+
## โ
CommonJS (Node.js)
|
|
19
|
+
```bash
|
|
20
|
+
const { instagram } = require("@jerrycoder/instagram-api");
|
|
21
|
+
|
|
22
|
+
(async () => {
|
|
23
|
+
const data = await instagram("https://www.instagram.com/reel/xxxxx/");
|
|
24
|
+
console.log(data);
|
|
25
|
+
})();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## โ
ESM / Modern JS
|
|
29
|
+
```bash
|
|
30
|
+
import { instagram } from "@jerrycoder/instagram-api";
|
|
31
|
+
|
|
32
|
+
const data = await instagram("https://www.instagram.com/reel/xxxxx/");
|
|
33
|
+
console.log(data);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
๐ก Response Example
|
|
37
|
+
```bash
|
|
38
|
+
{
|
|
39
|
+
"status": "success",
|
|
40
|
+
"data": {
|
|
41
|
+
"type": "https://...",
|
|
42
|
+
"url": "https://..."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## โ๏ธ Deploy on Vercel (API Endpoint)
|
|
48
|
+
|
|
49
|
+
Create file:
|
|
50
|
+
/api/instagram.js
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
import { instagram } from "@jerrycoder/instagram-api";
|
|
54
|
+
|
|
55
|
+
export default async function handler(req, res) {
|
|
56
|
+
try {
|
|
57
|
+
const { url } = req.query;
|
|
58
|
+
|
|
59
|
+
if (!url) {
|
|
60
|
+
return res.status(400).json({
|
|
61
|
+
status: "error",
|
|
62
|
+
message: "URL query is required"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const data = await instagram(url);
|
|
67
|
+
|
|
68
|
+
return res.status(200).json({
|
|
69
|
+
status: "success",
|
|
70
|
+
data
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
} catch (err) {
|
|
74
|
+
return res.status(500).json({
|
|
75
|
+
status: "error",
|
|
76
|
+
message: err.message
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## ๐ API Usage (after deploy)
|
|
83
|
+
|
|
84
|
+
https://your-domain.vercel.app/api/instagram?url=INSTAGRAM_URL
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## โ ๏ธ Notes
|
|
88
|
+
URL must be a valid Instagram post/reel/story
|
|
89
|
+
|
|
90
|
+
Private content is not supported
|
|
91
|
+
|
|
92
|
+
Depends on external API availability
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## ๐ ๏ธ Features
|
|
96
|
+
|
|
97
|
+
โข โก Fast response
|
|
98
|
+
|
|
99
|
+
โข ๐ฅ Download Reels / Posts / Stories
|
|
100
|
+
|
|
101
|
+
โข ๐ Simple API structure
|
|
102
|
+
|
|
103
|
+
โข ๐งฉ Works with CommonJS & ESM
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## ๐งช Status
|
|
107
|
+
|
|
108
|
+
ยฐ โ
Fully Tested on Node.js & Vercel
|
|
109
|
+
|
|
110
|
+
ยฐ ๐ Version: 2.5.5 (Latest)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## ๐ License
|
|
114
|
+
MIT License ยฉ JerryCoder
|
package/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const axios = require("axios");
|
|
2
|
+
|
|
3
|
+
async function instagram(url) {
|
|
4
|
+
if (!url) throw new Error("URL is required");
|
|
5
|
+
|
|
6
|
+
const apiUrl = `https://jerrycoder.oggyapi.workers.dev/insta?url=${encodeURIComponent(url)}`;
|
|
7
|
+
const { data } = await axios.get(apiUrl);
|
|
8
|
+
|
|
9
|
+
if (data.status !== "success") {
|
|
10
|
+
throw new Error("Failed to fetch data");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return data.data;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
instagram
|
|
18
|
+
};
|
package/index.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
export async function instagram(url) {
|
|
4
|
+
if (!url) throw new Error("URL is required");
|
|
5
|
+
|
|
6
|
+
const apiUrl = `https://jerrycoder.oggyapi.workers.dev/insta?url=${encodeURIComponent(url)}`;
|
|
7
|
+
const { data } = await axios.get(apiUrl);
|
|
8
|
+
|
|
9
|
+
if (data.status !== "success") {
|
|
10
|
+
throw new Error("Failed to fetch data");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return data.data;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
instagram
|
|
18
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jerrycoder/instagram-api",
|
|
3
|
+
"version": "2.5.5",
|
|
4
|
+
"description": "Unofficial Instagram Downloader API โ fetch Reels, Posts, Stories using JerryCoder API.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"author": "JerryCoder",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./index.mjs",
|
|
9
|
+
"require": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"axios": "^1.7.2"
|
|
14
|
+
}
|
|
15
|
+
}
|