socialcrawl-mcp 1.2.0 → 1.4.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 +1 -196
- package/README.md +50 -19
- package/dist/__tests__/data-integrity.test.js +39 -12
- package/dist/__tests__/data-integrity.test.js.map +1 -1
- package/dist/__tests__/preflight.test.js +1 -1
- package/dist/__tests__/preflight.test.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/data/docs.js +56 -7
- package/dist/data/docs.js.map +1 -1
- package/dist/data/endpoints.d.ts +4 -3
- package/dist/data/endpoints.js +2764 -736
- package/dist/data/endpoints.js.map +1 -1
- package/dist/data/platforms.d.ts +6 -0
- package/dist/data/platforms.js +155 -41
- package/dist/data/platforms.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/schemas/tools.js +1 -1
- package/dist/schemas/tools.js.map +1 -1
- package/package.json +3 -2
package/LICENSE
CHANGED
|
@@ -1,193 +1,6 @@
|
|
|
1
|
-
The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
|
|
2
|
-
|
|
3
|
-
Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License.
|
|
4
|
-
|
|
5
|
-
No rights beyond those granted by the applicable original license are conveyed for such contributions.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
Apache License
|
|
10
|
-
Version 2.0, January 2004
|
|
11
|
-
http://www.apache.org/licenses/
|
|
12
|
-
|
|
13
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
14
|
-
|
|
15
|
-
1. Definitions.
|
|
16
|
-
|
|
17
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
18
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
19
|
-
|
|
20
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
21
|
-
the copyright owner that is granting the License.
|
|
22
|
-
|
|
23
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
24
|
-
other entities that control, are controlled by, or are under common
|
|
25
|
-
control with that entity. For the purposes of this definition,
|
|
26
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
27
|
-
direction or management of such entity, whether by contract or
|
|
28
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
29
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
30
|
-
|
|
31
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
32
|
-
exercising permissions granted by this License.
|
|
33
|
-
|
|
34
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
35
|
-
including but not limited to software source code, documentation
|
|
36
|
-
source, and configuration files.
|
|
37
|
-
|
|
38
|
-
"Object" form shall mean any form resulting from mechanical
|
|
39
|
-
transformation or translation of a Source form, including but
|
|
40
|
-
not limited to compiled object code, generated documentation,
|
|
41
|
-
and conversions to other media types.
|
|
42
|
-
|
|
43
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
44
|
-
Object form, made available under the License, as indicated by a
|
|
45
|
-
copyright notice that is included in or attached to the work
|
|
46
|
-
(an example is provided in the Appendix below).
|
|
47
|
-
|
|
48
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
49
|
-
form, that is based on (or derived from) the Work and for which the
|
|
50
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
51
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
52
|
-
of this License, Derivative Works shall not include works that remain
|
|
53
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
54
|
-
the Work and Derivative Works thereof.
|
|
55
|
-
|
|
56
|
-
"Contribution" shall mean any work of authorship, including
|
|
57
|
-
the original version of the Work and any modifications or additions
|
|
58
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
59
|
-
submitted to the Licensor for inclusion in the Work by the copyright
|
|
60
|
-
owner or by an individual or Legal Entity authorized to submit on behalf
|
|
61
|
-
of the copyright owner. For the purposes of this definition, "submitted"
|
|
62
|
-
means any form of electronic, verbal, or written communication sent
|
|
63
|
-
to the Licensor or its representatives, including but not limited to
|
|
64
|
-
communication on electronic mailing lists, source code control systems,
|
|
65
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
66
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
67
|
-
excluding communication that is conspicuously marked or otherwise
|
|
68
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
69
|
-
|
|
70
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
71
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
72
|
-
subsequently incorporated within the Work.
|
|
73
|
-
|
|
74
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
78
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
79
|
-
Work and such Derivative Works in Source or Object form.
|
|
80
|
-
|
|
81
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
82
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
83
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
84
|
-
(except as stated in this section) patent license to make, have made,
|
|
85
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
86
|
-
where such license applies only to those patent claims licensable
|
|
87
|
-
by such Contributor that are necessarily infringed by their
|
|
88
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
89
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
90
|
-
institute patent litigation against any entity (including a
|
|
91
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
92
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
93
|
-
or contributory patent infringement, then any patent licenses
|
|
94
|
-
granted to You under this License for that Work shall terminate
|
|
95
|
-
as of the date such litigation is filed.
|
|
96
|
-
|
|
97
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
98
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
99
|
-
modifications, and in Source or Object form, provided that You
|
|
100
|
-
meet the following conditions:
|
|
101
|
-
|
|
102
|
-
(a) You must give any other recipients of the Work or
|
|
103
|
-
Derivative Works a copy of this License; and
|
|
104
|
-
|
|
105
|
-
(b) You must cause any modified files to carry prominent notices
|
|
106
|
-
stating that You changed the files; and
|
|
107
|
-
|
|
108
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
109
|
-
that You distribute, all copyright, patent, trademark, and
|
|
110
|
-
attribution notices from the Source form of the Work,
|
|
111
|
-
excluding those notices that do not pertain to any part of
|
|
112
|
-
the Derivative Works; and
|
|
113
|
-
|
|
114
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
115
|
-
distribution, then any Derivative Works that You distribute must
|
|
116
|
-
include a readable copy of the attribution notices contained
|
|
117
|
-
within such NOTICE file, excluding those notices that do not
|
|
118
|
-
pertain to any part of the Derivative Works, in at least one
|
|
119
|
-
of the following places: within a NOTICE text file distributed
|
|
120
|
-
as part of the Derivative Works; within the Source form or
|
|
121
|
-
documentation, if provided along with the Derivative Works; or,
|
|
122
|
-
within a display generated by the Derivative Works, if and
|
|
123
|
-
wherever such third-party notices normally appear. The contents
|
|
124
|
-
of the NOTICE file are for informational purposes only and
|
|
125
|
-
do not modify the License. You may add Your own attribution
|
|
126
|
-
notices within Derivative Works that You distribute, alongside
|
|
127
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
128
|
-
that such additional attribution notices cannot be construed
|
|
129
|
-
as modifying the License.
|
|
130
|
-
|
|
131
|
-
You may add Your own copyright statement to Your modifications and
|
|
132
|
-
may provide additional or different license terms and conditions
|
|
133
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
134
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
135
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
136
|
-
the conditions stated in this License.
|
|
137
|
-
|
|
138
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
139
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
140
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
141
|
-
this License, without any additional terms or conditions.
|
|
142
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
143
|
-
the terms of any separate license agreement you may have executed
|
|
144
|
-
with Licensor regarding such Contributions.
|
|
145
|
-
|
|
146
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
147
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
148
|
-
except as required for reasonable and customary use in describing the
|
|
149
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
150
|
-
|
|
151
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
152
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
153
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
154
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
155
|
-
implied, including, without limitation, any warranties or conditions
|
|
156
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
157
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
158
|
-
appropriateness of using or redistributing the Work and assume any
|
|
159
|
-
risks associated with Your exercise of permissions under this License.
|
|
160
|
-
|
|
161
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
162
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
163
|
-
unless required by applicable law (such as deliberate and grossly
|
|
164
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
165
|
-
liable to You for damages, including any direct, indirect, special,
|
|
166
|
-
incidental, or consequential damages of any character arising as a
|
|
167
|
-
result of this License or out of the use or inability to use the
|
|
168
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
169
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
170
|
-
other commercial damages or losses), even if such Contributor
|
|
171
|
-
has been advised of the possibility of such damages.
|
|
172
|
-
|
|
173
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
174
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
175
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
176
|
-
or other liability obligations and/or rights consistent with this
|
|
177
|
-
License. However, in accepting such obligations, You may act only
|
|
178
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
179
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
180
|
-
defend, and hold each Contributor harmless for any liability
|
|
181
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
182
|
-
of your accepting any such warranty or additional liability.
|
|
183
|
-
|
|
184
|
-
END OF TERMS AND CONDITIONS
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
1
|
MIT License
|
|
189
2
|
|
|
190
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Ridio Company
|
|
191
4
|
|
|
192
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
193
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -206,11 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
206
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
207
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
208
21
|
SOFTWARE.
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
Creative Commons Attribution 4.0 International (CC-BY-4.0)
|
|
213
|
-
|
|
214
|
-
Documentation in this project (excluding specifications) is licensed under
|
|
215
|
-
CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
|
|
216
|
-
the full license text.
|
package/README.md
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
# socialcrawl-mcp
|
|
4
4
|
|
|
5
|
-
**Give your AI agent access to
|
|
5
|
+
**Give your AI agent access to 39 platforms — social media, commerce & product reviews, app stores, places & travel, business reputation, web research, prediction markets, and a universal cross-platform meta-search — through a single API**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/socialcrawl-mcp)
|
|
8
8
|
[](https://registry.modelcontextprotocol.io)
|
|
9
|
-
[](https://socialcrawl.dev)
|
|
10
|
+
[](https://socialcrawl.dev/docs)
|
|
11
11
|
[](LICENSE)
|
|
12
|
+
[](https://glama.ai/mcp/servers/socialcrawl/mcp)
|
|
13
|
+
|
|
14
|
+
<a href="https://glama.ai/mcp/servers/socialcrawl/mcp">
|
|
15
|
+
<img width="380" src="https://glama.ai/mcp/servers/socialcrawl/mcp/badges/card.svg" alt="Socialcrawl MCP server" />
|
|
16
|
+
</a>
|
|
12
17
|
|
|
13
18
|
[Overview](#overview) | [Installation](#installation) | [Setup](#setup) | [Usage](#usage) | [Tools](#available-tools) | [Platforms](#supported-platforms)
|
|
14
19
|
|
|
@@ -18,9 +23,9 @@
|
|
|
18
23
|
|
|
19
24
|
## Overview
|
|
20
25
|
|
|
21
|
-
`socialcrawl-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that connects AI agents to the [SocialCrawl API](https://socialcrawl.dev) — a unified
|
|
26
|
+
`socialcrawl-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that connects AI agents to the [SocialCrawl API](https://socialcrawl.dev) — a unified data API covering 39 platforms and 221 endpoints.
|
|
22
27
|
|
|
23
|
-
Retrieve profiles, posts, comments, search results, trending content, and analytics from TikTok, Instagram, YouTube, Twitter/X, LinkedIn, Reddit, and
|
|
28
|
+
Retrieve profiles, posts, comments, search results, trending content, and analytics from TikTok, Instagram, YouTube, Twitter/X, LinkedIn, Reddit, GitHub, Hacker News, Polymarket, and 30 more platforms. Pull products, reviews, and sellers from Amazon and Google Shopping; apps, charts, and reviews from Google Play and the Apple App Store; places, hotels, and traveler reviews from Tripadvisor and Google Business; brand reputation from Trustpilot; Korean search across 11 Naver corpora; cross-web brand mentions with sentiment via Content Analysis — plus web research via Tavily and Perplexity, AI-powered X search via Grok, and a single `/search/everywhere` endpoint that fans out across 12+ sources in one call. One API key, one consistent response format, every platform.
|
|
24
29
|
|
|
25
30
|
**What the MCP server does:**
|
|
26
31
|
- Discovers available platforms and endpoints dynamically
|
|
@@ -30,6 +35,14 @@ Retrieve profiles, posts, comments, search results, trending content, and analyt
|
|
|
30
35
|
|
|
31
36
|
## Installation
|
|
32
37
|
|
|
38
|
+
### npm
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g socialcrawl-mcp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Available on [npm](https://www.npmjs.com/package/socialcrawl-mcp). Most users don't need this — the MCP client configs below use `npx` and auto-install on first run.
|
|
45
|
+
|
|
33
46
|
### Claude Code (quickest)
|
|
34
47
|
|
|
35
48
|
```bash
|
|
@@ -215,7 +228,7 @@ The MCP server exposes 5 tools:
|
|
|
215
228
|
|
|
216
229
|
| Tool | Description | Needs API key? |
|
|
217
230
|
|------|-------------|----------------|
|
|
218
|
-
| `socialcrawl_list_platforms` | Discover all
|
|
231
|
+
| `socialcrawl_list_platforms` | Discover all 39 platforms with their endpoints and capabilities | No |
|
|
219
232
|
| `socialcrawl_list_endpoints` | See all endpoints, required parameters, and credit costs for a platform | No |
|
|
220
233
|
| `socialcrawl_request` | Make any SocialCrawl API call — profiles, posts, comments, search, analytics. Supports an optional `idempotencyKey` for retry-safe calls. | Yes |
|
|
221
234
|
| `socialcrawl_check_balance` | Check remaining credits and recent deduction summary. Calls `/v1/credits/balance` — costs 0 credits. | Yes |
|
|
@@ -235,21 +248,39 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
|
|
|
235
248
|
|
|
236
249
|
| Platform | Endpoints | Data Available |
|
|
237
250
|
|----------|-----------|----------------|
|
|
238
|
-
| **
|
|
239
|
-
| **
|
|
240
|
-
| **YouTube** |
|
|
241
|
-
| **
|
|
242
|
-
| **
|
|
243
|
-
| **
|
|
244
|
-
| **
|
|
245
|
-
| **
|
|
246
|
-
| **
|
|
247
|
-
| **
|
|
251
|
+
| **Facebook** | 21 | Pages, posts, comments, groups, photos, reels, events, Marketplace, transcripts, full Ad Library |
|
|
252
|
+
| **TikTok** | 18 | Profiles, videos, comments & replies, search, trending, audience, followers, live, songs, transcripts |
|
|
253
|
+
| **YouTube** | 16 | Channels, videos, shorts, comments & replies, sponsors, playlists, community posts, search, trending, transcripts |
|
|
254
|
+
| **Instagram** | 15 | Profiles, posts, reels, comments, highlights, search, trending reels, audio reels, embed, transcripts |
|
|
255
|
+
| **GitHub** | 12 | Users, repos, issues, PRs, READMEs, releases, search, repo dossier, user profile-velocity |
|
|
256
|
+
| **Naver** | 11 | Korea's #1 portal — blog, news, book, encyclopedia, cafe, KiN, local, shopping, doc, image, web search |
|
|
257
|
+
| **Google** | 10 | Web search, Ads Transparency, Business Profile (info, reviews, updates, Q&A), Travel hotels |
|
|
258
|
+
| **Content Analysis** | 10 | Cross-web brand mentions, sentiment, rating distributions, phrase/category trends |
|
|
259
|
+
| **Google Play** | 8 | App search, app details, reviews, charts, listings database, reference data |
|
|
260
|
+
| **Apple App Store** | 8 | App search, app details, reviews, charts, listings database, reference data |
|
|
261
|
+
| **LinkedIn** | 8 | Profiles, company pages, posts, post search, transcripts, Ad Library |
|
|
262
|
+
| **Twitter/X** | 7 | Profiles, tweets, communities, video transcripts, AI search via Grok |
|
|
263
|
+
| **Reddit** | 6 | Subreddits, posts, comments, search, transcripts |
|
|
264
|
+
| **Spotify** | 6 | Artists, tracks, albums, podcasts, episodes, search |
|
|
265
|
+
| **TikTok Shop** | 5 | Products, reviews, listings, search, creator showcases |
|
|
266
|
+
| **Threads** | 5 | Profiles, posts, keyword search, user search |
|
|
267
|
+
| **Pinterest** | 5 | Pins, boards, search, URL save-counts |
|
|
268
|
+
| **Amazon** | 5 | Product search, ASIN details, reviews, sellers, shop pages |
|
|
269
|
+
| **Rumble** | 5 | Search, channel videos, video details, comments, transcripts |
|
|
270
|
+
| **Twitch** | 4 | Profiles, clips, videos, schedules |
|
|
271
|
+
| **Hacker News** | 4 | Story search, story, comment tree, profile |
|
|
272
|
+
| **Tavily** | 4 | Web search (with LLM answer), URL extraction, sitemap, full crawl |
|
|
273
|
+
| **Google Shopping** | 4 | Product search, product details, cross-retailer reviews, sellers |
|
|
248
274
|
| **Truth Social** | 3 | Profiles, posts |
|
|
249
|
-
| **
|
|
275
|
+
| **Kwai** | 3 | Profiles, posts |
|
|
276
|
+
| **Bluesky** | 3 | Profiles, posts |
|
|
277
|
+
| **Trustpilot** | 2 | Business search, company reviews |
|
|
278
|
+
| **Tripadvisor** | 2 | Place search, traveler reviews |
|
|
250
279
|
| **Snapchat** | 1 | Profiles |
|
|
251
280
|
| **Kick** | 1 | Clips |
|
|
252
|
-
| **
|
|
281
|
+
| **Perplexity** | 1 | Sonar web research with cited sources |
|
|
282
|
+
| **Polymarket** | 1 | Prediction-market research — multi-query fan-out + ranking |
|
|
283
|
+
| **Universal Search** | 1 | One query, fanned out across 12+ platforms (20cr) |
|
|
253
284
|
| **Linktree** | 1 | Link pages |
|
|
254
285
|
| **Linkbio** | 1 | Link pages |
|
|
255
286
|
| **Linkme** | 1 | Link pages |
|
|
@@ -257,7 +288,7 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
|
|
|
257
288
|
| **Pillar** | 1 | Link pages |
|
|
258
289
|
| **Utility** | 1 | Age & gender detection |
|
|
259
290
|
|
|
260
|
-
**Total:
|
|
291
|
+
**Total: 221 endpoints across 39 platforms.**
|
|
261
292
|
|
|
262
293
|
## Error Handling
|
|
263
294
|
|
|
@@ -3,8 +3,8 @@ import { PLATFORMS, findPlatform, getAllPlatformSlugs } from "../data/platforms.
|
|
|
3
3
|
import { ENDPOINTS, findEndpoint, getEndpointsByPlatform } from "../data/endpoints.js";
|
|
4
4
|
import { getDoc, getAvailableTopics } from "../data/docs.js";
|
|
5
5
|
describe("Platform data integrity", () => {
|
|
6
|
-
it("has exactly
|
|
7
|
-
expect(PLATFORMS).toHaveLength(
|
|
6
|
+
it("has exactly 39 platforms", () => {
|
|
7
|
+
expect(PLATFORMS).toHaveLength(39);
|
|
8
8
|
});
|
|
9
9
|
it("every platform has a non-empty slug, name, and description", () => {
|
|
10
10
|
for (const platform of PLATFORMS) {
|
|
@@ -26,13 +26,13 @@ describe("Platform data integrity", () => {
|
|
|
26
26
|
it("findPlatform returns undefined for unknown slug", () => {
|
|
27
27
|
expect(findPlatform("nonexistent")).toBeUndefined();
|
|
28
28
|
});
|
|
29
|
-
it("getAllPlatformSlugs returns
|
|
30
|
-
expect(getAllPlatformSlugs()).toHaveLength(
|
|
29
|
+
it("getAllPlatformSlugs returns 39 slugs", () => {
|
|
30
|
+
expect(getAllPlatformSlugs()).toHaveLength(39);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
describe("Endpoint data integrity", () => {
|
|
34
|
-
it("has exactly
|
|
35
|
-
expect(ENDPOINTS.length).toBe(
|
|
34
|
+
it("has exactly 221 endpoints", () => {
|
|
35
|
+
expect(ENDPOINTS.length).toBe(221);
|
|
36
36
|
});
|
|
37
37
|
it("every endpoint has required fields", () => {
|
|
38
38
|
for (const endpoint of ENDPOINTS) {
|
|
@@ -40,7 +40,9 @@ describe("Endpoint data integrity", () => {
|
|
|
40
40
|
expect(endpoint.resource).toBeTruthy();
|
|
41
41
|
expect(endpoint.method).toBe("GET");
|
|
42
42
|
expect(["standard", "advanced", "premium"]).toContain(endpoint.creditTier);
|
|
43
|
-
|
|
43
|
+
// 20 is the flat-cost override for /v1/search/everywhere; every other
|
|
44
|
+
// endpoint follows the standard 1/5/10 ladder.
|
|
45
|
+
expect([1, 5, 10, 20]).toContain(endpoint.creditCost);
|
|
44
46
|
expect(endpoint.archetype).toBeTruthy();
|
|
45
47
|
expect(endpoint.summary).toBeTruthy();
|
|
46
48
|
}
|
|
@@ -48,6 +50,11 @@ describe("Endpoint data integrity", () => {
|
|
|
48
50
|
it("creditCost matches creditTier", () => {
|
|
49
51
|
const tierCosts = { standard: 1, advanced: 5, premium: 10 };
|
|
50
52
|
for (const endpoint of ENDPOINTS) {
|
|
53
|
+
// Universal-search endpoint overrides the tier ladder with a flat 20.
|
|
54
|
+
if (endpoint.platform === "search" && endpoint.resource === "everywhere") {
|
|
55
|
+
expect(endpoint.creditCost).toBe(20);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
51
58
|
expect(endpoint.creditCost).toBe(tierCosts[endpoint.creditTier]);
|
|
52
59
|
}
|
|
53
60
|
});
|
|
@@ -76,8 +83,9 @@ describe("Endpoint data integrity", () => {
|
|
|
76
83
|
const ep = findEndpoint("tiktok", "profile");
|
|
77
84
|
expect(ep).toBeDefined();
|
|
78
85
|
expect(ep.archetype).toBe("Author");
|
|
79
|
-
|
|
80
|
-
expect(ep.
|
|
86
|
+
// handle/user_id are a oneOf group: at least one must be provided.
|
|
87
|
+
expect(ep.oneOfGroups).toEqual([["handle", "user_id"]]);
|
|
88
|
+
expect(ep.optionalParams.map((p) => p.name)).toContain("handle");
|
|
81
89
|
});
|
|
82
90
|
it("findEndpoint returns undefined for unknown resource", () => {
|
|
83
91
|
expect(findEndpoint("tiktok", "nonexistent")).toBeUndefined();
|
|
@@ -136,11 +144,30 @@ describe("Documentation data integrity", () => {
|
|
|
136
144
|
it("getDoc returns undefined for unknown topic", () => {
|
|
137
145
|
expect(getDoc("nonexistent")).toBeUndefined();
|
|
138
146
|
});
|
|
139
|
-
it("getAvailableTopics returns
|
|
140
|
-
expect(getAvailableTopics()
|
|
147
|
+
it("getAvailableTopics returns 7 fixed topics + one per platform", () => {
|
|
148
|
+
expect(getAvailableTopics()).toHaveLength(7 + PLATFORMS.length);
|
|
141
149
|
});
|
|
142
|
-
it("getAvailableTopics includes the
|
|
150
|
+
it("getAvailableTopics includes the idempotency and pricing topics", () => {
|
|
143
151
|
expect(getAvailableTopics()).toContain("idempotency");
|
|
152
|
+
expect(getAvailableTopics()).toContain("pricing");
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
describe("Pricing documentation", () => {
|
|
156
|
+
it("has a pricing topic", () => {
|
|
157
|
+
expect(getDoc("pricing")).toBeTruthy();
|
|
158
|
+
});
|
|
159
|
+
it("lists every endpoint with its credit cost", () => {
|
|
160
|
+
const pricing = getDoc("pricing");
|
|
161
|
+
for (const e of ENDPOINTS) {
|
|
162
|
+
expect(pricing, `pricing doc missing /v1/${e.platform}/${e.resource}`).toContain(`| \`GET /v1/${e.platform}/${e.resource}\` | ${e.creditCost}cr | ${e.creditTier} |`);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
it("documents the flat 20-credit override for search/everywhere", () => {
|
|
166
|
+
const pricing = getDoc("pricing");
|
|
167
|
+
expect(pricing).toContain("| flat override | 20 credits | `/v1/search/everywhere` |");
|
|
168
|
+
});
|
|
169
|
+
it("stays under the 25k truncation limit so it is never cut off", () => {
|
|
170
|
+
expect(getDoc("pricing").length).toBeLessThanOrEqual(25_000);
|
|
144
171
|
});
|
|
145
172
|
});
|
|
146
173
|
describe("Errors documentation reflects 2026-04-17 backend", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-integrity.test.js","sourceRoot":"","sources":["../../src/__tests__/data-integrity.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAQ,MAAM,EAAE,k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C,EAAE,GAAG,EAAE;QACrD,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAE,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAE,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ describe("Pre-flight validation", () => {
|
|
|
21
21
|
expect(result).toContain("Missing required parameter");
|
|
22
22
|
});
|
|
23
23
|
it("passes validation for endpoints with no required params", async () => {
|
|
24
|
-
const result = await request({ platform: "
|
|
24
|
+
const result = await request({ platform: "youtube", resource: "shorts/trending" });
|
|
25
25
|
expect(result).toContain("No API key configured");
|
|
26
26
|
});
|
|
27
27
|
it("rejects oneOf endpoint when no group member is provided", async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.test.js","sourceRoot":"","sources":["../../src/__tests__/preflight.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,QAAQ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AAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export declare const CHARACTER_LIMIT = 25000;
|
|
|
2
2
|
export declare const TIMEOUT_MS = 30000;
|
|
3
3
|
export declare const CREDIT_COSTS: Record<string, number>;
|
|
4
4
|
export declare const SERVER_NAME = "socialcrawl-mcp";
|
|
5
|
-
export declare const SERVER_VERSION = "1.
|
|
5
|
+
export declare const SERVER_VERSION = "1.4.0";
|
package/dist/constants.js
CHANGED
package/dist/data/docs.js
CHANGED
|
@@ -8,7 +8,7 @@ import { ENDPOINTS, getEndpointsByPlatform } from "./endpoints.js";
|
|
|
8
8
|
const HANDWRITTEN = {
|
|
9
9
|
overview: `# SocialCrawl API
|
|
10
10
|
|
|
11
|
-
Unified social media data API. One API key, one response format,
|
|
11
|
+
Unified social media data API. One API key, one response format, ${PLATFORMS.length} platforms, ${ENDPOINTS.length} endpoints — social media, commerce & product reviews, app stores, places & travel, business reputation, web research, prediction markets, Korean search (Naver), content/sentiment analysis, and universal meta-search.
|
|
12
12
|
|
|
13
13
|
## Base URL
|
|
14
14
|
|
|
@@ -27,8 +27,9 @@ ${PLATFORMS.map((p) => `- ${p.slug} (${p.endpointCount} endpoint${p.endpointCoun
|
|
|
27
27
|
- Standard: 1 credit per request
|
|
28
28
|
- Advanced: 5 credits per request
|
|
29
29
|
- Premium: 10 credits per request
|
|
30
|
+
- Flat overrides: \`GET /v1/search/everywhere\` costs a flat 20 credits
|
|
30
31
|
|
|
31
|
-
Most endpoints cost 1 credit (standard tier). Heavier endpoints (trending feeds, audience analytics, ad transparency, AI-powered utilities) cost 5 or 10.
|
|
32
|
+
Most endpoints cost 1 credit (standard tier). Heavier endpoints (trending feeds, audience analytics, ad transparency, commerce/app-store data, content analysis, AI-powered utilities) cost 5 or 10. Use the \`pricing\` docs topic for the cost of every individual endpoint.
|
|
32
33
|
|
|
33
34
|
## Meta Endpoints
|
|
34
35
|
|
|
@@ -74,9 +75,13 @@ Every request costs credits. The MCP server pre-calculates cost from the endpoin
|
|
|
74
75
|
|
|
75
76
|
| Tier | Cost per request | Typical use |
|
|
76
77
|
|------|------------------|-------------|
|
|
77
|
-
| standard | 1 credit | Profile, post, comment, search endpoints |
|
|
78
|
-
| advanced | 5 credits | Trending feeds, audience analytics, ad transparency |
|
|
79
|
-
| premium | 10 credits | AI-powered utilities (
|
|
78
|
+
| standard | 1 credit | Profile, post, comment, and search endpoints; static reference data (app-store categories/locations/languages) |
|
|
79
|
+
| advanced | 5 credits | Trending feeds, audience analytics, ad transparency, GitHub composites, Polymarket research, Amazon/Google Shopping product detail, Trustpilot reviews, Google Business reviews/Q&A, hotel details, app-store search/info/reviews/charts, content-analysis aggregates |
|
|
80
|
+
| premium | 10 credits | AI-powered utilities (transcript generation, age/gender detection, GitHub user/profile-velocity) and the app-store listings-search database (Google Play / App Store \`app-listings-search\`) |
|
|
81
|
+
|
|
82
|
+
A single endpoint overrides this ladder: \`GET /v1/search/everywhere\` (universal meta-search) costs a flat **20 credits** because it fans out across 12+ platforms in parallel.
|
|
83
|
+
|
|
84
|
+
For the exact cost of every endpoint, use the \`pricing\` docs topic — it lists all ${ENDPOINTS.length} endpoints with their per-request cost. \`socialcrawl_list_endpoints\` also shows the cost per endpoint for a single platform, and \`socialcrawl_request\` echoes the cost in its response header.
|
|
80
85
|
|
|
81
86
|
## Caching
|
|
82
87
|
|
|
@@ -236,6 +241,50 @@ function buildEndpointBlock(e) {
|
|
|
236
241
|
lines.push("```");
|
|
237
242
|
return lines.join("\n");
|
|
238
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Per-endpoint pricing reference, generated from ENDPOINTS so it can never
|
|
246
|
+
* drift from the registry-derived data. Tier counts, overrides, and the
|
|
247
|
+
* full per-platform cost table are all computed.
|
|
248
|
+
*/
|
|
249
|
+
function buildPricingDoc() {
|
|
250
|
+
const tierCounts = { standard: 0, advanced: 0, premium: 0 };
|
|
251
|
+
const overrides = [];
|
|
252
|
+
for (const e of ENDPOINTS) {
|
|
253
|
+
tierCounts[e.creditTier] += 1;
|
|
254
|
+
const ladder = { standard: 1, advanced: 5, premium: 10 }[e.creditTier];
|
|
255
|
+
if (e.creditCost !== ladder)
|
|
256
|
+
overrides.push(e);
|
|
257
|
+
}
|
|
258
|
+
const lines = [
|
|
259
|
+
"# SocialCrawl API — Per-Endpoint Pricing",
|
|
260
|
+
"",
|
|
261
|
+
`Every one of the ${ENDPOINTS.length} endpoints is billed in credits per request. Three tiers plus flat per-endpoint overrides:`,
|
|
262
|
+
"",
|
|
263
|
+
"| Tier | Cost | Endpoints |",
|
|
264
|
+
"|------|------|-----------|",
|
|
265
|
+
`| standard | 1 credit | ${tierCounts.standard} |`,
|
|
266
|
+
`| advanced | 5 credits | ${tierCounts.advanced} |`,
|
|
267
|
+
`| premium | 10 credits | ${tierCounts.premium} |`,
|
|
268
|
+
...overrides.map((e) => `| flat override | ${e.creditCost} credits | \`/v1/${e.platform}/${e.resource}\` |`),
|
|
269
|
+
"",
|
|
270
|
+
"Cache hits, idempotent replays, and `GET /v1/credits/balance` cost 0 credits. Empty upstream results (404 RESOURCE_NOT_FOUND), upstream errors (502), circuit-breaker rejections (503), and internal errors (500) are auto-refunded — see the `credits` topic.",
|
|
271
|
+
"",
|
|
272
|
+
"## Cost per endpoint",
|
|
273
|
+
"",
|
|
274
|
+
];
|
|
275
|
+
for (const platform of PLATFORMS) {
|
|
276
|
+
const endpoints = getEndpointsByPlatform(platform.slug);
|
|
277
|
+
lines.push(`### ${platform.name} (\`${platform.slug}\`)`);
|
|
278
|
+
lines.push("");
|
|
279
|
+
lines.push("| Endpoint | Cost | Tier |");
|
|
280
|
+
lines.push("|----------|------|------|");
|
|
281
|
+
for (const e of endpoints) {
|
|
282
|
+
lines.push(`| \`GET /v1/${e.platform}/${e.resource}\` | ${e.creditCost}cr | ${e.creditTier} |`);
|
|
283
|
+
}
|
|
284
|
+
lines.push("");
|
|
285
|
+
}
|
|
286
|
+
return lines.join("\n");
|
|
287
|
+
}
|
|
239
288
|
function buildPlatformDoc(slug) {
|
|
240
289
|
const platform = PLATFORMS.find((p) => p.slug === slug);
|
|
241
290
|
if (!platform)
|
|
@@ -314,6 +363,7 @@ export const DOCS = (() => {
|
|
|
314
363
|
credits: HANDWRITTEN.credits,
|
|
315
364
|
errors: HANDWRITTEN.errors,
|
|
316
365
|
idempotency: HANDWRITTEN.idempotency,
|
|
366
|
+
pricing: buildPricingDoc(),
|
|
317
367
|
full: buildFullDoc(),
|
|
318
368
|
};
|
|
319
369
|
for (const platform of PLATFORMS) {
|
|
@@ -332,9 +382,8 @@ export function getAvailableTopics() {
|
|
|
332
382
|
"credits",
|
|
333
383
|
"errors",
|
|
334
384
|
"idempotency",
|
|
385
|
+
"pricing",
|
|
335
386
|
...PLATFORMS.map((p) => p.slug),
|
|
336
387
|
];
|
|
337
388
|
}
|
|
338
|
-
// Silence unused-import warning if tree-shakers ever prune the re-read of ENDPOINTS.
|
|
339
|
-
void ENDPOINTS;
|
|
340
389
|
//# sourceMappingURL=docs.js.map
|