socialscrape-cli 0.1.0__tar.gz
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.
- socialscrape_cli-0.1.0/LICENSE +21 -0
- socialscrape_cli-0.1.0/MANIFEST.in +2 -0
- socialscrape_cli-0.1.0/PKG-INFO +76 -0
- socialscrape_cli-0.1.0/README.md +63 -0
- socialscrape_cli-0.1.0/pyproject.toml +26 -0
- socialscrape_cli-0.1.0/setup.cfg +4 -0
- socialscrape_cli-0.1.0/socialscrape_cli/__init__.py +3 -0
- socialscrape_cli-0.1.0/socialscrape_cli/__main__.py +5 -0
- socialscrape_cli-0.1.0/socialscrape_cli/catalog.json +18929 -0
- socialscrape_cli-0.1.0/socialscrape_cli/catalog.py +166 -0
- socialscrape_cli-0.1.0/socialscrape_cli/cli.py +689 -0
- socialscrape_cli-0.1.0/socialscrape_cli/client.py +104 -0
- socialscrape_cli-0.1.0/socialscrape_cli/config.py +40 -0
- socialscrape_cli-0.1.0/socialscrape_cli/table.py +76 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/PKG-INFO +76 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/SOURCES.txt +18 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/dependency_links.txt +1 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/entry_points.txt +2 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/requires.txt +1 -0
- socialscrape_cli-0.1.0/socialscrape_cli.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Casey Company LLC (SocialScrape)
|
|
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.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: socialscrape-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SocialScrape on the command line: social media data as JSON or a table
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://socialscrape.dev
|
|
7
|
+
Project-URL: Documentation, https://socialscrape.dev/docs
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: httpx<1,>=0.27
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# socialscrape-cli
|
|
15
|
+
|
|
16
|
+
`socialscrape`: social media data on the command line, as JSON for scripts and agents or a
|
|
17
|
+
table for people. Python 3.10+, one dependency (`httpx`).
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install socialscrape-cli # or: pipx install socialscrape-cli
|
|
21
|
+
socialscrape login # paste your key once (saved to ~/.config/socialscrape/config.json, mode 600)
|
|
22
|
+
|
|
23
|
+
socialscrape github user torvalds
|
|
24
|
+
socialscrape transcript "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
|
25
|
+
socialscrape search threads "open source" -o table
|
|
26
|
+
socialscrape threads profile-posts zuck --pages 3
|
|
27
|
+
socialscrape ad-libraries facebook-search nike --region US --all --max-credits 5
|
|
28
|
+
socialscrape credits
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The CLI reads the same endpoint catalog as the `socialscrape-mcp` server, so a platform appears here
|
|
32
|
+
in the release after its endpoints are built. It uses plain `httpx` and needs no other SocialScrape package.
|
|
33
|
+
|
|
34
|
+
## Commands
|
|
35
|
+
|
|
36
|
+
| | |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `socialscrape <platform> <resource> [value] [--param value]` | Any endpoint. `socialscrape github --help` lists a platform's resources, `socialscrape github user --help` the parameters. Resource names use hyphens: `profile.posts` is `profile-posts` (dots and underscores also work). |
|
|
39
|
+
| `transcript URL` | Transcript of a video or post on any supported platform. |
|
|
40
|
+
| `profile`, `post`, `comments`, `search PLATFORM VALUE` | The same job on any platform that has it (`search` takes `--kind`). Shortcuts for `<platform> <resource>`. |
|
|
41
|
+
| `credits`, `usage [daily\|routes]`, `job ID` | Balance, request history, an async job. All free. |
|
|
42
|
+
| `batch FILE\|-` | Up to 100 requests in one call from JSON: `[{"endpoint": "github.user", "params": {"handle": "torvalds"}}]`. |
|
|
43
|
+
| `monitors list\|create\|delete\|test\|deliveries\|events\|redeliver` | Webhook monitors. |
|
|
44
|
+
| `endpoints [PLATFORM]` | What can be called. |
|
|
45
|
+
| `login`, `logout`, `config` | Save, remove, show (masked) the key. |
|
|
46
|
+
|
|
47
|
+
The positional `value` is the resource's main parameter; the form is detected (a URL goes to `url`,
|
|
48
|
+
anything else to `handle`, `id` or `query`). Every parameter is also a flag (`--handle`, `--url`,
|
|
49
|
+
`--sort`, `--limit`, `--region`, ...), with the API's aliases (`--username`).
|
|
50
|
+
|
|
51
|
+
## Output
|
|
52
|
+
|
|
53
|
+
* stdout is data only: pretty JSON on a terminal, compact JSON in a pipe. `-o table` and `-o ndjson`
|
|
54
|
+
(one item per line) change the format; `--envelope` prints the whole response (`data`,
|
|
55
|
+
`credits_charged`, `cursor`, ...); `--raw` asks for the platform's original object (`raw=true`)
|
|
56
|
+
and prints the whole response.
|
|
57
|
+
* stderr carries the price: `credits charged: 1 | remaining: 4999`. `-q` silences it.
|
|
58
|
+
* `--dry-run` prints the request and what it would cost and sends nothing (no key needed).
|
|
59
|
+
|
|
60
|
+
## Paging
|
|
61
|
+
|
|
62
|
+
`--pages N` follows the cursor up to N pages; `--all` follows it to the end (cap `--max-pages`,
|
|
63
|
+
default 50). Each page costs credits, so bound it: `--max-items N`, `--max-credits N`. The merged
|
|
64
|
+
result is one list with every item; if a later page fails you still get the earlier ones.
|
|
65
|
+
|
|
66
|
+
## Exit codes
|
|
67
|
+
|
|
68
|
+
`0` ok, `1` API error (not found, private, invalid parameters, ...), `2` usage error (nothing was
|
|
69
|
+
sent, nothing charged), `3` key or credits (`unauthorized`, `forbidden`, `insufficient_credits`),
|
|
70
|
+
`4` retryable (rate limited, upstream blocked or timed out, network). Failures are free.
|
|
71
|
+
|
|
72
|
+
## Key and server
|
|
73
|
+
|
|
74
|
+
The key comes from `--key`, then `$SOCIALSCRAPE_API_KEY`, then the saved config. `login` checks the
|
|
75
|
+
key against the API before it saves anything. `--api-url` or `$SOCIALSCRAPE_API_URL` points at another
|
|
76
|
+
server (default `https://api.socialscrape.dev`).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# socialscrape-cli
|
|
2
|
+
|
|
3
|
+
`socialscrape`: social media data on the command line, as JSON for scripts and agents or a
|
|
4
|
+
table for people. Python 3.10+, one dependency (`httpx`).
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
pip install socialscrape-cli # or: pipx install socialscrape-cli
|
|
8
|
+
socialscrape login # paste your key once (saved to ~/.config/socialscrape/config.json, mode 600)
|
|
9
|
+
|
|
10
|
+
socialscrape github user torvalds
|
|
11
|
+
socialscrape transcript "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
|
12
|
+
socialscrape search threads "open source" -o table
|
|
13
|
+
socialscrape threads profile-posts zuck --pages 3
|
|
14
|
+
socialscrape ad-libraries facebook-search nike --region US --all --max-credits 5
|
|
15
|
+
socialscrape credits
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The CLI reads the same endpoint catalog as the `socialscrape-mcp` server, so a platform appears here
|
|
19
|
+
in the release after its endpoints are built. It uses plain `httpx` and needs no other SocialScrape package.
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
| | |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `socialscrape <platform> <resource> [value] [--param value]` | Any endpoint. `socialscrape github --help` lists a platform's resources, `socialscrape github user --help` the parameters. Resource names use hyphens: `profile.posts` is `profile-posts` (dots and underscores also work). |
|
|
26
|
+
| `transcript URL` | Transcript of a video or post on any supported platform. |
|
|
27
|
+
| `profile`, `post`, `comments`, `search PLATFORM VALUE` | The same job on any platform that has it (`search` takes `--kind`). Shortcuts for `<platform> <resource>`. |
|
|
28
|
+
| `credits`, `usage [daily\|routes]`, `job ID` | Balance, request history, an async job. All free. |
|
|
29
|
+
| `batch FILE\|-` | Up to 100 requests in one call from JSON: `[{"endpoint": "github.user", "params": {"handle": "torvalds"}}]`. |
|
|
30
|
+
| `monitors list\|create\|delete\|test\|deliveries\|events\|redeliver` | Webhook monitors. |
|
|
31
|
+
| `endpoints [PLATFORM]` | What can be called. |
|
|
32
|
+
| `login`, `logout`, `config` | Save, remove, show (masked) the key. |
|
|
33
|
+
|
|
34
|
+
The positional `value` is the resource's main parameter; the form is detected (a URL goes to `url`,
|
|
35
|
+
anything else to `handle`, `id` or `query`). Every parameter is also a flag (`--handle`, `--url`,
|
|
36
|
+
`--sort`, `--limit`, `--region`, ...), with the API's aliases (`--username`).
|
|
37
|
+
|
|
38
|
+
## Output
|
|
39
|
+
|
|
40
|
+
* stdout is data only: pretty JSON on a terminal, compact JSON in a pipe. `-o table` and `-o ndjson`
|
|
41
|
+
(one item per line) change the format; `--envelope` prints the whole response (`data`,
|
|
42
|
+
`credits_charged`, `cursor`, ...); `--raw` asks for the platform's original object (`raw=true`)
|
|
43
|
+
and prints the whole response.
|
|
44
|
+
* stderr carries the price: `credits charged: 1 | remaining: 4999`. `-q` silences it.
|
|
45
|
+
* `--dry-run` prints the request and what it would cost and sends nothing (no key needed).
|
|
46
|
+
|
|
47
|
+
## Paging
|
|
48
|
+
|
|
49
|
+
`--pages N` follows the cursor up to N pages; `--all` follows it to the end (cap `--max-pages`,
|
|
50
|
+
default 50). Each page costs credits, so bound it: `--max-items N`, `--max-credits N`. The merged
|
|
51
|
+
result is one list with every item; if a later page fails you still get the earlier ones.
|
|
52
|
+
|
|
53
|
+
## Exit codes
|
|
54
|
+
|
|
55
|
+
`0` ok, `1` API error (not found, private, invalid parameters, ...), `2` usage error (nothing was
|
|
56
|
+
sent, nothing charged), `3` key or credits (`unauthorized`, `forbidden`, `insufficient_credits`),
|
|
57
|
+
`4` retryable (rate limited, upstream blocked or timed out, network). Failures are free.
|
|
58
|
+
|
|
59
|
+
## Key and server
|
|
60
|
+
|
|
61
|
+
The key comes from `--key`, then `$SOCIALSCRAPE_API_KEY`, then the saved config. `login` checks the
|
|
62
|
+
key against the API before it saves anything. `--api-url` or `$SOCIALSCRAPE_API_URL` points at another
|
|
63
|
+
server (default `https://api.socialscrape.dev`).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "socialscrape-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "SocialScrape on the command line: social media data as JSON or a table"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
dependencies = ["httpx>=0.27,<1"]
|
|
14
|
+
|
|
15
|
+
[project.urls]
|
|
16
|
+
Homepage = "https://socialscrape.dev"
|
|
17
|
+
Documentation = "https://socialscrape.dev/docs"
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
socialscrape = "socialscrape_cli.cli:main"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools]
|
|
23
|
+
packages = ["socialscrape_cli"]
|
|
24
|
+
|
|
25
|
+
[tool.setuptools.package-data]
|
|
26
|
+
socialscrape_cli = ["catalog.json"]
|