scrapewise_preview_scraper_from_url
Take a target URL, run every applicable detection strategy in parallel
(SINGLE_PRODUCT, MULTIPLE_PRODUCTS, APPLICATION_LD_JSON, plus the Amazon and
Google specialisations), and return the candidate scraper configurations that
successfully produced data along with their sample rows. Each candidate is
feature-gated against the customer's plan — only configs the plan can actually
run are returned. This is a preview / discovery endpoint: nothing persists.
Pick a candidate from the response, then call scrapewise_create_scraper to
save it.
INPUT CONTRACT — paste the link, never a keyword or an ID:
`url` is the full web address of the page you want, exactly as it appears in a
browser address bar. Every value a dedicated endpoint needs (search term, ASIN,
seller id, place id, product id, country, language, page) is read OUT of that
address — never asked for separately. The one exception is plain Google Search,
which also accepts typed words.
The address decides the endpoint:
- `google.<tld>/search?q=…` → Google Search
- `google.<tld>/search?q=…&udm=28` (or `tbm=shop`) → Google Shopping search
- `google.<tld>/search?q=…&tbm=nws`, `news.google.com/search?q=…` → Google News
- `google.<tld>/shopping/product/<id>?q=…` → Google Shopping product
(the search phrase is required: the catalog lookup is refused without it)
- `google.<tld>/maps/search|place|reviews…` → Google Maps
- `google.<tld>/travel/flights|search…` → Google Flights / Hotels
- `amazon.<tld>/s?k=…`, `/gp/offer-listing/<asin>`, `/deals`,
`/gp/bestsellers/<category>`, `/sp?seller=…` → the matching Amazon endpoint
- `walmart.com/search?q=…`, `walmart.com/ip/<name>/<item>` → Walmart
- `play.google.com/store/search|apps/details` → Google Play
- `youtube.com/results?search_query=…` → YouTube
- `trends.google.com/trends/explore?q=…` → Google Trends
Any OTHER address is not an error: it runs the normal detection flow above.
Args:
- body (SimpleModeWithUrlDTO, required): the target page descriptor.
- id (string, optional): existing scraper id if previewing changes
- name (string, required): display name for the future scraper
- groupId (string, required): owning group's MongoDB ObjectId
- url (string, required): the page address to analyse (see INPUT CONTRACT)
- endpointTag (string, optional): the answer to a closed choice question when
one address fits several variants of the same family. It never overrides the
address: the address's own host must belong to that endpoint, and it can
never turn typed words into a dedicated call.
- itemsConfig (list, optional): pre-existing field selectors to bias detection
- tryWithHiddenData (boolean, query param, optional, default false): enable
a more aggressive JSON-LD pass that reads scripts hidden by the renderer.
- useCache (boolean, query param, optional, default false): reuse a recent
fetch instead of hitting the network. Faster but may serve stale HTML.
Returns:
`Set<ScraperSampleDataDTO>` — one entry per detection strategy that produced
data. Each entry carries the candidate `scraperDTO` (full ScraperDTO ready
to persist via scrapewise_create_scraper) plus a `sampleData` map of the
first scraped rows and `executionTimeSec` for that detection pass. Empty
set means no strategy succeeded for this URL on this plan.
Examples:
- Use when: "find a scraper config for https://example.com/widget" → returns
every detection strategy that worked, customer picks one
- Use when: building a new scraper interactively in chat — preview, evaluate
candidates, then create
- Don't use when: you already have a ScraperDTO ready to persist → call
scrapewise_create_scraper directly
- Don't use when: the target needs custom request shape (cookies, headers) →
use scrapewise_preview_scraper_from_curl instead
Error Handling:
- 200 with empty Set if no strategy produced data on the customer's plan
(not an error — the URL is just unsupported by available detectors).
- 400 INPUT_MUST_BE_URL if `endpointTag` names a dedicated endpoint but `url` is
typed words rather than an address. Only Google Search accepts typed words.
- 400 AMBIGUOUS_URL if the address fits several variants of one family and no
choice was sent. The message lists the closed option set; pick one and retry.
- An address that matches NO endpoint is never an error — it takes the normal
detection flow.
- 401 Unauthorized if no Firebase JWT or API key on the request.
- 500 INTERNAL with `correlationId` if a detector or downstream proxy
crashes mid-pass.[runtime hint] This tool returns JSON-as-text — its response shape is dynamic (per-scraper itemsConfig, file binary, etc.) so the MCP outputSchema is omitted. Do not rely on the presence of any specific field in the response; treat the result as a string-or-object blob and parse defensively.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"body": "<body>"
},
"name": "scrapewise_preview_scraper_from_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| useCache | No | ||
| forceTopTier | No | ||
| tryWithHiddenData | No |