@storylinkpro/instagram-stories-api 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -0
- package/README.md +14 -8
- package/package.json +20 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- The package description, keywords and README make the package easier to find.
|
|
6
|
+
- A GitHub Actions workflow publishes new versions with npm provenance.
|
|
7
|
+
|
|
8
|
+
## 0.1.0
|
|
9
|
+
|
|
10
|
+
- First release. A typed client and CLI that read an Instagram account, its Stories, posts and reels, and their insights.
|
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# @storylinkpro/instagram-stories-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@storylinkpro/instagram-stories-api)
|
|
4
|
+
[](https://github.com/storylinkpro/instagram-stories-api/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@storylinkpro/instagram-stories-api)
|
|
6
|
+
[](LICENSE)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
**An Instagram Graph API client and CLI for Node.js and TypeScript.** It reads Instagram Stories, posts and reels. It also reads their insights: views, reach, replies, likes, comments, saves and shares. It has no dependencies. It needs Node 20+ or another runtime with `fetch`.
|
|
9
|
+
|
|
10
|
+
Use it in a script, a cron job or your own Instagram analytics dashboard.
|
|
6
11
|
|
|
7
12
|
> Unofficial. Meta did not make this package and does not support it. It calls Meta's public Graph API at `graph.facebook.com`.
|
|
8
13
|
|
|
@@ -12,7 +17,7 @@ Use it in a script, a cron job or your own dashboard.
|
|
|
12
17
|
npm install @storylinkpro/instagram-stories-api
|
|
13
18
|
```
|
|
14
19
|
|
|
15
|
-
## Quick start
|
|
20
|
+
## Quick start: read Instagram story insights
|
|
16
21
|
|
|
17
22
|
```ts
|
|
18
23
|
import { createClient } from "@storylinkpro/instagram-stories-api";
|
|
@@ -95,7 +100,7 @@ Methods that read an account take `igUserId` to use another account than the cli
|
|
|
95
100
|
|
|
96
101
|
A failed call throws `InstagramApiError`. It has `status`, and Meta's `code`, `subcode`, `type`, `fbtraceId` and `message`. It also has these flags:
|
|
97
102
|
|
|
98
|
-
- `isAuthError`: code 190, or subcode 458, 460, 463 or 467. The token
|
|
103
|
+
- `isAuthError`: code 190, or subcode 458, 460, 463 or 467. The token expired, someone revoked it, or it is not valid. Get a new token.
|
|
99
104
|
- `isRateLimit`: code 4, 17, 32, 613, 80001 or 80002. Meta throttled the app or the account. Wait before you try again.
|
|
100
105
|
|
|
101
106
|
A network error or a timeout has `status` 0. The message never contains the access token.
|
|
@@ -111,7 +116,7 @@ try {
|
|
|
111
116
|
}
|
|
112
117
|
```
|
|
113
118
|
|
|
114
|
-
###
|
|
119
|
+
### Instagram API rate limits
|
|
115
120
|
|
|
116
121
|
Meta sends usage headers on each response. `ig.lastUsage` holds the most recent ones, and `error.usage` holds the ones of a failed call:
|
|
117
122
|
|
|
@@ -122,7 +127,7 @@ ig.lastUsage?.businessUseCase; // from x-business-use-case-usage, per business o
|
|
|
122
127
|
|
|
123
128
|
The client does not retry. You decide when to call again.
|
|
124
129
|
|
|
125
|
-
## Get
|
|
130
|
+
## Get an Instagram Graph API access token
|
|
126
131
|
|
|
127
132
|
This version uses the Instagram API with Facebook Login. You need:
|
|
128
133
|
|
|
@@ -134,9 +139,10 @@ To find the Instagram account id, call `GET /me/accounts?fields=instagram_busine
|
|
|
134
139
|
|
|
135
140
|
Keep the token on the server. Do not send it to the browser.
|
|
136
141
|
|
|
137
|
-
##
|
|
142
|
+
## Related
|
|
138
143
|
|
|
139
|
-
|
|
144
|
+
- [Storylink](https://storylink.pro) schedules Instagram Stories, posts and reels, and shows their results. Storylink made this package.
|
|
145
|
+
- [`storylink-mcp`](https://www.npmjs.com/package/storylink-mcp) connects Claude and other AI assistants to your Storylink Instagram analytics.
|
|
140
146
|
|
|
141
147
|
## License
|
|
142
148
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storylinkpro/instagram-stories-api",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Instagram Graph API client and CLI for Node.js and TypeScript: read Instagram Stories, posts, reels and their insights (views, reach, replies, likes, saves, shares). Typed, zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"instagram",
|
|
7
7
|
"instagram-api",
|
|
8
8
|
"instagram-graph-api",
|
|
9
9
|
"instagram-stories",
|
|
10
|
+
"instagram-story",
|
|
10
11
|
"instagram-insights",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
12
|
+
"instagram-analytics",
|
|
13
|
+
"instagram-reels",
|
|
14
|
+
"instagram-business",
|
|
15
|
+
"meta-graph-api",
|
|
16
|
+
"facebook-graph-api",
|
|
17
|
+
"graph-api",
|
|
18
|
+
"social-media",
|
|
19
|
+
"analytics",
|
|
20
|
+
"insights",
|
|
21
|
+
"api-client",
|
|
22
|
+
"cli",
|
|
23
|
+
"typescript",
|
|
24
|
+
"nodejs",
|
|
25
|
+
"zero-dependency"
|
|
13
26
|
],
|
|
14
27
|
"homepage": "https://github.com/storylinkpro/instagram-stories-api#readme",
|
|
15
28
|
"bugs": {
|
|
@@ -35,9 +48,10 @@
|
|
|
35
48
|
"./package.json": "./package.json"
|
|
36
49
|
},
|
|
37
50
|
"files": [
|
|
38
|
-
"
|
|
51
|
+
"CHANGELOG.md",
|
|
52
|
+
"LICENSE",
|
|
39
53
|
"README.md",
|
|
40
|
-
"
|
|
54
|
+
"dist"
|
|
41
55
|
],
|
|
42
56
|
"sideEffects": false,
|
|
43
57
|
"engines": {
|