socialcrawl-mcp 2.5.0 → 2.7.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 CHANGED
@@ -409,7 +409,7 @@ GET /v1/linkedin/search/people?keywords=cto&include=profile&limit=3
409
409
 
410
410
  ### Monitors — schedule any recipe
411
411
 
412
- `socialcrawl_manage` with `area: "monitors"` wraps any registry endpoint or Prism composite in a scheduled, stateful monitor (`/v1/monitors/*`). It re-runs the recipe hourly/daily/weekly (or on a cron), delivers each result to an HMAC-signed webhook, raises alerts on metric thresholds or changes, and keeps a per-run time-series you can read back. *"Prism answers once; monitors watch it for you."* Managing monitors costs 0 credits; each scheduled run bills the recipe's normal cost plus a 1-credit scheduling premium. See `socialcrawl_endpoint` with `id: "monitors"` for the full contract.
412
+ `socialcrawl_manage` with `area: "monitors"` wraps any registry endpoint or Prism composite in a scheduled, stateful monitor (`/v1/monitors/*`). It re-runs the recipe hourly/daily/weekly (or on a cron, in UTC or in a time zone you name), delivers each result to an HMAC-signed webhook, raises alerts on metric thresholds or changes, and keeps a per-run time-series you can read back. *"Prism answers once; monitors watch it for you."* Managing monitors costs 0 credits; each scheduled run bills the recipe's normal cost plus a 1-credit scheduling premium. See `socialcrawl_endpoint` with `id: "monitors"` for the full contract.
413
413
 
414
414
  ### Web — scrape, crawl, browse
415
415
 
@@ -435,7 +435,7 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
435
435
  | Platform | Data Available |
436
436
  |----------|----------------|
437
437
  | **LinkedIn** | Profiles (single sub-resources or one-call bundles: all, complete, with-posts) & company pages (incl. lookup by domain, also-viewed, employee counts), posts & post-with-comments, reposts, reactions, comments & replies, Pulse articles with comments and reactions, people search (keyword or search-URL), company & hashtag search, similar members, profile sub-resources (experience, education, skills, position skills, certifications, followed schools/newsletters/Top Voices, last activity…), jobs (search, company jobs, jobs a member posted, hiring team, details), company insights, groups, the complete post-history archive (metered per post), transcripts, Ad Library, profile-360 |
438
- | **Prism** | Cross-platform composites — URL lookup, comment harvesting, batch post-stats/profile/comment lookup, async background jobs of up to 5,000 items (or 1,000 calls of any GET endpoint), bulk review history for up to 20,000 Yelp/Tripadvisor/App Store/Google Play items (`reviews/bulk`), handle-audit, name→accounts resolution (find-accounts), handle/link mentions, adverse-post screening, campaign-brief checks, hook/format lift, term earliness, a no-keyword country trend board, commenter language mix, comment-sourced buyer leads, brand mentions, demand signals, AI visibility, crisis radar/post-mortem, reputation, share-of-voice, creator vetting & creator cards, org radar, Korea gap, AI consensus answers, video/app/product intelligence |
438
+ | **Prism** | Cross-platform composites — URL lookup, comment harvesting, batch post-stats/profile/comment lookup, async background jobs of up to 5,000 items (or 1,000 calls of any GET endpoint), bulk review history for up to 20,000 Yelp/Google Maps/Tripadvisor/App Store/Google Play items (`reviews/bulk`), handle-audit, name→accounts resolution (find-accounts), handle/link mentions, adverse-post screening, campaign-brief checks, hook/format lift, term earliness, a no-keyword country trend board, commenter language mix, comment-sourced buyer leads, brand mentions, demand signals, AI visibility, crisis radar/post-mortem, reputation, share-of-voice, creator vetting & creator cards, org radar, Korea gap, AI consensus answers, video/app/product intelligence |
439
439
  | **Instagram** | Profiles, account transparency (profile/about), posts, reels, comments & comment replies, highlights, stories, tagged & location feeds, followers/following, similar accounts, post likers, reshare stats, one-call reels/posts feeds with share counts, engagement analytics, universal + popular-post search, reels/hashtag/profile/location/music search (reel search with creator cards via `include=creator`), on-screen text (OCR), trending, transcripts, profile-360 |
440
440
  | **TikTok** | Profiles, videos, comments & replies, on-screen text extraction, keyword/hashtag/user/music search + suggestions, hashtag details, trending (global or in-country For You), TikTok's own popular-hashtag and Top Videos boards, audience, similar accounts, followers, liked videos, playlists & collections, place feeds, effects, live, songs, transcripts, Ad Library, profile-360 |
441
441
  | **Facebook** | Pages, groups & group posts, a group's upcoming events (with details), posts, comments & replies (with sticker/GIF/image media), photos, reels (incl. full reels feed with view counts), events & event search, Marketplace, keyword search over posts/pages/people/videos/groups, transcripts, full Ad Library |
@@ -9,7 +9,7 @@ export declare const TIMEOUT_MS = 60000;
9
9
  export declare const INLINE_MAX_ROWS = 200;
10
10
  export declare const INLINE_MAX_BYTES = 60000;
11
11
  export declare const SERVER_NAME = "socialcrawl-mcp";
12
- export declare const SERVER_VERSION = "2.5.0";
12
+ export declare const SERVER_VERSION = "2.7.0";
13
13
  /**
14
14
  * Inside a normalised `socialcrawl_request` params object: the names of the
15
15
  * endpoint params that arrived as top-level arguments and were moved into
package/dist/constants.js CHANGED
@@ -13,7 +13,7 @@ export const INLINE_MAX_BYTES = 60_000;
13
13
  // (CREDIT_LADDER) alongside the cache TTLs, so a ladder change cannot leave a
14
14
  // stale copy behind. Import it from there.
15
15
  export const SERVER_NAME = "socialcrawl-mcp";
16
- export const SERVER_VERSION = "2.5.0";
16
+ export const SERVER_VERSION = "2.7.0";
17
17
  /**
18
18
  * Inside a normalised `socialcrawl_request` params object: the names of the
19
19
  * endpoint params that arrived as top-level arguments and were moved into
@@ -60,6 +60,19 @@ export declare function unaskedJoinCredits(e: Endpoint, include: string | undefi
60
60
  * the band's ceiling when a param the pricing rule names is present (a
61
61
  * plain call stays at the page price). `max_pages` multiplies the lot.
62
62
  */
63
+ /**
64
+ * What the call itself holds before joins, judgments, further pages and add-ons,
65
+ * when its rule meters it on something the params name: a batch priced per
66
+ * handle (prism/profiles), a per-row meter on `limit` (comments/full: ceil(limit
67
+ * / 4), at least 3; the affiliate lanes: limit x 107), or a unit price times
68
+ * the units named (Trends places, Naver segments, find-accounts platforms).
69
+ * `whole` means nothing else adds to it. Undefined: the page price.
70
+ */
71
+ export declare function meteredBase(endpoint: Endpoint, params: Record<string, unknown>): {
72
+ credits: number;
73
+ basis: string;
74
+ whole?: boolean;
75
+ } | undefined;
63
76
  export declare function localQuote(endpoint: Endpoint, params: Record<string, unknown>): number;
64
77
  /**
65
78
  * `GET /v1/utility/estimate` for one call (API-02): `id`, the params as a JSON
@@ -4,7 +4,8 @@ import { priceDrivingParams } from "./pricing.js";
4
4
  import { joinsCeiling, laneMaxCredits, quoteHydration } from "./hydration.js";
5
5
  import { judgmentHoldMax, quoteJudgments } from "./judgments.js";
6
6
  import { confirmThreshold } from "./session-spend.js";
7
- import { valueAndAddOnCeiling, valueAndAddOnCredits } from "./value-prices.js";
7
+ import { perHandleHold, rowMeter, valueAndAddOnCeiling, valueAndAddOnCredits } from "./value-prices.js";
8
+ import { unitMeter } from "./unit-meters.js";
8
9
  const present = (v) => v !== undefined && v !== null && v !== "";
9
10
  /**
10
11
  * The `pages` lever (API-280, API-281): `{platform}/profile/full` and
@@ -44,7 +45,7 @@ export function bandExplained(e) {
44
45
  return true;
45
46
  const labels = e.judgments?.labels;
46
47
  const lever = pagesLever(e);
47
- const explained = e.pricing.cost +
48
+ const explained = (unitMeter(e)?.ceiling ?? rowMeter(e)?.ceiling ?? e.pricing.cost) +
48
49
  (lever ? (lever.max - 1) * lever.step : 0) +
49
50
  joinsCeiling(e) +
50
51
  valueAndAddOnCeiling(e) +
@@ -63,13 +64,39 @@ export function unaskedJoinCredits(e, include) {
63
64
  * the band's ceiling when a param the pricing rule names is present (a
64
65
  * plain call stays at the page price). `max_pages` multiplies the lot.
65
66
  */
67
+ /**
68
+ * What the call itself holds before joins, judgments, further pages and add-ons,
69
+ * when its rule meters it on something the params name: a batch priced per
70
+ * handle (prism/profiles), a per-row meter on `limit` (comments/full: ceil(limit
71
+ * / 4), at least 3; the affiliate lanes: limit x 107), or a unit price times
72
+ * the units named (Trends places, Naver segments, find-accounts platforms).
73
+ * `whole` means nothing else adds to it. Undefined: the page price.
74
+ */
75
+ export function meteredBase(endpoint, params) {
76
+ const byHandle = perHandleHold(endpoint, params);
77
+ if (byHandle !== undefined)
78
+ return { credits: byHandle, basis: "each handle at its platform's price", whole: true };
79
+ const units = unitMeter(endpoint);
80
+ if (units)
81
+ return units.hold(params);
82
+ const rows = rowMeter(endpoint);
83
+ if (rows) {
84
+ const credits = rows.hold(params.limit);
85
+ return { credits, basis: `metered on \`limit\` (${params.limit === undefined || params.limit === "" ? "its default" : String(params.limit)})` };
86
+ }
87
+ return undefined;
88
+ }
66
89
  export function localQuote(endpoint, params) {
67
90
  const p = endpoint.pricing;
68
- let hold = p.cost;
91
+ const metered = meteredBase(endpoint, params);
92
+ if (metered?.whole)
93
+ return metered.credits;
94
+ const base = metered ? metered.credits : p.cost;
95
+ let hold = base;
69
96
  const include = typeof params.include === "string" ? params.include : undefined;
70
97
  if ((endpoint.hydration?.length ?? 0) > 0) {
71
98
  const limit = Number(params.limit);
72
- hold = quoteHydration(endpoint, include, Number.isFinite(limit) ? limit : undefined).held;
99
+ hold = quoteHydration(endpoint, include, Number.isFinite(limit) ? limit : undefined).held - p.cost + base;
73
100
  }
74
101
  if (endpoint.judgments)
75
102
  hold += quoteJudgments(endpoint, params).held;
@@ -6,7 +6,7 @@
6
6
  * {routes,resume,more,schedule-routes}.ts, platforms/review-history/
7
7
  * {http,engine}.ts, events/{feed,routes}.ts, webhooks/{http,limits}.ts.
8
8
  */
9
- export declare const DISCOVER_RUNS_DOC = "# SocialCrawl API \u2014 Discover runs, schedules and review history\n\nWork that keeps running after the call that started it. Start it with `socialcrawl_request`; read, export, steer and stop it with `socialcrawl_manage` (areas `discover` and `review_history`). Every read here is free; only the searches a run goes on to make are billed.\n\n## Discover runs (`/v1/prism/discover/runs`)\n\nStart a run with `socialcrawl_request` on `prism/discover` (`max_credits` is required; `async` runs it in the background). Manage it with `socialcrawl_manage` `area: \"discover\"`; `id` is the run id (`run_\u2026`, `data.run.run_id`). Runs created since 14/11/2026 are kept 30 days by default (was 7); `retention_days` is 1 to 30.\n\n| Action | Route | Cost |\n|--------|-------|------|\n| `run_list` | `GET /runs` (status, kind, created_after, cursor, page_size \u2264100; `id` = a schedule id lists that schedule's runs) | 0 |\n| `run_get` | `GET /runs/{run_id}` | 0 |\n| `run_export` | `GET /runs/{run_id}/results.jsonl` | 0 |\n| `run_legs` | `GET /runs/{run_id}/legs` (page_size \u2264500) | 0 |\n| `run_cancel` | `DELETE /runs/{run_id}` | 0 \u2014 rows kept, resume continues |\n| `run_resume` | `POST /runs/{run_id}/resume` `{ max_credits?, retry_failed? }` | 0 itself; continued searches bill as they run |\n| `run_more` | `POST /runs/{run_id}/more` `{ new_searches?, feedback?, max_credits?, pages? }` | each new search bills at its lane price |\n\n- **Long-poll:** `run_get` with `wait_s` (0-25) answers early on a status change, a finished stage or 10% more rows. At most 5 long-polls per key; a sixth answers at once.\n- **Filters** (run_get and run_export): view, order (arrival | rank; rank on a running run is a free 400), include_pending, changes_since, group, platform, keyword, sort, state (kept | dropped | all), include=dropped, and `tags` sent as `tag.<key>=<value>`. Any parameter the route does not take is a free 400. A cursor is signed with the filters it was issued for: send the SAME filters with it.\n- **run_export** streams every matching row; the last line is `{\"complete\":true}` or `{\"next_cursor\":\"\u2026\"}` (stopped after about 45 s; send it back with the same filters).\n- **run_resume** works on paused, partial, failed or cancelled runs. A run paused at its cap needs a HIGHER `max_credits`. Searches already paid for are never paid twice.\n- **run_more** works on completed runs only: `pages` 1-10, `feedback.accept`/`feedback.reject` up to 100 ids each (`accept` needs `new_searches: true`). Read only the new rows with `changes_since` = `data.more.since_version`. `data.more.nothing_more` (200) charged nothing. The route takes no Idempotency-Key, so check the run before repeating a more.\n- **No dry_run** on any run or schedule route (resume and more refuse any query parameter).\n- **Errors:** 404 RUN_NOT_FOUND (not your run), 409 RUN_STATE_CONFLICT, 410 RUN_EXPIRED (retention passed), 503 store_unavailable (retryable, nothing charged).\n\n## Discover schedules (`/v1/prism/discover/schedules`)\n\nCreated by `prism/discover` with a `schedule` field. All free; each scheduled run bills like a run within `max_credits_per_run` and `max_credits_per_month`. `id` is the schedule id (`dsch_\u2026`).\n\n`schedule_list` (status active | paused | stopped, cursor, page_size \u2264100), `schedule_get` (its recent runs, this month's spend, next fire), `schedule_pause`, `schedule_resume` (`{ max_credits_per_run?, max_credits_per_month? }`, null clears the month cap), `schedule_delete` (runs keep their rows). `run_list` with the schedule id lists one schedule's runs.\n\n## Stored lists (`/v1/prism/discover/inputs`)\n\nMake one with `socialcrawl_request` on `POST prism/discover/inputs` (`{ kind: \"authors\", authors: [...] }` up to 10,000 handles, or `{ kind: \"exclude\", exclude: [...] }` up to 50,000 entries); the answer's `author_list_id` / `exclude_list_id` (`din_\u2026`) goes into a discover call. Then, free: `input_list` (every live list with `item_count` and `expires_at`, plus `live` of `limit` 500 per account), `input_append` (`id` + `{ exclude: [...] }`, 1 to 50,000 entries; duplicates skipped, the expiry moves to 31 days; past 50,000 in all it is a free 400 `exclude_list_full`), `input_delete`. An unknown, expired or foreign id, or an author list sent to append, is a 404 `input_not_found`. Lists live 30 days.\n\n## Review history (`/v1/{platform}/reviews/history/{job_id}`)\n\nStart a job with `socialcrawl_request` on the POST for the platform \u2014 it holds the price and answers 202 with `job_id` (`job_\u2026`):\n\n| Start (POST) | Poll with `platform` | Price |\n|---|---|---|\n| `trustpilot/reviews/history` | `trustpilot` (default) | holds `depth` + 5 |\n| `tripadvisor/reviews/history` | `tripadvisor` | holds `depth` |\n| `google/business/reviews/history` (exactly one of `place_id` or `cid`, `depth` 1-10,000) | `google` | 5 per started 100 reviews collected; none collected is refunded in full |\n| `yelp/business/reviews/history` | `yelp` | 1 per started 4 pages (held at 52 a language; `languages=all` holds 154); honours `Idempotency-Key` |\n\nPoll with `socialcrawl_manage` `area: \"review_history\"`, `action: \"get\"`, `id` = the job id, free. Trustpilot, Tripadvisor and Google: status queued \u2192 running \u2192 polling \u2192 succeeded | failed; once settled each page carries `data.items` and `data.job` (`credits_hold`, the settled `credits_charged`, `expires_at`); page with `offset` and `limit` (1-100) until a page is shorter than `limit`. Yelp: rows are readable while the job runs, each page carries `data.job` (`pages_read`, `reviews_collected`, per-language progress), `total` and `next_offset` (null on the last page). Jobs live 7 days.\n\n## Bulk review history (`POST /v1/prism/reviews/bulk`)\n\nOne background job over up to 20,000 businesses or apps: `platform` (`yelp`, `tripadvisor`, `app_store`, `google_play`), `items`, optional `since` / `until`, `languages` (not Tripadvisor or App Store), `max_reviews_per_item`, `format` (`jsonl` | `csv`), `include` (`business`, `business_full` on Yelp, `none`), `country` (App Store, Google Play), `webhook_url` (https; the 202 shows its `webhook_secret` once) and `refresh_of` (an earlier job of this key: reuses its items and starts from the day it settled). Start it with `socialcrawl_request`. It bills 1 credit per started 4 pages over the whole job, reserved 25 credits at a time; a business that cannot be read costs nothing. When the next block cannot be held the job pauses as `paused_insufficient_credits` and resumes after a top-up (webhook events `reviews_bulk.paused`, `resumed`, `completed`, signed `x-socialcrawl-signature`). `Idempotency-Key` replays the job at 0 credits.\n\nThen, free: `action: \"bulk_get\"` (progress, each item's `status` pending | walking | waiting | done | unavailable, and signed links to the combined file, the manifest and each item's file, valid 1 hour; page items with `offset`/`limit`) and `action: \"bulk_cancel\"` (keeps and bills what was read; the job can still read `running` until it settles as `cancelled`). There is no list route: keep the job id.\n\n## follow\n\nAnswers carry ready next-step URLs in `data.next.*`. `socialcrawl_manage` `area: \"discover\"`, `action: \"follow\"`, `input: { url }` GETs one only when it is on the configured SocialCrawl API AND one of the free read routes above (batch jobs, discover runs and schedules, review history, the events feed, webhook endpoints). `status_url`, `results_url`, `changes_url` and `poll_url` are free reads. `continue_url` STARTS a billable continuation and is never followed (call `socialcrawl_request` after checking `continue_estimate`); `resume_url`/`more_url` are POSTs: use `run_resume`/`run_more`.\n";
9
+ export declare const DISCOVER_RUNS_DOC = "# SocialCrawl API \u2014 Discover runs, schedules and review history\n\nWork that keeps running after the call that started it. Start it with `socialcrawl_request`; read, export, steer and stop it with `socialcrawl_manage` (areas `discover` and `review_history`). Every read here is free; only the searches a run goes on to make are billed.\n\n## Discover runs (`/v1/prism/discover/runs`)\n\nStart a run with `socialcrawl_request` on `prism/discover` (`max_credits` is required; `async` runs it in the background). A background start answers 202 with `data.run` (`eta_s` with `eta_basis`), `data.next`, `credits_remaining` and, with `notify_url`, `data.notify` (its signing secret). Manage it with `socialcrawl_manage` `area: \"discover\"`; `id` is the run id (`run_\u2026`, `data.run.run_id`). Runs created since 14/11/2026 are kept 30 days by default (was 7); `retention_days` is 1 to 30.\n\n| Action | Route | Cost |\n|--------|-------|------|\n| `run_list` | `GET /runs` (status, kind, created_after, cursor, page_size \u2264100; `id` = a schedule id lists that schedule's runs) | 0 |\n| `run_get` | `GET /runs/{run_id}` | 0 |\n| `run_status` | `GET /runs/{run_id}/status` (`wait_s` only) | 0 |\n| `run_export` | `GET /runs/{run_id}/results.jsonl` | 0 |\n| `run_results_csv` / `run_comments_csv` | `GET /runs/{run_id}/results.csv` / `comments.csv` | 0 |\n| `run_legs` | `GET /runs/{run_id}/legs` (page_size \u2264500) | 0 |\n| `run_cancel` | `DELETE /runs/{run_id}` | 0 \u2014 rows kept, resume continues |\n| `run_resume` | `POST /runs/{run_id}/resume` `{ max_credits?, retry_failed? }` or `{ attach_stored_only: true }` | 0 itself; continued searches bill as they run |\n| `run_more` | `POST /runs/{run_id}/more` `{ new_searches?, feedback?, max_credits?, pages? }` | each new search bills at its lane price |\n| `run_comments` | `POST /runs/{run_id}/comments` `{ top_posts?, per_post?, platforms?, labels?, max_credits? }` | comment pages bill at their lane prices; `dry_run` quotes free |\n\n- **Poll `run_status`** (`GET /runs/{run_id}/status`, `wait_s` 0-25): `run`, `next` and `_warnings` only, about 2 KB where `run_get` is about 100 KB. Every run answer carries `next.poll_url` pointing at it (`status_url` unchanged). `run.progress` names its stages: `progress.stages` (states from the work left: `reading_comments`, `waiting`, `stopped`, `done`) and `progress.current_stage`, with `rows_collected`, `rows_judging`, `rows_held` and `note`; a background run fills `eta_s` with `eta_basis` (`estimate` or `measured`) and `credits_remaining`. `summary.comments` adds `posts_selected`, `posts_walked`, `posts_attached`, `stored_unattached_pages` and `count_bases`.\n- **Long-poll:** `run_get` and `run_status` with `wait_s` (0-25) answer early on a status change, a finished stage or 10% more rows. At most 5 long-polls per key; a sixth answers at once.\n- **notify_url** on the `prism/discover` POST (https, public host): one signed POST `discover.run_settled` (`run_id`, `status`, `stopped_because`, `credits_spent`, the run, poll and results URLs) when the run completes, is partial, pauses, fails or is cancelled. It is signed like webhook deliveries (`x-socialcrawl-signature`) with `data.notify.secret` from the POST answer.\n- **Filters** (run_get and the exports): view, order (arrival | rank; rank on a running run is a free 400), include_pending, changes_since, group, platform, keyword, sort, state (kept | dropped | all), include=dropped, and `tags` sent as `tag.<key>=<value>`. `format` (evidence | compact | text) and `fields` override the run's own for this read. On `run_get` only: `summary` (full | kept | none) and `summary_extra=by_week,top_terms` (kept rows per week with the stance split and mean sentiment; top hashtags and words per group). Any parameter the route does not take is a free 400 naming the next step. A cursor is signed with the filters it was issued for: send the SAME filters with it.\n- **run_export** streams every matching row; every line carries `kind` (`post`, `account`, `warning`, `removed`, `trailer`), and the last is the trailer: `{\"kind\":\"trailer\",\"complete\":true}` or `{\"kind\":\"trailer\",\"next_cursor\":\"\u2026\"}` (stopped after about 45 s; send it back with the same filters). A settled run's arrival-order export fills `engagement.percentile`.\n- **CSV:** `results.csv` is one line per kept post row (fixed columns, then one `question.<id>` column per question); `comments.csv` one line per comment, keyed by `post_id`. RFC 4180, UTF-8 with a BOM, formula-like cells guarded, the same filters and cursor as `results.jsonl`. A run that is not posts is a free 400 `csv_posts_only`.\n- **run_resume** works on paused, partial, failed or cancelled runs. A run paused at its cap needs a HIGHER `max_credits`. Searches already paid for are never paid twice. `{ attach_stored_only: true }` (alone) attaches comment pages the run stored but no row shows, bills 0 and keeps the status (`data.attached`); a stopped run's `next_step` names those pages and any unsent `include=interest` calls.\n- **run_more** works on completed runs only: `pages` 1-10, `feedback.accept`/`feedback.reject` up to 100 ids each (`accept` needs `new_searches: true`). Read only the new rows with `changes_since` = `data.more.since_version`. `data.more.nothing_more` (200) charged nothing. The route takes no Idempotency-Key, so check the run before repeating a more.\n- **run_comments** (`POST /runs/{run_id}/comments`) reads comments for an existing posts run: `top_posts` 1-50 and `per_post` 1-200 (default the run's own, else 3 and 20), `platforms`, `labels` (up to 10), `max_credits` (default the quote's max). `dry_run` answers the quote free. Pages an earlier pass stored replay free. Refused free while the run runs (409 `run_running`) or owes other work (409 `run_has_unsent_work`: resume it first). The answer is 202: poll `run_status`.\n- **Background runs** write comments to each post as it is read and read up to 4 slices of 5 posts at once; `include=interest` calls run once searches end. A run started with `x-client-tag` tags every background charge, so `credits/usage?group_by=tag` equals the run's spend.\n- **Rows** carry `language_source` (`detected`, `platform`, `requested`), `author.display_name` and `author.url` (`username` null when only a name is known), `judgments.stance.best` and `scores` beside `label`, and `geo.country.known`. A windowed run with Naver cafe or web documents warns how many kept rows have no date.\n- **Caps:** a dry run and a `max_credits_below_estimate` refusal carry `recommended_max_credits` (expected cost x 2, between the minimum and `suggested_max_credits`), and `next_step` leads with it; `plan=omit` leaves `plan` out of the answer.\n- **No dry_run** on any other run or schedule route (resume and more refuse any query parameter).\n- **Errors:** 404 RUN_NOT_FOUND (not your run), 409 RUN_STATE_CONFLICT, 410 RUN_EXPIRED (retention passed), 503 store_unavailable (retryable, nothing charged).\n\n## Discover schedules (`/v1/prism/discover/schedules`)\n\nCreated by `prism/discover` with a `schedule` field. All free; each scheduled run bills like a run within `max_credits_per_run` and `max_credits_per_month`. `id` is the schedule id (`dsch_\u2026`).\n\n`schedule_list` (status active | paused | stopped, cursor, page_size \u2264100), `schedule_get` (its recent runs, this month's spend, next fire), `schedule_pause`, `schedule_resume` (`{ max_credits_per_run?, max_credits_per_month? }`, null clears the month cap), `schedule_delete` (runs keep their rows). `run_list` with the schedule id lists one schedule's runs.\n\n## Stored lists (`/v1/prism/discover/inputs`)\n\nMake one with `socialcrawl_request` on `POST prism/discover/inputs` (`{ kind: \"authors\", authors: [...] }` up to 10,000 handles, or `{ kind: \"exclude\", exclude: [...] }` up to 50,000 entries); the answer's `author_list_id` / `exclude_list_id` (`din_\u2026`) goes into a discover call. Then, free: `input_list` (every live list with `item_count` and `expires_at`, plus `live` of `limit` 500 per account), `input_append` (`id` + `{ exclude: [...] }`, 1 to 50,000 entries; duplicates skipped, the expiry moves to 31 days; past 50,000 in all it is a free 400 `exclude_list_full`), `input_delete`. An unknown, expired or foreign id, or an author list sent to append, is a 404 `input_not_found`. Lists live 30 days.\n\n## Review history (`/v1/{platform}/reviews/history/{job_id}`)\n\nStart a job with `socialcrawl_request` on the POST for the platform \u2014 it holds the price and answers 202 with `job_id` (`job_\u2026`):\n\n| Start (POST) | Poll with `platform` | Price |\n|---|---|---|\n| `trustpilot/reviews/history` | `trustpilot` (default) | holds `depth` + 5 |\n| `tripadvisor/reviews/history` | `tripadvisor` | holds `depth` |\n| `google/business/reviews/history` (exactly one of `place_id` or `cid`, `depth` 1-10,000) | `google` | 5 per started 100 reviews collected; none collected is refunded in full |\n| `yelp/business/reviews/history` | `yelp` | 1 per started 4 pages (held at 52 a language; `languages=all` holds 154); honours `Idempotency-Key` |\n\nPoll with `socialcrawl_manage` `area: \"review_history\"`, `action: \"get\"`, `id` = the job id, free. Trustpilot, Tripadvisor and Google: status queued \u2192 running \u2192 polling \u2192 succeeded | failed; once settled each page carries `data.items` and `data.job` (`credits_hold`, the settled `credits_charged`, `expires_at`); page with `offset` and `limit` (1-100) until a page is shorter than `limit`. Yelp: rows are readable while the job runs, each page carries `data.job` (`pages_read`, `reviews_collected`, per-language progress), `total` and `next_offset` (null on the last page). Jobs live 7 days.\n\n## Bulk review history (`POST /v1/prism/reviews/bulk`)\n\nOne background job over up to 20,000 businesses, places or apps: `platform` (`yelp`, `google_maps`, `tripadvisor`, `app_store`, `google_play`), `items` (for `google_maps`: place_ids from `google/business/search`, cids or Google Maps place links), optional `since` / `until`, `languages` (not Tripadvisor or App Store; on Google Maps one code, the language the text is returned in), `max_reviews_per_item`, `format` (`jsonl` | `csv`), `include` (`business`, `business_full` on Yelp, `none`), `country` (App Store, Google Play), `webhook_url` (https; the 202 shows its `webhook_secret` once) and `refresh_of` (an earlier job of this key: reuses its items and starts from the day it settled). Start it with `socialcrawl_request`. It bills 1 credit per started 4 pages over the whole job, reserved 25 credits at a time; a business that cannot be read costs nothing. When the next block cannot be held the job pauses as `paused_insufficient_credits` and resumes after a top-up (webhook events `reviews_bulk.paused`, `resumed`, `completed`, signed `x-socialcrawl-signature`). `Idempotency-Key` replays the job at 0 credits.\n\nThen, free: `action: \"bulk_get\"` (progress, each item's `status` pending | walking | waiting | done | unavailable, and signed links to the combined file, the manifest and each item's file, valid 1 hour; page items with `offset`/`limit`) and `action: \"bulk_cancel\"` (keeps and bills what was read; the job can still read `running` until it settles as `cancelled`). There is no list route: keep the job id.\n\n## follow\n\nAnswers carry ready next-step URLs in `data.next.*`. `socialcrawl_manage` `area: \"discover\"`, `action: \"follow\"`, `input: { url }` GETs one only when it is on the configured SocialCrawl API AND one of the free read routes above (batch jobs, discover runs and schedules, review history, the events feed, webhook endpoints). `status_url`, `results_url`, `changes_url` and `poll_url` are free reads. `continue_url` STARTS a billable continuation and is never followed (call `socialcrawl_request` after checking `continue_estimate`); `resume_url`/`more_url` are POSTs: use `run_resume`/`run_more`.\n";
10
10
  export declare const EVENTS_DOC = "# SocialCrawl API \u2014 Account events feed and webhook endpoints\n\nThe account event log records what happens to this key's background work: discover runs (`discover.completed`, `discover.partial`, `discover.paused`, `discover.failed`, `discover.progress`, `discover.accounts_ready`, `discover.new_rows`, `discover.new_accounts`, `discover.new_items`), schedules (`discover.run_skipped`, `discover.run_failed`) and webhook endpoint health (`endpoint.disabled`). Pull it with the feed or have it pushed to a webhook endpoint. Use `socialcrawl_manage` `area: \"events\"`. Everything here costs **0 credits**, and no route here takes `dry_run`.\n\n## Feed (`GET /v1/events`)\n\n- **Your own cursor:** `cursor` = `oldest` (start of the 30-day retention), `now` (only new events), an event id (`evt_\u2026`) or `pagination.next_cursor` exactly as returned. Save `next_cursor` after each page.\n- **Named consumer:** `id` = a consumer name (a-z, 0-9, _ and -, up to 64). The server keeps its position; `start` (now | oldest) sets where a new consumer begins; its `types`/`subject_ids` filters bind at first use. A read commits nothing: process the page, then `ack` its `pagination.next_cursor` (`POST /v1/events/consumers/{name}/ack`, same `id`, `input: { cursor }`). Until you ack, the read returns the same page.\n- Not both `cursor` and a consumer (a free 400).\n- **Filters:** `types` (up to 50 types or patterns: `discover.completed`, `discover.*`, `*`) and `subject_ids` (up to 100 run_\u2026 or dsch_\u2026 ids). `limit` 1-500 (default 100).\n- **Long-poll:** `wait_s` (0-25) holds an empty read until an event arrives. At most 5 long-polls per key; a sixth answers at once.\n- **410 CURSOR_EXPIRED:** the position is older than the 30-day retention, so events were missed. Restart from `oldest` (a consumer restarts there on its next read and says `restarted_from` once) and tell the user which window was missed.\n- `data.next.poll_url` is a free read: `area: \"discover\"` action `follow` can GET it.\n\n## Webhook endpoints (`/v1/webhook-endpoints`)\n\nAt most **20 per API key**; an endpoint answers only to the key that created it. `id` is the endpoint id (`we_\u2026`, `data.endpoint.id`).\n\n| Action | Route |\n|--------|-------|\n| `endpoint_create` | `POST /` `{ url, types?, description?, subject_ids? }` (201) |\n| `endpoint_list` | `GET /` (limit \u2264100, cursor, status) |\n| `endpoint_get` | `GET /{id}` |\n| `endpoint_update` | `PATCH /{id}` (url, types, description, subject_ids, status enabled/disabled) |\n| `endpoint_delete` | `DELETE /{id}` |\n| `endpoint_rotate_secret` | `POST /{id}/rotate-secret` |\n| `endpoint_test` | `POST /{id}/test` `{ type? }` |\n| `endpoint_attempts` | `GET /{id}/attempts` (limit \u2264100, cursor) |\n\n- **The secret is shown ONCE.** `endpoint_create` and `endpoint_rotate_secret` return a `whsec_` secret in `data.secret`; store it immediately. Both send an Idempotency-Key (generated when you omit it, and echoed): a replay never creates a second endpoint and never shows the secret again. If it is lost, rotate with a NEW key.\n- **Rotation:** for 24 hours every delivery is signed with both the old and the new secret, so deploy the new one before then.\n- **URL rules:** a public HTTPS receiver. Private hosts and chat-app incoming webhooks are refused (400 invalid_webhook_url).\n- **Types** default to `[\"*\"]`. `endpoint_test` sends one signed sample of a subscribed type; the receiver has 15 s to answer 2xx. Answering 410 to a real delivery disables the endpoint.\n- **Retries:** a failing delivery gets 8 attempts in all, backing off over roughly 41 hours; `endpoint_attempts` shows the log. Setting `status: \"enabled\"` on a disabled endpoint resumes its parked deliveries at once.\n- **Links are full URLs.** An event's `links` (`run`, `results`, `changes`) start with the API's https origin; pass any of them to action `follow` (areas `discover`, `search_runs`, `creator_runs`).\n";
11
11
  /**
12
12
  * Universal search runs, lists and watches (UPGRADE-LOG API-073, API-077,
@@ -12,24 +12,34 @@ Work that keeps running after the call that started it. Start it with \`socialcr
12
12
 
13
13
  ## Discover runs (\`/v1/prism/discover/runs\`)
14
14
 
15
- Start a run with \`socialcrawl_request\` on \`prism/discover\` (\`max_credits\` is required; \`async\` runs it in the background). Manage it with \`socialcrawl_manage\` \`area: "discover"\`; \`id\` is the run id (\`run_…\`, \`data.run.run_id\`). Runs created since 14/11/2026 are kept 30 days by default (was 7); \`retention_days\` is 1 to 30.
15
+ Start a run with \`socialcrawl_request\` on \`prism/discover\` (\`max_credits\` is required; \`async\` runs it in the background). A background start answers 202 with \`data.run\` (\`eta_s\` with \`eta_basis\`), \`data.next\`, \`credits_remaining\` and, with \`notify_url\`, \`data.notify\` (its signing secret). Manage it with \`socialcrawl_manage\` \`area: "discover"\`; \`id\` is the run id (\`run_…\`, \`data.run.run_id\`). Runs created since 14/11/2026 are kept 30 days by default (was 7); \`retention_days\` is 1 to 30.
16
16
 
17
17
  | Action | Route | Cost |
18
18
  |--------|-------|------|
19
19
  | \`run_list\` | \`GET /runs\` (status, kind, created_after, cursor, page_size ≤100; \`id\` = a schedule id lists that schedule's runs) | 0 |
20
20
  | \`run_get\` | \`GET /runs/{run_id}\` | 0 |
21
+ | \`run_status\` | \`GET /runs/{run_id}/status\` (\`wait_s\` only) | 0 |
21
22
  | \`run_export\` | \`GET /runs/{run_id}/results.jsonl\` | 0 |
23
+ | \`run_results_csv\` / \`run_comments_csv\` | \`GET /runs/{run_id}/results.csv\` / \`comments.csv\` | 0 |
22
24
  | \`run_legs\` | \`GET /runs/{run_id}/legs\` (page_size ≤500) | 0 |
23
25
  | \`run_cancel\` | \`DELETE /runs/{run_id}\` | 0 — rows kept, resume continues |
24
- | \`run_resume\` | \`POST /runs/{run_id}/resume\` \`{ max_credits?, retry_failed? }\` | 0 itself; continued searches bill as they run |
26
+ | \`run_resume\` | \`POST /runs/{run_id}/resume\` \`{ max_credits?, retry_failed? }\` or \`{ attach_stored_only: true }\` | 0 itself; continued searches bill as they run |
25
27
  | \`run_more\` | \`POST /runs/{run_id}/more\` \`{ new_searches?, feedback?, max_credits?, pages? }\` | each new search bills at its lane price |
26
-
27
- - **Long-poll:** \`run_get\` with \`wait_s\` (0-25) answers early on a status change, a finished stage or 10% more rows. At most 5 long-polls per key; a sixth answers at once.
28
- - **Filters** (run_get and run_export): view, order (arrival | rank; rank on a running run is a free 400), include_pending, changes_since, group, platform, keyword, sort, state (kept | dropped | all), include=dropped, and \`tags\` sent as \`tag.<key>=<value>\`. Any parameter the route does not take is a free 400. A cursor is signed with the filters it was issued for: send the SAME filters with it.
29
- - **run_export** streams every matching row; the last line is \`{"complete":true}\` or \`{"next_cursor":"…"}\` (stopped after about 45 s; send it back with the same filters).
30
- - **run_resume** works on paused, partial, failed or cancelled runs. A run paused at its cap needs a HIGHER \`max_credits\`. Searches already paid for are never paid twice.
28
+ | \`run_comments\` | \`POST /runs/{run_id}/comments\` \`{ top_posts?, per_post?, platforms?, labels?, max_credits? }\` | comment pages bill at their lane prices; \`dry_run\` quotes free |
29
+
30
+ - **Poll \`run_status\`** (\`GET /runs/{run_id}/status\`, \`wait_s\` 0-25): \`run\`, \`next\` and \`_warnings\` only, about 2 KB where \`run_get\` is about 100 KB. Every run answer carries \`next.poll_url\` pointing at it (\`status_url\` unchanged). \`run.progress\` names its stages: \`progress.stages\` (states from the work left: \`reading_comments\`, \`waiting\`, \`stopped\`, \`done\`) and \`progress.current_stage\`, with \`rows_collected\`, \`rows_judging\`, \`rows_held\` and \`note\`; a background run fills \`eta_s\` with \`eta_basis\` (\`estimate\` or \`measured\`) and \`credits_remaining\`. \`summary.comments\` adds \`posts_selected\`, \`posts_walked\`, \`posts_attached\`, \`stored_unattached_pages\` and \`count_bases\`.
31
+ - **Long-poll:** \`run_get\` and \`run_status\` with \`wait_s\` (0-25) answer early on a status change, a finished stage or 10% more rows. At most 5 long-polls per key; a sixth answers at once.
32
+ - **notify_url** on the \`prism/discover\` POST (https, public host): one signed POST \`discover.run_settled\` (\`run_id\`, \`status\`, \`stopped_because\`, \`credits_spent\`, the run, poll and results URLs) when the run completes, is partial, pauses, fails or is cancelled. It is signed like webhook deliveries (\`x-socialcrawl-signature\`) with \`data.notify.secret\` from the POST answer.
33
+ - **Filters** (run_get and the exports): view, order (arrival | rank; rank on a running run is a free 400), include_pending, changes_since, group, platform, keyword, sort, state (kept | dropped | all), include=dropped, and \`tags\` sent as \`tag.<key>=<value>\`. \`format\` (evidence | compact | text) and \`fields\` override the run's own for this read. On \`run_get\` only: \`summary\` (full | kept | none) and \`summary_extra=by_week,top_terms\` (kept rows per week with the stance split and mean sentiment; top hashtags and words per group). Any parameter the route does not take is a free 400 naming the next step. A cursor is signed with the filters it was issued for: send the SAME filters with it.
34
+ - **run_export** streams every matching row; every line carries \`kind\` (\`post\`, \`account\`, \`warning\`, \`removed\`, \`trailer\`), and the last is the trailer: \`{"kind":"trailer","complete":true}\` or \`{"kind":"trailer","next_cursor":"…"}\` (stopped after about 45 s; send it back with the same filters). A settled run's arrival-order export fills \`engagement.percentile\`.
35
+ - **CSV:** \`results.csv\` is one line per kept post row (fixed columns, then one \`question.<id>\` column per question); \`comments.csv\` one line per comment, keyed by \`post_id\`. RFC 4180, UTF-8 with a BOM, formula-like cells guarded, the same filters and cursor as \`results.jsonl\`. A run that is not posts is a free 400 \`csv_posts_only\`.
36
+ - **run_resume** works on paused, partial, failed or cancelled runs. A run paused at its cap needs a HIGHER \`max_credits\`. Searches already paid for are never paid twice. \`{ attach_stored_only: true }\` (alone) attaches comment pages the run stored but no row shows, bills 0 and keeps the status (\`data.attached\`); a stopped run's \`next_step\` names those pages and any unsent \`include=interest\` calls.
31
37
  - **run_more** works on completed runs only: \`pages\` 1-10, \`feedback.accept\`/\`feedback.reject\` up to 100 ids each (\`accept\` needs \`new_searches: true\`). Read only the new rows with \`changes_since\` = \`data.more.since_version\`. \`data.more.nothing_more\` (200) charged nothing. The route takes no Idempotency-Key, so check the run before repeating a more.
32
- - **No dry_run** on any run or schedule route (resume and more refuse any query parameter).
38
+ - **run_comments** (\`POST /runs/{run_id}/comments\`) reads comments for an existing posts run: \`top_posts\` 1-50 and \`per_post\` 1-200 (default the run's own, else 3 and 20), \`platforms\`, \`labels\` (up to 10), \`max_credits\` (default the quote's max). \`dry_run\` answers the quote free. Pages an earlier pass stored replay free. Refused free while the run runs (409 \`run_running\`) or owes other work (409 \`run_has_unsent_work\`: resume it first). The answer is 202: poll \`run_status\`.
39
+ - **Background runs** write comments to each post as it is read and read up to 4 slices of 5 posts at once; \`include=interest\` calls run once searches end. A run started with \`x-client-tag\` tags every background charge, so \`credits/usage?group_by=tag\` equals the run's spend.
40
+ - **Rows** carry \`language_source\` (\`detected\`, \`platform\`, \`requested\`), \`author.display_name\` and \`author.url\` (\`username\` null when only a name is known), \`judgments.stance.best\` and \`scores\` beside \`label\`, and \`geo.country.known\`. A windowed run with Naver cafe or web documents warns how many kept rows have no date.
41
+ - **Caps:** a dry run and a \`max_credits_below_estimate\` refusal carry \`recommended_max_credits\` (expected cost x 2, between the minimum and \`suggested_max_credits\`), and \`next_step\` leads with it; \`plan=omit\` leaves \`plan\` out of the answer.
42
+ - **No dry_run** on any other run or schedule route (resume and more refuse any query parameter).
33
43
  - **Errors:** 404 RUN_NOT_FOUND (not your run), 409 RUN_STATE_CONFLICT, 410 RUN_EXPIRED (retention passed), 503 store_unavailable (retryable, nothing charged).
34
44
 
35
45
  ## Discover schedules (\`/v1/prism/discover/schedules\`)
@@ -57,7 +67,7 @@ Poll with \`socialcrawl_manage\` \`area: "review_history"\`, \`action: "get"\`,
57
67
 
58
68
  ## Bulk review history (\`POST /v1/prism/reviews/bulk\`)
59
69
 
60
- One background job over up to 20,000 businesses or apps: \`platform\` (\`yelp\`, \`tripadvisor\`, \`app_store\`, \`google_play\`), \`items\`, optional \`since\` / \`until\`, \`languages\` (not Tripadvisor or App Store), \`max_reviews_per_item\`, \`format\` (\`jsonl\` | \`csv\`), \`include\` (\`business\`, \`business_full\` on Yelp, \`none\`), \`country\` (App Store, Google Play), \`webhook_url\` (https; the 202 shows its \`webhook_secret\` once) and \`refresh_of\` (an earlier job of this key: reuses its items and starts from the day it settled). Start it with \`socialcrawl_request\`. It bills 1 credit per started 4 pages over the whole job, reserved 25 credits at a time; a business that cannot be read costs nothing. When the next block cannot be held the job pauses as \`paused_insufficient_credits\` and resumes after a top-up (webhook events \`reviews_bulk.paused\`, \`resumed\`, \`completed\`, signed \`x-socialcrawl-signature\`). \`Idempotency-Key\` replays the job at 0 credits.
70
+ One background job over up to 20,000 businesses, places or apps: \`platform\` (\`yelp\`, \`google_maps\`, \`tripadvisor\`, \`app_store\`, \`google_play\`), \`items\` (for \`google_maps\`: place_ids from \`google/business/search\`, cids or Google Maps place links), optional \`since\` / \`until\`, \`languages\` (not Tripadvisor or App Store; on Google Maps one code, the language the text is returned in), \`max_reviews_per_item\`, \`format\` (\`jsonl\` | \`csv\`), \`include\` (\`business\`, \`business_full\` on Yelp, \`none\`), \`country\` (App Store, Google Play), \`webhook_url\` (https; the 202 shows its \`webhook_secret\` once) and \`refresh_of\` (an earlier job of this key: reuses its items and starts from the day it settled). Start it with \`socialcrawl_request\`. It bills 1 credit per started 4 pages over the whole job, reserved 25 credits at a time; a business that cannot be read costs nothing. When the next block cannot be held the job pauses as \`paused_insufficient_credits\` and resumes after a top-up (webhook events \`reviews_bulk.paused\`, \`resumed\`, \`completed\`, signed \`x-socialcrawl-signature\`). \`Idempotency-Key\` replays the job at 0 credits.
61
71
 
62
72
  Then, free: \`action: "bulk_get"\` (progress, each item's \`status\` pending | walking | waiting | done | unavailable, and signed links to the combined file, the manifest and each item's file, valid 1 hour; page items with \`offset\`/\`limit\`) and \`action: "bulk_cancel"\` (keeps and bills what was read; the job can still read \`running\` until it settles as \`cancelled\`). There is no list route: keep the job id.
63
73
 
@@ -835,12 +835,13 @@ Monitors are **not** registry endpoints — they live at \`/v1/monitors/*\` and
835
835
  ## Create parameters
836
836
 
837
837
  - \`recipe\` (required) — any registered **GET** endpoint or Prism composite as \`platform/resource\` (e.g. \`prism/brand-mentions\`, \`tiktok/profile/videos\`, or a list composite such as \`prism/profile/comments\`). POST batch endpoints cannot be monitored.
838
- - \`cadence\` (required) — \`hourly\` \| \`daily\` \| \`weekly\`, or a cron expression.
839
- - \`webhook_url\` (required unless \`track\` is set) — HTTPS endpoint that receives each run, signed with \`x-socialcrawl-signature\` (HMAC-SHA256, timestamped).
838
+ - \`cadence\` (required) — \`hourly\` \| \`daily\` \| \`weekly\`, or a 5-field cron expression, read in UTC.
839
+ - \`timezone\`: an IANA zone a cron cadence is read in instead of UTC, daylight saving included: \`cadence: "0 6-18/2 * * 1-5"\` with \`timezone: "America/New_York"\` runs every 2 hours from 6am to 6pm New York time on weekdays, about 152 runs a month. Cron only; an unknown zone is a free 400 \`INVALID_TIMEZONE\`. The create quote (\`runs_per_month\`, \`estimated_monthly_cost\`) counts a cron's real runs.
840
+ - \`webhook_url\` (required unless \`track\` is set) — HTTPS endpoint that receives each run, signed with \`x-socialcrawl-signature\` (HMAC-SHA256, timestamped) and the Standard Webhooks headers \`webhook-id\`, \`webhook-timestamp\` and \`webhook-signature\`, both from the monitor's \`whsec_\` secret.
840
841
  - \`params\` — parameters passed to the recipe every run. Frozen at create, with relative tokens resolved at each run: \`now-<N>d\` becomes the date N days back (\`YYYY-MM-DD\`), \`now-<N>h\` the ISO timestamp N hours back (e.g. \`since: "now-3h"\` on an hourly \`prism/profile/comments\` monitor).
841
842
  - \`alert_rules\` — \`[{ metric, op, value, window? }]\`. Ops: \`gt\`, \`lt\`, \`gte\`, \`lte\`, \`abs_change_gt\`, \`pct_change_gt\`, \`pct_change_lt\` (the change ops compare a run to the previous comparable run; \`window\` is \`1d\` \| \`1w\`). To alert on new items, use the \`rows_new\` metric (rows not seen in the previous run; ops \`gt\` / \`gte\`): \`{"metric":"rows_new","op":"gt","value":0}\`. \`rows_new\` requires \`track\` (below): without it the create is refused with "rows_new needs track".
842
843
  - \`track\` — makes a tracking monitor that keeps numbers per row between runs: \`{ metrics, row_key?, max_rows? }\`. \`metrics\` is 1-20 paths to numbers: \`items[].<numeric path>\` reads one per row of a list recipe (e.g. \`items[].post.engagement.views\`; the part after \`items[].\` is relative to the row), and a plain dot path reads one off the page (e.g. \`author.followers\`). \`row_key\` is the dot path of a stable id inside a row (default: the row's own id, e.g. \`post.id\`; required when the rows have none); \`max_rows\` is 1-200 (default 100). With \`track\`, \`webhook_url\` is optional (a download-only monitor). New-items alert, whole: \`track: { metrics: ["items[].post.engagement.views"] }\`, \`alert_rules: [{"metric":"rows_new","op":"gt","value":0}]\`, \`suppress_webhook_unless_alert: true\`; keep \`track\` and \`alert_rules\` together.
843
- - \`webhook_format\` — \`full\` (default: the run's payload, plus \`numbers\`/\`deltas\` on a track monitor) or \`rows\` (one flat, spreadsheet-ready line per row and metric; needs \`track\`). Needs \`webhook_url\`.
844
+ - \`webhook_format\` — \`full\` (default: the run's payload, plus \`numbers\`/\`deltas\` on a track monitor), \`rows\` (one flat, spreadsheet-ready line per row and metric; needs \`track\`) or \`chat\` (posts each new row as one line of text into a Slack, Microsoft Teams, Google Chat or Discord incoming-webhook URL: the body is the chat tool's own \`{ text }\`, a heading with the monitor's name and one line per new row with its title, buyer, deadline as DD/MM/YYYY, \`email …\`, \`subject: …\` and link; at most 50 lines, then "…and N more new rows."; the first run posts one start line and a run with no new row posts nothing). \`chat\` needs \`track\` with an \`items[].<path>\` metric and \`row_key\`, and \`webhook_rows: "new"\`; each missing piece is a free 400, and a chat incoming-webhook URL with \`full\`, \`rows\` or no format is a free 400 naming \`webhook_format 'chat'\`. Price unchanged (the recipe plus 1 credit a run). Needs \`webhook_url\`.
844
845
  - \`webhook_rows\` — \`all\` (default) or \`new\`: only the rows new since the previous run. Needs \`track\` with an \`items[].\` metric and a \`webhook_url\`; the first run is a \`baseline: true\` run with no rows.
845
846
  - \`suppress_webhook_unless_alert\` — only deliver the webhook when a rule trips.
846
847
  - \`max_credits_per_month\` — the most the monitor may bill in a calendar month (UTC), whole credits 1 to 10,000,000. The run that would pass it is skipped unbilled and the monitor pauses with \`paused_because: "monthly_cap"\` until the 1st. A free 400 below one run's price (recipe cost + 1) and on recipes whose sources bill themselves (\`search/multi\`, \`tiktokshop/sales\`, the tag searches).