mobbin 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tomas Roda
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.
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # Mobbin CLI
2
+
3
+ Small Node.js CLI + SDK for calling Mobbin's JSON endpoints under `https://mobbin.com/api/*`.
4
+
5
+ Some endpoints are public, others require an authenticated `mobbin.com` session cookie.
6
+
7
+ ## Requirements
8
+
9
+ - Node.js `>=18` (uses built-in `fetch`)
10
+
11
+ ## Quickstart (run from this repo)
12
+
13
+ ```bash
14
+ ./mobbin-cli.js --help
15
+ ./mobbin-cli.js trending-apps --platform ios
16
+ ./mobbin-cli.js trending-sites
17
+ ./mobbin-cli.js searchable-apps --platform web
18
+ ```
19
+
20
+ ## Install As `mobbin` (recommended)
21
+
22
+ This repo includes a `package.json` with a `bin` entry, so you can link it once and then use `mobbin` anywhere.
23
+
24
+ ```bash
25
+ cd /path/to/tools/mobbin
26
+ npm link
27
+
28
+ mobbin --help
29
+ mobbin trending-apps --platform ios
30
+ ```
31
+
32
+ If you do not want to use `npm link`, a simple shell alias also works:
33
+
34
+ ```bash
35
+ alias mobbin="/path/to/tools/mobbin/mobbin-cli.js"
36
+ mobbin trending-sites
37
+ ```
38
+
39
+ ## Authentication (cookies)
40
+
41
+ Auth-gated endpoints require a valid `mobbin.com` session cookie.
42
+
43
+ The CLI will try to find cookies automatically for auth-gated commands:
44
+
45
+ - `MOBBIN_COOKIE` / `--cookie`
46
+ - `MOBBIN_COOKIE_FILE` / `--cookie-file`
47
+ - Common local files like `~/.config/mobbin/cookie.txt`
48
+ - macOS only: local browser cookie stores (Safari, Chrome, Edge, Brave, Chromium)
49
+ - If run in a TTY and no cookies are found for an auth-gated command, the CLI will open `mobbin.com` and prompt you to log in, then retry cookie discovery.
50
+
51
+ You can provide cookies explicitly in three ways (highest priority first):
52
+
53
+ 1. `--cookie "name=value; name2=value2"`
54
+ 2. `--cookie-file <path>` (either):
55
+ - Netscape cookie file (common export format)
56
+ - Playwright storage state JSON (the CLI extracts cookies for `mobbin.com`)
57
+ - JSON array of cookie objects (common browser export format)
58
+ 3. `MOBBIN_COOKIE` env var
59
+
60
+ Examples:
61
+
62
+ ```bash
63
+ mobbin search --query "login" --platform ios --experience apps --cookie "session=..."
64
+
65
+ mobbin search --query "login" --cookie-file ./cookies.txt
66
+ mobbin search --query "login" --cookie-file ./storage-state.json
67
+
68
+ MOBBIN_COOKIE="session=..." mobbin recent-searches
69
+ ```
70
+
71
+ ### Common auth errors
72
+
73
+ - `401` or `{ error: { message: "unauthenticated" } }`: missing/expired cookie
74
+ - `400` from `content-apps`: often needs auth and/or server-side state (Mobbin seems to expect a non-null `searchRequestId` in some flows)
75
+
76
+ ### One-time setup: save cookies to a file
77
+
78
+ This opens `mobbin.com` in your browser (macOS) and then saves a cookie string to `~/.config/mobbin/cookie.txt`:
79
+
80
+ ```bash
81
+ mobbin auth save-cookie --out ~/.config/mobbin/cookie.txt
82
+ ```
83
+
84
+ If your Mobbin login is in Safari, you can force Safari cookie reading:
85
+
86
+ ```bash
87
+ mobbin auth save-cookie --cookie-from safari
88
+ ```
89
+
90
+ If Mobbin is logged in under a non-default Chrome profile, pass the profile directory name:
91
+
92
+ ```bash
93
+ mobbin auth save-cookie --cookie-from chrome --cookie-profile "Profile 1"
94
+ ```
95
+
96
+ Security note: this file contains session cookies. Treat it like a password.
97
+
98
+ ## Commands
99
+
100
+ All commands output pretty JSON by default.
101
+
102
+ - Add `--raw` to print raw (non-JSON) output
103
+ - Add `--compact` to print compact JSON (1 line)
104
+
105
+ Public endpoints (work without cookies):
106
+
107
+ ```bash
108
+ mobbin trending-apps --platform ios
109
+ mobbin trending-sites
110
+ mobbin searchable-sites
111
+ mobbin searchable-apps --platform ios
112
+ mobbin trending-keywords --platform ios
113
+ mobbin dictionary
114
+ mobbin trending-filter-tags --platform ios --experience apps
115
+ ```
116
+
117
+ Auth-gated endpoints (require cookies):
118
+
119
+ ```bash
120
+ mobbin search --query "login" --platform ios --experience apps
121
+ mobbin popular-apps --platform ios --limit 10
122
+ mobbin app-versions --app-id <uuid>
123
+ mobbin screen-info --screen-id <uuid>
124
+ mobbin recent-searches
125
+ mobbin content-apps --platform ios --tab latest --page-size 24
126
+ ```
127
+
128
+ ## Download Screenshots
129
+
130
+ Mobbin API responses often include Supabase storage URLs (e.g. `https://*.supabase.co/storage/v1/object/public/...`).
131
+ Those URLs may not be directly browsable, but Mobbin serves the same assets via `bytescale.mobbin.com`.
132
+
133
+ Use `download` to fetch screenshots to disk:
134
+
135
+ ```bash
136
+ # Download all screenshots for an app (all versions)
137
+ mobbin download --app-id <uuid> --out-dir ./out
138
+
139
+ # Download a single screen
140
+ mobbin download --screen-id <uuid> --out-dir ./out
141
+
142
+ # Download all full-page screens for a site (latest version)
143
+ mobbin download --site-id <uuid> --out-dir ./out
144
+
145
+ # Download from a Mobbin site URL (any /sites/... URL works)
146
+ mobbin download "https://mobbin.com/sites/<anything>-<siteId>" --out-dir ./out
147
+
148
+ # Download one or many URLs (Supabase or Bytescale URLs)
149
+ mobbin download "https://ujasntkfphywizsdaapi.supabase.co/storage/v1/object/public/content/app_screens/<file>.png" --out-dir ./out
150
+
151
+ # Download from a Mobbin screen page URL
152
+ mobbin download "https://mobbin.com/screens/<uuid>" --out-dir ./out
153
+ ```
154
+
155
+ `extract` is an alias of `download` (same flags).
156
+
157
+ Tip: `download` caches Mobbin's Bytescale mapping in `~/.config/mobbin/bytescale.json`. Use `--bytescale-refresh` if downloads suddenly start failing.
158
+
159
+ Notes:
160
+
161
+ - `download --app-id`, `--screen-id`, and `--site-id` require auth cookies
162
+ - `--app-id`, `--screen-id`, and `--site-id` accept comma-separated lists
163
+ - `download --site-id` fetches the site's `/sections` page HTML and extracts `content/app_fullpage_screens/*` URLs (if this breaks, pass the exact `/sites/.../<siteVersionId>/sections` URL)
164
+ - `--platform` is typically one of `ios|android|web`
165
+ - `--experience` defaults to `apps` (Mobbin also uses other values in the UI)
166
+ - `content-apps --tab` maps to sorting behavior:
167
+ - `latest` (sort by `publishedAt`, also hides non-ideal apps)
168
+ - `popular` (sort by `popularity`)
169
+ - `top` (sort by `rating`)
170
+
171
+ ## Raw API Calls
172
+
173
+ Use `call` to hit any endpoint (useful for recon / experimenting).
174
+
175
+ ```bash
176
+ mobbin call /api/search-bar/fetch-trending-sites --method POST --data "{}"
177
+ mobbin call /api/search-bar/fetch-trending-apps --method POST --data '{"platform":"ios"}'
178
+ ```
179
+
180
+ Tip: `--data` must be valid JSON.
181
+
182
+ ## SDK
183
+
184
+ `mobbin-sdk.js` exports:
185
+
186
+ - `MobbinClient` (a small fetch wrapper)
187
+ - `buildContentAppsPayload()` (helper for `/api/content/fetch-apps`)
188
+
189
+ Example:
190
+
191
+ ```js
192
+ import { MobbinClient } from "./mobbin-sdk.js";
193
+
194
+ const client = new MobbinClient({ cookie: process.env.MOBBIN_COOKIE });
195
+ const apps = await client.fetchTrendingApps({ platform: "ios" });
196
+ console.log(apps);
197
+ ```