@scrapecreators/cli 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/README.md +241 -0
- package/api-config/apis.js +14559 -0
- package/api-config/instagram-apis.js +5753 -0
- package/api-config/tiktok-apis.js +17388 -0
- package/api-config/tiktok-shop-apis.js +1053 -0
- package/bin/check-lockfile-sync.js +42 -0
- package/bin/scrapecreators.js +4 -0
- package/package.json +48 -0
- package/src/api-client.js +71 -0
- package/src/auth.js +27 -0
- package/src/cli.js +78 -0
- package/src/command-registry.js +156 -0
- package/src/commands/agent.js +311 -0
- package/src/commands/api.js +49 -0
- package/src/commands/auth.js +69 -0
- package/src/commands/balance.js +40 -0
- package/src/commands/config.js +65 -0
- package/src/commands/list.js +52 -0
- package/src/config.js +23 -0
- package/src/interactive.js +148 -0
- package/src/output.js +400 -0
package/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# ScrapeCreators CLI
|
|
2
|
+
|
|
3
|
+
CLI for the [ScrapeCreators API](https://scrapecreators.com) — scrape 27+ social media platforms from the terminal or as an MCP server for AI agents.
|
|
4
|
+
|
|
5
|
+
110+ endpoints. One command.
|
|
6
|
+
|
|
7
|
+
[Documentation](https://docs.scrapecreators.com/) | [OpenAPI Spec](https://docs.scrapecreators.com/openapi.json) | [Get API Key](https://app.scrapecreators.com)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @scrapecreators/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or run without installing:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @scrapecreators/cli tiktok profile --handle charlidamelio --api-key YOUR_KEY
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
1. Get your API key at [app.scrapecreators.com](https://app.scrapecreators.com)
|
|
24
|
+
|
|
25
|
+
2. Authenticate:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
scrapecreators auth login
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
3. Make your first request:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
scrapecreators tiktok profile --handle charlidamelio
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. Explore what's available:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
scrapecreators list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Authentication
|
|
44
|
+
|
|
45
|
+
Three ways to authenticate, in priority order:
|
|
46
|
+
|
|
47
|
+
| Priority | Method | Example |
|
|
48
|
+
|----------|--------|---------|
|
|
49
|
+
| 1 | `--api-key` flag | `scrapecreators tiktok profile --handle x --api-key YOUR_KEY` |
|
|
50
|
+
| 2 | Stored config | `scrapecreators auth login` (saves to `~/.config/scrapecreators/`) |
|
|
51
|
+
| 3 | Environment variable | `export SCRAPECREATORS_API_KEY=YOUR_KEY` |
|
|
52
|
+
|
|
53
|
+
> **Security note:** The `--api-key` flag is visible in shell history and process lists. For persistent use, prefer `scrapecreators auth login` or the environment variable. In CI/automated pipelines, always use the environment variable.
|
|
54
|
+
|
|
55
|
+
Get your API key at [app.scrapecreators.com](https://app.scrapecreators.com).
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
Every API endpoint is a subcommand under its platform:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
scrapecreators <platform> <action> [--params]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Examples:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# profiles
|
|
69
|
+
scrapecreators instagram profile --handle jane
|
|
70
|
+
scrapecreators tiktok profile --handle charlidamelio
|
|
71
|
+
scrapecreators youtube channel --handle ThePatMcAfeeShow
|
|
72
|
+
|
|
73
|
+
# content feeds
|
|
74
|
+
scrapecreators tiktok profile-videos --handle charlidamelio --sort-by popular
|
|
75
|
+
scrapecreators instagram user-posts --handle jane
|
|
76
|
+
scrapecreators instagram user-reels --handle jane
|
|
77
|
+
|
|
78
|
+
# single post/video
|
|
79
|
+
scrapecreators instagram post --url "https://www.instagram.com/reel/DOq6eV6iIgD"
|
|
80
|
+
scrapecreators tiktok video --url "https://www.tiktok.com/@user/video/123"
|
|
81
|
+
|
|
82
|
+
# search
|
|
83
|
+
scrapecreators youtube search --query "tutorials"
|
|
84
|
+
scrapecreators instagram reels-search --query "dogs"
|
|
85
|
+
scrapecreators reddit search --query "best programming languages"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For the full list of 110+ endpoints across 27+ platforms, see the [API documentation](https://docs.scrapecreators.com/) or the [OpenAPI spec](https://docs.scrapecreators.com/openapi.json).
|
|
89
|
+
|
|
90
|
+
### Discover Endpoints
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# list all platforms
|
|
94
|
+
scrapecreators list
|
|
95
|
+
|
|
96
|
+
# list endpoints for a specific platform
|
|
97
|
+
scrapecreators list tiktok
|
|
98
|
+
|
|
99
|
+
# see full help for any endpoint
|
|
100
|
+
scrapecreators tiktok profile --help
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Interactive Mode
|
|
104
|
+
|
|
105
|
+
Run with no arguments to get a guided walkthrough:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
scrapecreators
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Walks you through: pick platform -> pick action -> fill params -> execute.
|
|
112
|
+
|
|
113
|
+
## Commands Reference
|
|
114
|
+
|
|
115
|
+
| Command | Description |
|
|
116
|
+
|---------|-------------|
|
|
117
|
+
| `scrapecreators <platform> <action>` | Call any API endpoint |
|
|
118
|
+
| `scrapecreators list [platform]` | List available platforms or endpoints |
|
|
119
|
+
| `scrapecreators auth login` | Set your API key (interactive) |
|
|
120
|
+
| `scrapecreators auth status` | Show current auth status |
|
|
121
|
+
| `scrapecreators auth logout` | Remove stored API key |
|
|
122
|
+
| `scrapecreators balance` | Check credit balance |
|
|
123
|
+
| `scrapecreators config set <key> <value>` | Set a config value |
|
|
124
|
+
| `scrapecreators config get <key>` | Get a config value |
|
|
125
|
+
| `scrapecreators config list` | Show all config values |
|
|
126
|
+
| `scrapecreators agent add <target>` | Write MCP config into an agent (`cursor`, `claude`, `codex`) |
|
|
127
|
+
|
|
128
|
+
Run any command with `--help` for full usage details.
|
|
129
|
+
|
|
130
|
+
## Output & Options
|
|
131
|
+
|
|
132
|
+
The CLI auto-detects whether output goes to a terminal or a pipe:
|
|
133
|
+
|
|
134
|
+
| Context | Default | Override |
|
|
135
|
+
|---------|---------|----------|
|
|
136
|
+
| Any | Compact JSON | `--pretty`, `--format table\|csv\|markdown` |
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# default: compact JSON
|
|
140
|
+
scrapecreators tiktok profile --handle charlidamelio
|
|
141
|
+
|
|
142
|
+
# pretty-printed JSON
|
|
143
|
+
scrapecreators tiktok profile --handle charlidamelio --pretty
|
|
144
|
+
|
|
145
|
+
# pipe to jq
|
|
146
|
+
scrapecreators tiktok profile --handle charlidamelio | jq '.stats'
|
|
147
|
+
|
|
148
|
+
# table format
|
|
149
|
+
scrapecreators tiktok profile --handle charlidamelio --format table
|
|
150
|
+
|
|
151
|
+
# csv (full dump — all fields)
|
|
152
|
+
scrapecreators tiktok profile --handle charlidamelio --format csv > output.csv
|
|
153
|
+
|
|
154
|
+
# csv clean (noisy fields removed — spreadsheet-friendly)
|
|
155
|
+
scrapecreators tiktok profile --handle charlidamelio --format csv --clean > output.csv
|
|
156
|
+
|
|
157
|
+
# clean json (strips booleans, empty values, settings)
|
|
158
|
+
scrapecreators tiktok profile --handle charlidamelio --clean
|
|
159
|
+
|
|
160
|
+
# save to file, print only the file path
|
|
161
|
+
scrapecreators tiktok profile-videos --handle charlidamelio --output ./data.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
All status messages (spinners, warnings) go to **stderr**. Data goes to **stdout**. Safe for piping.
|
|
165
|
+
|
|
166
|
+
| Flag | Description |
|
|
167
|
+
|------|-------------|
|
|
168
|
+
| `--api-key <key>` | Override API key for this request |
|
|
169
|
+
| `--format <fmt>` | Output format: `json`, `table`, `csv`, `markdown` |
|
|
170
|
+
| `--json` | Compact JSON (default) |
|
|
171
|
+
| `--pretty` | Pretty-print JSON with indentation |
|
|
172
|
+
| `--output <path>` | Save response to file, print only the path |
|
|
173
|
+
| `--clean` | Strip noisy fields (booleans, empty values, settings). Works with any format |
|
|
174
|
+
| `--no-color` | Disable ANSI colors |
|
|
175
|
+
| `--verbose` | Show request URL, timing, status code |
|
|
176
|
+
|
|
177
|
+
## AI Agent Integration
|
|
178
|
+
|
|
179
|
+
The CLI is designed agent-first. All 110+ endpoints are also available as an [MCP server](https://api.scrapecreators.com/mcp) — no CLI installation required for agents.
|
|
180
|
+
|
|
181
|
+
### MCP Server
|
|
182
|
+
|
|
183
|
+
Add to your agent's MCP config manually:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"mcpServers": {
|
|
188
|
+
"scrapecreators": {
|
|
189
|
+
"url": "https://api.scrapecreators.com/mcp",
|
|
190
|
+
"headers": { "x-api-key": "your-key-here" }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Or auto-configure with the CLI:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
scrapecreators agent add cursor # writes .cursor/mcp.json
|
|
200
|
+
scrapecreators agent add claude # writes ~/.claude/claude_desktop_config.json
|
|
201
|
+
scrapecreators agent add codex # writes ~/.codex/mcp.json
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Merges into existing config without overwriting other MCP servers. Prompts for API key if not already stored.
|
|
205
|
+
|
|
206
|
+
### Agent Skill
|
|
207
|
+
|
|
208
|
+
Install the [ScrapeCreators agent skill](https://github.com/scrapecreators/agent-skills) to teach agents how to pick the right endpoint, handle pagination, and manage credits:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npx skills add scrapecreators/agent-skills
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Works with Cursor, Claude Code, Codex, GitHub Copilot, Gemini CLI, Windsurf, and 40+ other agents.
|
|
215
|
+
|
|
216
|
+
### Agent-Optimized Output
|
|
217
|
+
|
|
218
|
+
The default output is already compact JSON — no extra flags needed. To reduce further:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# --clean: strip booleans, empty values, settings (keeps urls and stats)
|
|
222
|
+
scrapecreators tiktok profile --handle x --clean
|
|
223
|
+
|
|
224
|
+
# --output: save to file, return only the path
|
|
225
|
+
# agent can then read specific parts of the file instead of consuming the full response
|
|
226
|
+
scrapecreators tiktok profile-videos --handle x --clean --output ./data.json
|
|
227
|
+
# stdout: ./data.json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Structured errors for agents:
|
|
231
|
+
```json
|
|
232
|
+
{"error":true,"code":"HTTP_401","message":"...","suggestion":"Run 'scrapecreators auth login'..."}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Known Limitations
|
|
236
|
+
|
|
237
|
+
- **Handles**: pass without `@`. Use `charlidamelio` not `@charlidamelio`
|
|
238
|
+
- **Hashtags**: pass without `#`. Use `fyp` not `#fyp`
|
|
239
|
+
- **Transcripts**: video must be under 2 minutes
|
|
240
|
+
|
|
241
|
+
See the [API documentation](https://docs.scrapecreators.com/) for platform-specific limits and pagination details.
|