Authorization: Bearer <token> on every call to https://api.webscraper.io/api/v1.
- The token goes in a Bearer header. That is what the provider’s API reference documents. The older
api_tokenquery parameter still works, but it would put the key in every request URL, so the plugin does not use it. A wrong token is refused with401 Unauthorized, invalid Bearer token. - This plugin covers sitemaps and the account. It wraps
GET /sitemaps,GET /sitemap/{id},POST /sitemapandGET /account. The Cloud API also serves sitemap update and delete, schedulers, tags, and scraping jobs (start, status, stop, and downloading the scraped data); those are not in this plugin yet. - Two error shapes, and they mean different things. A handled failure is
{ success: false, error }— that is what a bad token produces. An unrouted request is Laravel’s own 404{ message: "The route ... could not be found." }, which means the path is wrong. The plugin keeps them apart, so a 404 from a mistyped path is not reported as a missing sitemap. - A 401 is the key; a 403 is the resource. A 401 means the token is wrong or missing. A 403
Forbiddenmeans the token works but cannot reach what was asked for: the live API answers 403, not 404, for a sitemap id that does not exist or belongs to another account. - A sitemap is the scraping configuration.
sitemaps.getreturns its definition indata.sitemapas a JSON string; parse it to readstartUrl(where the crawl begins) andselectors(what is extracted). sitemaps.createtakes the export as-is. The body is the JSON the browser extension exports (_id,startUrl,selectors), and its shape belongs to the builder, so the plugin passes it through unchanged. The answer is the new sitemap’sid.- The list is paginated.
sitemaps.listreturns{ id, name }rows indata, withcurrent_page,last_page,totalandper_pageat the root; passpageuntil it reacheslast_page, andtagto filter. account.getis the cheapest check. It returns the user’s email and name and thepage_creditsleft, so it verifies a token and reports the remaining credits in one call.
- 4 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.More: API Key
4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List sitemapsWhat’s next
API reference
Every
webscraperio.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.