mastra-scavio 0.6.0 → 0.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 +64 -3
- package/dist/index.cjs +177 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +171 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mastra-scavio
|
|
2
2
|
|
|
3
|
-
[Scavio](https://scavio.dev) real-time data tools for [Mastra](https://mastra.ai) agents — **188 tools across 31 platforms** on one API key. Retail (Amazon, Walmart, eBay, Target, Home Depot), real estate (Zillow, Redfin), travel (Booking.com, Airbnb, Tripadvisor), local (Yelp, Google Maps), jobs (Indeed, Glassdoor, LinkedIn), software reviews (G2, Capterra), app stores (App Store, Google Play), company filings (SEC EDGAR, Companies House), ad libraries (Google Ads Transparency, Meta Ad Library), search (Google) and social (YouTube, TikTok, Instagram, X, Reddit, Threads, Kuaishou) — plus `scavioExtract`, which reads any URL as clean Markdown.
|
|
3
|
+
[Scavio](https://scavio.dev) real-time data tools for [Mastra](https://mastra.ai) agents — **188 tools across 31 platforms** on one API key. Retail (Amazon, Walmart, eBay, Target, Home Depot), real estate (Zillow, Redfin), travel (Booking.com, Airbnb, Tripadvisor), local (Yelp, Google Maps), jobs (Indeed, Glassdoor, LinkedIn), software reviews (G2, Capterra), app stores (App Store, Google Play), company filings (SEC EDGAR, Companies House), ad libraries (Google Ads Transparency, Meta Ad Library), search (Google) and social (YouTube, TikTok, Instagram, X, Reddit, Threads, Kuaishou) — plus `scavioExtract`, which reads any URL as clean Markdown, and five opt-in tools that map a site's URLs, crawl a whole site or batch-extract a URL list.
|
|
4
4
|
|
|
5
5
|
> **Amazon changed (breaking).** The upstream provider moved in 2026-07:
|
|
6
6
|
> `domain` is replaced by `country`, a two-letter marketplace code (`us`, `gb`
|
|
@@ -53,11 +53,12 @@ const agent = new Agent({
|
|
|
53
53
|
|
|
54
54
|
## Tools
|
|
55
55
|
|
|
56
|
-
`createScavioTools()` returns **188 tools** across 31 platforms plus `extract` — one per billable Scavio endpoint. Requires `scavio@^0.
|
|
56
|
+
`createScavioTools()` returns **188 tools** across 31 platforms plus `extract` — one per billable Scavio endpoint — and **193** with `{ enableCrawl: true }`, which adds the five website tools. Requires `scavio@^0.23.0`.
|
|
57
57
|
|
|
58
58
|
| Platform | Tools | Names |
|
|
59
59
|
|---|---|---|
|
|
60
60
|
| [Extract (any URL)](https://scavio.dev/docs/extract) | 1 | `scavioExtract` |
|
|
61
|
+
| Website map, crawl, batch (opt-in: `enableCrawl`) | 5 | `scavioMapWebsite`, `scavioCrawlWebsite`, `scavioCrawlStatus`, `scavioBatchExtract`, `scavioBatchStatus` |
|
|
61
62
|
| Google | 14 | `scavioGoogleSearch`, `scavioGoogleAiMode`, `scavioGoogleMapsSearch`, `scavioGoogleMapsPlace`, `scavioGoogleMapsReviews`, `scavioGoogleShopping`, `scavioGoogleShoppingProduct`, `scavioGoogleShoppingStores`, `scavioGoogleFlights`, `scavioGoogleHotels`, `scavioGoogleHotelsDetail`, `scavioGoogleNews`, `scavioGoogleTrends`, `scavioGoogleTrending` |
|
|
62
63
|
| Amazon | 3 | `scavioAmazonSearch`, `scavioAmazonProduct`, `scavioAmazonOffers` |
|
|
63
64
|
| [Walmart](https://scavio.dev/docs/walmart-api) | 7 | `scavioWalmartSearch`, `scavioWalmartProduct`, `scavioWalmartReviews`, `scavioWalmartCategory`, `scavioWalmartOffers`, `scavioWalmartSeller`, `scavioWalmartSellerProducts` |
|
|
@@ -116,6 +117,10 @@ Reddit, TikTok and Instagram shipped two tools each before 0.5.0; the rest of th
|
|
|
116
117
|
|
|
117
118
|
`scavioRedditSearch`, `scavioRedditPost`, `scavioTiktokProfile` and `scavioInstagramProfile` are unchanged.
|
|
118
119
|
|
|
120
|
+
### New in 0.7.0
|
|
121
|
+
|
|
122
|
+
Five website tools, opt-in with `createScavioTools({ enableCrawl: true })` so the default set is unchanged: `scavioMapWebsite`, `scavioCrawlWebsite`, `scavioCrawlStatus`, `scavioBatchExtract` and `scavioBatchStatus`. Requires `scavio@^0.23.0`, whose `extract` became a callable namespace (`scavio.extract({ url })` still reads one page). See [Map, crawl and batch](#map-crawl-and-batch).
|
|
123
|
+
|
|
119
124
|
### New in 0.6.0
|
|
120
125
|
|
|
121
126
|
91 tools: 21 new platforms, five more Walmart endpoints, and `scavioExtract`. Nothing was renamed or removed. Three things worth knowing:
|
|
@@ -124,6 +129,60 @@ Reddit, TikTok and Instagram shipped two tools each before 0.5.0; the rest of th
|
|
|
124
129
|
- **`scavioExtract` is the fallback for everything else.** It reads any URL and returns clean Markdown (or plain text, or raw HTML), so an agent that lands on a page no platform endpoint covers still has a move. It leads `createScavioTools()` for that reason, and it is a top-level SDK method — `scavio.extract({ url })`, never `scavio.extract.extract()`.
|
|
125
130
|
- **Walmart moved from 2 tools to 7** and its two original tools were migrated to the spec pattern the rest of the package uses. `createScavioWalmartSearchTool` and `createScavioWalmartProductTool` keep their names and tool ids. One input tightened: `sort_by` on the search tool was an open string and is now the closed enum the API actually accepts (`best_match`, `price_low`, `price_high`, `best_seller`, `rating_high`, `new`) — a value outside it was never honoured upstream, it was just billed.
|
|
126
131
|
|
|
132
|
+
## Map, crawl and batch
|
|
133
|
+
|
|
134
|
+
Five opt-in tools for whole sites, behind `createScavioTools({ enableCrawl: true })` (off by default, because a
|
|
135
|
+
crawl bills per page):
|
|
136
|
+
|
|
137
|
+
| Tool | What it does | Credits |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `scavio-map-website` | List a site's page URLs from its sitemaps and start page, deduplicated and filtered by path or search words | 1 (normal mode; advanced up to 2, ultra up to 10) |
|
|
140
|
+
| `scavio-crawl-website` | Crawl a site from one URL; every same-site page as Markdown, text or HTML | per successful page |
|
|
141
|
+
| `scavio-crawl-status` | A crawl's progress and page results, cursor-paged | free |
|
|
142
|
+
| `scavio-batch-extract` | Extract a list of URLs (up to 1,000, plan-limited) in one job | per successful page |
|
|
143
|
+
| `scavio-batch-status` | A batch's progress and page results, cursor-paged | free |
|
|
144
|
+
|
|
145
|
+
Map answers in one call. Crawl and batch run as background jobs: the start tool
|
|
146
|
+
posts the job and then **waits up to `wait_seconds` (default 45, max 300)** for
|
|
147
|
+
it to finish, returning the job's status with its first page of results (10 by
|
|
148
|
+
default, `limit` up to 100) either way. A job still `queued` or `running` when
|
|
149
|
+
the wait ends keeps going server-side: read the rest later with the matching
|
|
150
|
+
status tool, the returned `data.id` and `next_cursor`. That keeps an agent turn
|
|
151
|
+
bounded while a large crawl (up to 6 hours) runs on.
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { createScavioTools, createScavioCrawlWebsiteTool } from 'mastra-scavio';
|
|
155
|
+
|
|
156
|
+
// Everything, plus the five website tools:
|
|
157
|
+
const tools = createScavioTools({ enableCrawl: true });
|
|
158
|
+
|
|
159
|
+
// Or just the crawler:
|
|
160
|
+
const agent = new Agent({
|
|
161
|
+
id: 'docs-agent',
|
|
162
|
+
name: 'Docs Agent',
|
|
163
|
+
model: 'anthropic/claude-sonnet-4-6',
|
|
164
|
+
instructions: 'Crawl documentation sites with Scavio and answer from them.',
|
|
165
|
+
tools: { crawl: createScavioCrawlWebsiteTool() },
|
|
166
|
+
});
|
|
167
|
+
// scavio-crawl-website({ url: "https://hono.dev/docs", max_pages: 25, include_paths: ["/docs/**"] })
|
|
168
|
+
// -> { data: { id, status: "completed" | "running", pages, credits_used, results, next_cursor } }
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Pricing.** Crawl and batch bill **per successful page** at Extract's price for
|
|
172
|
+
the mode: `normal` (the standard fetch) and `advanced` (renders JavaScript-built
|
|
173
|
+
pages) 1 credit, `ultra` (the hardest pages) 2. Failed and skipped pages are
|
|
174
|
+
free, and if your balance runs out the job stops cleanly with
|
|
175
|
+
`stopped_reason: "insufficient_credits"`. Reading a job is free. Crawl and map
|
|
176
|
+
obey the site's robots.txt, and results are kept for 3 days.
|
|
177
|
+
|
|
178
|
+
**Plan limits** (pages per crawl / active jobs / URLs per batch): Free 10/1/10,
|
|
179
|
+
PAYG 100/1/50, Project 500/2/100, Bootstrap 2,000/3/500, Startup 5,000/5/1,000,
|
|
180
|
+
Growth 10,000/10/1,000.
|
|
181
|
+
|
|
182
|
+
Cancellation, webhooks (signed `Scavio-Signature`) and idempotency keys exist in
|
|
183
|
+
the `scavio` SDK (`extract.cancelCrawl`, `webhook_url`, `idempotencyKey`) and the
|
|
184
|
+
[REST API](https://scavio.dev/docs/extract), but are deliberately not agent tools.
|
|
185
|
+
|
|
127
186
|
## Credits
|
|
128
187
|
|
|
129
188
|
Most calls cost 1 credit. Every tool states its own cost in its description, so an agent can budget before it fans out.
|
|
@@ -151,7 +210,7 @@ Most calls cost 1 credit. Every tool states its own cost in its description, so
|
|
|
151
210
|
|
|
152
211
|
Instagram is priced per endpoint rather than flat, on three tiers: 10 where both upstream legs are billed, 8 for the two calls with no fallback leg to hedge (`scavioInstagramPost`, `scavioInstagramCommentReplies`), and 2 for `scavioInstagramUserPosts`, whose cheap leg is the primary one. Prefer `scavioInstagramUserPosts` over `scavioInstagramUserReels` when the timeline will do — same shape of data, one fifth of the cost. Paginated tools bill per page. See [scavio.dev/docs](https://scavio.dev/docs).
|
|
153
212
|
|
|
154
|
-
###
|
|
213
|
+
### These surfaces are priced by the request body
|
|
155
214
|
|
|
156
215
|
No single number is true for these, so each tool states its own price and none of them says a flat cost:
|
|
157
216
|
|
|
@@ -161,6 +220,8 @@ No single number is true for these, so each tool states its own price and none o
|
|
|
161
220
|
| `scavioThreadsProfile`, `scavioThreadsUserPosts`, `scavioThreadsUserReplies` | **2 credits addressed by `user_id`, 4 by `username`** — a handle buys a second upstream call, because the upstream handle lookup is dead. Pass `user_id` whenever you have it. The other three Threads tools have no username form and are always 2. |
|
|
162
221
|
| Kuaishou | **Per endpoint, 1 to 40.** See the table above; one platform-wide figure would be wrong by up to 40x. |
|
|
163
222
|
| `scavioExtract` | 1 credit on `mode` `normal` or `advanced`, **2 on `ultra`**. Only a successful extraction is billed — a dead link, bot wall or timeout costs nothing. |
|
|
223
|
+
| `scavioMapWebsite` | 1 credit on `mode` `normal`; up to 2 on `advanced`, up to 10 on `ultra`, priced by what the call needed. |
|
|
224
|
+
| `scavioCrawlWebsite`, `scavioBatchExtract` | **Per successful page**: 1 credit on `normal` or `advanced`, 2 on `ultra`. Failed and skipped pages are free; the two status tools are free. |
|
|
164
225
|
|
|
165
226
|
### Lookup-first platforms
|
|
166
227
|
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,8 @@ __export(index_exports, {
|
|
|
35
35
|
createScavioAppStoreAppTool: () => createScavioAppStoreAppTool,
|
|
36
36
|
createScavioAppStoreReviewsTool: () => createScavioAppStoreReviewsTool,
|
|
37
37
|
createScavioAppStoreSearchTool: () => createScavioAppStoreSearchTool,
|
|
38
|
+
createScavioBatchExtractTool: () => createScavioBatchExtractTool,
|
|
39
|
+
createScavioBatchStatusTool: () => createScavioBatchStatusTool,
|
|
38
40
|
createScavioBookingHotelTool: () => createScavioBookingHotelTool,
|
|
39
41
|
createScavioBookingReviewsTool: () => createScavioBookingReviewsTool,
|
|
40
42
|
createScavioBookingSearchTool: () => createScavioBookingSearchTool,
|
|
@@ -45,6 +47,8 @@ __export(index_exports, {
|
|
|
45
47
|
createScavioCompaniesHouseFilingHistoryTool: () => createScavioCompaniesHouseFilingHistoryTool,
|
|
46
48
|
createScavioCompaniesHouseOfficersTool: () => createScavioCompaniesHouseOfficersTool,
|
|
47
49
|
createScavioCompaniesHouseSearchTool: () => createScavioCompaniesHouseSearchTool,
|
|
50
|
+
createScavioCrawlStatusTool: () => createScavioCrawlStatusTool,
|
|
51
|
+
createScavioCrawlWebsiteTool: () => createScavioCrawlWebsiteTool,
|
|
48
52
|
createScavioEbayProductTool: () => createScavioEbayProductTool,
|
|
49
53
|
createScavioEbaySearchTool: () => createScavioEbaySearchTool,
|
|
50
54
|
createScavioEbaySellerTool: () => createScavioEbaySellerTool,
|
|
@@ -118,6 +122,7 @@ __export(index_exports, {
|
|
|
118
122
|
createScavioLinkedinPostCommentsTool: () => createScavioLinkedinPostCommentsTool,
|
|
119
123
|
createScavioLinkedinPostTool: () => createScavioLinkedinPostTool,
|
|
120
124
|
createScavioLinkedinSearchJobsTool: () => createScavioLinkedinSearchJobsTool,
|
|
125
|
+
createScavioMapWebsiteTool: () => createScavioMapWebsiteTool,
|
|
121
126
|
createScavioMetaAdsAdTool: () => createScavioMetaAdsAdTool,
|
|
122
127
|
createScavioMetaAdsAdvertiserTool: () => createScavioMetaAdsAdvertiserTool,
|
|
123
128
|
createScavioMetaAdsSearchTool: () => createScavioMetaAdsSearchTool,
|
|
@@ -218,6 +223,7 @@ __export(index_exports, {
|
|
|
218
223
|
createScavioZillowSearchTool: () => createScavioZillowSearchTool,
|
|
219
224
|
ebayToolSpecs: () => ebayToolSpecs,
|
|
220
225
|
extractToolSpecs: () => extractToolSpecs,
|
|
226
|
+
extractWebToolSpecs: () => extractWebToolSpecs,
|
|
221
227
|
g2ToolSpecs: () => g2ToolSpecs,
|
|
222
228
|
getScavioClient: () => getScavioClient,
|
|
223
229
|
glassdoorToolSpecs: () => glassdoorToolSpecs,
|
|
@@ -1932,7 +1938,7 @@ var extractToolSpecs = [
|
|
|
1932
1938
|
"Output format: 'html' is the raw page, 'markdown' a readability extraction, 'text' that markdown flattened to plain text (server default 'markdown')."
|
|
1933
1939
|
),
|
|
1934
1940
|
mode: import_zod11.z.enum(["normal", "advanced", "ultra"]).optional().describe(
|
|
1935
|
-
"Fetch tier, and the price-bearing parameter: 'normal'
|
|
1941
|
+
"Fetch tier, and the price-bearing parameter: 'normal' is the standard fetch (1 credit), 'advanced' renders JavaScript-built pages (1 credit), 'ultra' reaches the hardest pages (2 credits). Server default 'normal'."
|
|
1936
1942
|
)
|
|
1937
1943
|
}),
|
|
1938
1944
|
call: (client, input) => client.extract(input)
|
|
@@ -4498,6 +4504,162 @@ var createScavioMetaAdsAdvertiserTool = toolFactory(
|
|
|
4498
4504
|
);
|
|
4499
4505
|
var createScavioMetaAdsAdTool = toolFactory(metaAdsToolSpecs, "scavioMetaAdsAd");
|
|
4500
4506
|
|
|
4507
|
+
// src/extract-web.ts
|
|
4508
|
+
var import_zod34 = require("zod");
|
|
4509
|
+
var JOB_POLL_INTERVAL_MS = 3e3;
|
|
4510
|
+
var JOB_WAIT_DEFAULT_SECONDS = 45;
|
|
4511
|
+
var JOB_WAIT_MAX_SECONDS = 300;
|
|
4512
|
+
var JOB_RESULTS_DEFAULT_LIMIT = 10;
|
|
4513
|
+
var JOB_TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
4514
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
4515
|
+
async function waitForJob(status, id, waitSeconds2, query) {
|
|
4516
|
+
const deadline = Date.now() + Math.max(0, Math.min(waitSeconds2, JOB_WAIT_MAX_SECONDS)) * 1e3;
|
|
4517
|
+
for (; ; ) {
|
|
4518
|
+
const remaining = deadline - Date.now();
|
|
4519
|
+
if (remaining <= 0) break;
|
|
4520
|
+
await sleep(Math.min(JOB_POLL_INTERVAL_MS, remaining));
|
|
4521
|
+
const probe = await status(id, { limit: 1, include_content: false });
|
|
4522
|
+
if (JOB_TERMINAL.has(String(probe?.data?.status))) break;
|
|
4523
|
+
}
|
|
4524
|
+
return await status(id, query);
|
|
4525
|
+
}
|
|
4526
|
+
async function startAndWait(start, status, input) {
|
|
4527
|
+
const { wait_seconds, limit: limit2, include_content, ...body } = input;
|
|
4528
|
+
const created = await start(body);
|
|
4529
|
+
const id = created?.data?.id;
|
|
4530
|
+
const wait = wait_seconds ?? JOB_WAIT_DEFAULT_SECONDS;
|
|
4531
|
+
if (!id || wait <= 0) return created;
|
|
4532
|
+
const query = { limit: limit2 ?? JOB_RESULTS_DEFAULT_LIMIT };
|
|
4533
|
+
if (include_content !== void 0) query.include_content = include_content;
|
|
4534
|
+
return waitForJob(status, id, wait, query);
|
|
4535
|
+
}
|
|
4536
|
+
var MODE_DESCRIPTION = "Fetch tier, and the price-bearing parameter: 'normal' is the standard fetch, 'advanced' renders JavaScript-built pages, 'ultra' reaches the hardest pages. Server default 'normal'.";
|
|
4537
|
+
var PATHS_DESCRIPTION = "Path globs (max 20). '*' matches within one path segment, '**' across segments; a pattern without wildcards matches that path and everything under it. Example: ['/blog/**'].";
|
|
4538
|
+
var JOB_PRICE = "Billed per SUCCESSFUL page at Extract's price for the mode: normal and advanced 1 credit, ultra 2 credits. Failed and skipped pages are free, and if the balance runs out the job stops cleanly.";
|
|
4539
|
+
var mode = import_zod34.z.enum(["normal", "advanced", "ultra"]).optional().describe(MODE_DESCRIPTION);
|
|
4540
|
+
var format = import_zod34.z.enum(["html", "markdown", "text"]).optional().describe("Format for each page, as on extract: html, markdown or text (server default markdown).");
|
|
4541
|
+
var waitSeconds = import_zod34.z.number().int().min(0).max(JOB_WAIT_MAX_SECONDS).optional().describe(
|
|
4542
|
+
"Seconds to wait for the job to finish before returning, 0-300 (default 45). 0 returns the job id at once. A job still running when the wait ends keeps going; read it later with its status tool."
|
|
4543
|
+
);
|
|
4544
|
+
var limit = import_zod34.z.number().int().min(1).max(100).optional().describe(
|
|
4545
|
+
"Results per response, 1-100 (default 10, to keep page content inside the context window); page on with next_cursor."
|
|
4546
|
+
);
|
|
4547
|
+
var includeContent = import_zod34.z.boolean().optional().describe("Set false to list results without their page content (default true).");
|
|
4548
|
+
var statusSchema = import_zod34.z.object({
|
|
4549
|
+
id: import_zod34.z.string().describe("Job id returned when the job was started (data.id)."),
|
|
4550
|
+
cursor: import_zod34.z.string().optional().describe("next_cursor from the previous response, to read the next page."),
|
|
4551
|
+
limit,
|
|
4552
|
+
status: import_zod34.z.enum(["succeeded", "failed", "skipped"]).optional().describe("Only results with this status."),
|
|
4553
|
+
include_content: includeContent
|
|
4554
|
+
});
|
|
4555
|
+
var readStatus = (fn) => (client, { id, limit: max, ...query }) => fn(client)(id, { ...query, limit: max ?? JOB_RESULTS_DEFAULT_LIMIT });
|
|
4556
|
+
var extractWebToolSpecs = [
|
|
4557
|
+
defineScavioTool({
|
|
4558
|
+
key: "scavioMapWebsite",
|
|
4559
|
+
id: "scavio-map-website",
|
|
4560
|
+
platform: "extract",
|
|
4561
|
+
endpoint: "/api/v1/extract/map",
|
|
4562
|
+
credits: 1,
|
|
4563
|
+
description: "List a website's page URLs, gathered from its sitemaps and its start page, deduplicated, filtered by path or search words and limited: { url, links: [{ url, source, lastmod }], total_found, returned, truncated }. Pages the site's robots.txt disallows are left out. Use it to find the right pages before extracting or crawling. Costs 1 credit in normal mode; advanced costs up to 2 credits and ultra up to 10, priced by what the call needed.",
|
|
4564
|
+
inputSchema: import_zod34.z.object({
|
|
4565
|
+
url: import_zod34.z.string().describe("The site to map. A bare host is upgraded to https."),
|
|
4566
|
+
search: import_zod34.z.string().optional().describe("Only return URLs containing every word of this text (case-insensitive)."),
|
|
4567
|
+
limit: import_zod34.z.number().int().min(1).max(5e3).optional().describe(
|
|
4568
|
+
"Maximum links to return, 1-5000. Default 1000 (or the plan's limit if lower: Free 500, PAYG 1,000, paid plans 5,000)."
|
|
4569
|
+
),
|
|
4570
|
+
sitemap: import_zod34.z.enum(["include", "only", "skip"]).optional().describe(
|
|
4571
|
+
"'include' combines the site's sitemaps with the start page's links (default); 'only' uses sitemaps alone; 'skip' uses page links alone."
|
|
4572
|
+
),
|
|
4573
|
+
include_subdomains: import_zod34.z.boolean().optional().describe("Also return URLs on subdomains of the site (default false)."),
|
|
4574
|
+
include_paths: import_zod34.z.array(import_zod34.z.string()).optional().describe(`Keep only URLs matching these. ${PATHS_DESCRIPTION}`),
|
|
4575
|
+
exclude_paths: import_zod34.z.array(import_zod34.z.string()).optional().describe(`Drop URLs matching these. ${PATHS_DESCRIPTION}`),
|
|
4576
|
+
ignore_query_parameters: import_zod34.z.boolean().optional().describe("Treat URLs that differ only by query string as one URL (default true)."),
|
|
4577
|
+
mode
|
|
4578
|
+
}),
|
|
4579
|
+
call: async (client, input) => await client.extract.map(input)
|
|
4580
|
+
}),
|
|
4581
|
+
defineScavioTool({
|
|
4582
|
+
key: "scavioCrawlWebsite",
|
|
4583
|
+
id: "scavio-crawl-website",
|
|
4584
|
+
platform: "extract",
|
|
4585
|
+
endpoint: "/api/v1/extract/crawl",
|
|
4586
|
+
credits: 1,
|
|
4587
|
+
description: "Crawl a website from one start URL: same-site pages are discovered and extracted breadth-first within the page, depth and path limits, each returned as Markdown, text or HTML. Pages the site's robots.txt disallows are skipped. Waits up to wait_seconds (default 45) and returns { id, status, pages, credits_used, results, next_cursor }; if status is still queued or running, call scavio-crawl-status with the id later. " + JOB_PRICE,
|
|
4588
|
+
inputSchema: import_zod34.z.object({
|
|
4589
|
+
url: import_zod34.z.string().describe("Where the crawl starts. Only pages on the same site are crawled."),
|
|
4590
|
+
max_pages: import_zod34.z.number().int().min(1).max(1e4).optional().describe(
|
|
4591
|
+
"Maximum pages to fetch. Default 100. Plan limits: Free 10, PAYG 100, Project 500, Bootstrap 2,000, Startup 5,000, Growth 10,000."
|
|
4592
|
+
),
|
|
4593
|
+
max_depth: import_zod34.z.number().int().min(0).max(10).optional().describe("How many links away from the start page to follow, 0-10 (default 3). 0 fetches only the start page."),
|
|
4594
|
+
include_paths: import_zod34.z.array(import_zod34.z.string()).optional().describe(`Crawl only paths matching these. ${PATHS_DESCRIPTION}`),
|
|
4595
|
+
exclude_paths: import_zod34.z.array(import_zod34.z.string()).optional().describe(`Skip paths matching these. ${PATHS_DESCRIPTION}`),
|
|
4596
|
+
allow_subdomains: import_zod34.z.boolean().optional().describe("Also crawl subdomains of the site (default false)."),
|
|
4597
|
+
ignore_query_parameters: import_zod34.z.boolean().optional().describe("Treat URLs that differ only by query string as one page (default true)."),
|
|
4598
|
+
sitemap: import_zod34.z.enum(["include", "skip", "only"]).optional().describe(
|
|
4599
|
+
"'include' also starts from the site's sitemap (default); 'skip' follows links only; 'only' fetches sitemap pages without following links."
|
|
4600
|
+
),
|
|
4601
|
+
format,
|
|
4602
|
+
mode,
|
|
4603
|
+
wait_seconds: waitSeconds,
|
|
4604
|
+
limit,
|
|
4605
|
+
include_content: includeContent
|
|
4606
|
+
}),
|
|
4607
|
+
call: (client, input) => startAndWait(
|
|
4608
|
+
(body) => client.extract.crawl(body),
|
|
4609
|
+
(id, query) => client.extract.crawlStatus(id, query),
|
|
4610
|
+
input
|
|
4611
|
+
)
|
|
4612
|
+
}),
|
|
4613
|
+
defineScavioTool({
|
|
4614
|
+
key: "scavioCrawlStatus",
|
|
4615
|
+
id: "scavio-crawl-status",
|
|
4616
|
+
platform: "extract",
|
|
4617
|
+
endpoint: "/api/v1/extract/crawl/{id}",
|
|
4618
|
+
credits: 0,
|
|
4619
|
+
description: "Read a crawl's progress and its page results by job id, paged by cursor: { status, stopped_reason, pages, credits_used, results: [{ url, status, content }], next_cursor }. Results are kept for 3 days after the crawl finishes. Free: reading a job costs 0 credits.",
|
|
4620
|
+
inputSchema: statusSchema,
|
|
4621
|
+
call: readStatus((client) => (id, query) => client.extract.crawlStatus(id, query))
|
|
4622
|
+
}),
|
|
4623
|
+
defineScavioTool({
|
|
4624
|
+
key: "scavioBatchExtract",
|
|
4625
|
+
id: "scavio-batch-extract",
|
|
4626
|
+
platform: "extract",
|
|
4627
|
+
endpoint: "/api/v1/extract/batch",
|
|
4628
|
+
credits: 1,
|
|
4629
|
+
description: "Extract a list of URLs (up to 1,000, plan-limited) in one job, each returned as Markdown, text or HTML exactly like scavio-extract. Waits up to wait_seconds (default 45) and returns { id, status, pages, credits_used, results, next_cursor }; if status is still queued or running, call scavio-batch-status with the id later. " + JOB_PRICE,
|
|
4630
|
+
inputSchema: import_zod34.z.object({
|
|
4631
|
+
urls: import_zod34.z.array(import_zod34.z.string()).min(1).max(1e3).describe(
|
|
4632
|
+
"The pages to extract (duplicates removed). Plan limits: Free 10, PAYG 50, Project 100, Bootstrap 500, Startup and Growth 1,000."
|
|
4633
|
+
),
|
|
4634
|
+
format,
|
|
4635
|
+
mode,
|
|
4636
|
+
wait_seconds: waitSeconds,
|
|
4637
|
+
limit,
|
|
4638
|
+
include_content: includeContent
|
|
4639
|
+
}),
|
|
4640
|
+
call: (client, input) => startAndWait(
|
|
4641
|
+
(body) => client.extract.batch(body),
|
|
4642
|
+
(id, query) => client.extract.batchStatus(id, query),
|
|
4643
|
+
input
|
|
4644
|
+
)
|
|
4645
|
+
}),
|
|
4646
|
+
defineScavioTool({
|
|
4647
|
+
key: "scavioBatchStatus",
|
|
4648
|
+
id: "scavio-batch-status",
|
|
4649
|
+
platform: "extract",
|
|
4650
|
+
endpoint: "/api/v1/extract/batch/{id}",
|
|
4651
|
+
credits: 0,
|
|
4652
|
+
description: "Read a batch extract's progress and its page results by job id, paged by cursor: { status, pages, credits_used, results: [{ url, status, content }], next_cursor }. Results are kept for 3 days after the batch finishes. Free: reading a job costs 0 credits.",
|
|
4653
|
+
inputSchema: statusSchema,
|
|
4654
|
+
call: readStatus((client) => (id, query) => client.extract.batchStatus(id, query))
|
|
4655
|
+
})
|
|
4656
|
+
];
|
|
4657
|
+
var createScavioMapWebsiteTool = toolFactory(extractWebToolSpecs, "scavioMapWebsite");
|
|
4658
|
+
var createScavioCrawlWebsiteTool = toolFactory(extractWebToolSpecs, "scavioCrawlWebsite");
|
|
4659
|
+
var createScavioCrawlStatusTool = toolFactory(extractWebToolSpecs, "scavioCrawlStatus");
|
|
4660
|
+
var createScavioBatchExtractTool = toolFactory(extractWebToolSpecs, "scavioBatchExtract");
|
|
4661
|
+
var createScavioBatchStatusTool = toolFactory(extractWebToolSpecs, "scavioBatchStatus");
|
|
4662
|
+
|
|
4501
4663
|
// src/tools.ts
|
|
4502
4664
|
function createScavioTools(config) {
|
|
4503
4665
|
return {
|
|
@@ -4688,7 +4850,14 @@ function createScavioTools(config) {
|
|
|
4688
4850
|
scavioGoogleAdsCreative: createScavioGoogleAdsCreativeTool(config),
|
|
4689
4851
|
scavioMetaAdsSearch: createScavioMetaAdsSearchTool(config),
|
|
4690
4852
|
scavioMetaAdsAdvertiser: createScavioMetaAdsAdvertiserTool(config),
|
|
4691
|
-
scavioMetaAdsAd: createScavioMetaAdsAdTool(config)
|
|
4853
|
+
scavioMetaAdsAd: createScavioMetaAdsAdTool(config),
|
|
4854
|
+
...config?.enableCrawl ? {
|
|
4855
|
+
scavioMapWebsite: createScavioMapWebsiteTool(config),
|
|
4856
|
+
scavioCrawlWebsite: createScavioCrawlWebsiteTool(config),
|
|
4857
|
+
scavioCrawlStatus: createScavioCrawlStatusTool(config),
|
|
4858
|
+
scavioBatchExtract: createScavioBatchExtractTool(config),
|
|
4859
|
+
scavioBatchStatus: createScavioBatchStatusTool(config)
|
|
4860
|
+
} : {}
|
|
4692
4861
|
};
|
|
4693
4862
|
}
|
|
4694
4863
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -4708,6 +4877,8 @@ function createScavioTools(config) {
|
|
|
4708
4877
|
createScavioAppStoreAppTool,
|
|
4709
4878
|
createScavioAppStoreReviewsTool,
|
|
4710
4879
|
createScavioAppStoreSearchTool,
|
|
4880
|
+
createScavioBatchExtractTool,
|
|
4881
|
+
createScavioBatchStatusTool,
|
|
4711
4882
|
createScavioBookingHotelTool,
|
|
4712
4883
|
createScavioBookingReviewsTool,
|
|
4713
4884
|
createScavioBookingSearchTool,
|
|
@@ -4718,6 +4889,8 @@ function createScavioTools(config) {
|
|
|
4718
4889
|
createScavioCompaniesHouseFilingHistoryTool,
|
|
4719
4890
|
createScavioCompaniesHouseOfficersTool,
|
|
4720
4891
|
createScavioCompaniesHouseSearchTool,
|
|
4892
|
+
createScavioCrawlStatusTool,
|
|
4893
|
+
createScavioCrawlWebsiteTool,
|
|
4721
4894
|
createScavioEbayProductTool,
|
|
4722
4895
|
createScavioEbaySearchTool,
|
|
4723
4896
|
createScavioEbaySellerTool,
|
|
@@ -4791,6 +4964,7 @@ function createScavioTools(config) {
|
|
|
4791
4964
|
createScavioLinkedinPostCommentsTool,
|
|
4792
4965
|
createScavioLinkedinPostTool,
|
|
4793
4966
|
createScavioLinkedinSearchJobsTool,
|
|
4967
|
+
createScavioMapWebsiteTool,
|
|
4794
4968
|
createScavioMetaAdsAdTool,
|
|
4795
4969
|
createScavioMetaAdsAdvertiserTool,
|
|
4796
4970
|
createScavioMetaAdsSearchTool,
|
|
@@ -4891,6 +5065,7 @@ function createScavioTools(config) {
|
|
|
4891
5065
|
createScavioZillowSearchTool,
|
|
4892
5066
|
ebayToolSpecs,
|
|
4893
5067
|
extractToolSpecs,
|
|
5068
|
+
extractWebToolSpecs,
|
|
4894
5069
|
g2ToolSpecs,
|
|
4895
5070
|
getScavioClient,
|
|
4896
5071
|
glassdoorToolSpecs,
|