scrapfly-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Scrapfly webhooks. Use when setting up Scrapfly webhook handlers for async scrape, extraction, screenshot, or crawler jobs, debugging…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Scrapfly Webhooks
When to Use This Skill
- How do I receive Scrapfly webhooks?
- How do I verify Scrapfly webhook signatures?
- How do I handle async Scrape API, Extraction API, or Screenshot API results?
- How do I route Scrapfly webhooks by resource type (scrape, extraction, screenshot)?
- How do I handle Crawler API webhook events (
crawler_started,crawler_finished, ...)? - Why is my Scrapfly webhook signature verification failing?
Prerequisites
- A paid Scrapfly plan. Webhooks are not available on the FREE plan — its webhook queue size is 0, so no deliveries are ever dispatched even after configuration. The dashboard hides the webhook UI on the free tier. Any paid tier enables delivery. See
references/setup.mdfor the full plan-detection checklist.
How Scrapfly Webhooks Work
Scrapfly uses HMAC-SHA256 with uppercase hex encoding over the raw request body. Scrapfly's TypeScript SDK (scrapfly-sdk on npm) exports a verifySignature(body, signature, secret) helper, and its Python SDK ships a webhook server that verifies deliveries; the code below follows the same documented algorithm without a dependency.
Key facts:
- Signature header:
X-Scrapfly-Webhook-Signature(uppercase hex). A duplicateX-Scrapfly-Webhook-Signature-Lowercaseis also sent for runtimes that normalise headers. - Algorithm:
HMAC-SHA256(secret, raw_body).hexdigest().upper() - What is signed: The raw request body bytes. Do not parse and re-serialise JSON — that changes the byte sequence and breaks the signature.
- No timestamp / replay window: Scrapfly does not include a timestamp header; treat the signature as authenticity-only.
- Secret: Use the value from the Scrapfly dashboard exactly as shown. Do not trim or base64-decode it.
- Routing: Use
X-Scrapfly-Webhook-Resource-Type(scrape,extraction,screenshot, orcrawlfor the Crawler API) to dispatch when one endpoint serves multiple products. Crawler events also carryX-Scrapfly-Crawl-Event-Nameand aneventfield in the body. - Content-Type is whatever you configured in the dashboard, not what the body actually is. Scrapfly's webhook config has a Content-Type dropdown (
application/jsonorapplication/msgpack) and sends the chosen value on every delivery — but it doesn't change what's in the body for image deliveries. Screenshot API deliveries carry raw image bytes (JPEG/PNG/WebP/GIF) regardless of the configured Content-Type, so the header is unreliable for that resource type. Dispatch onX-Scrapfly-Webhook-Resource-Type, not onContent-Type, and parse only after dispatching. HMAC verification works fine over any body — only the parse step needs to know whether it's a JSON, msgpack, or binary body. This skill's example handlers assume the dashboard is configured toapplication/json; if you pick msgpack, swapJSON.parse/json.loadsfor a msgpack decoder. - Hookdeck Event Gateway alternative: If you're already routing webhooks through Hookdeck (the hookdeck-event-gateway skill recommends this), set the source type to
SCRAPFLYon the gateway connection and Hookdeck verifies the Scrapfly signature before forwarding. Your handler then only needs to verify Hookdeck's signature, not Scrapfly's directly.
Essential Code (USE THIS)
Scrapfly Signature Verification (JavaScript)
const crypto = require('crypto');
function verifyScrapflySignature(rawBody, signatureHeader, secret) {
if (!signatureHeader || !secret) return false;
// Scrapfly emits uppercase hex
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex')
.toUpperCase();
// Accept either casing — Scrapfly also sends an X-...-Lowercase variant
const received = signatureHeader.toUpperCase();
try {
return crypto.timingSafeEqual(
Buffer.from(received, 'hex'),
Buffer.from(expected, 'hex')
);
} catch {
return false;
}
}
Express Webhook Handler
const express = require('express');
const app = express();
// CRITICAL: Use express.raw() — Scrapfly signs the raw body bytes
app.post('/webhooks/scrapfly',
express.raw({ type: '*/*' }),
(req, res) => {
const signature = req.headers['x-scrapfly-webhook-signature'];
const resourceType = req.headers['x-scrapfly-webhook-resource-type'];
const jobId = req.headers['x-scrapfly-webhook-job-id'];
const webhookId = req.headers['x-scrapfly-webhook-id'];
if (!verifyScrapflySignature(req.body, signature, process.env.SCRAPFLY_WEBHOOK_SECRET)) {
console.error('Scrapfly signature verification failed');
return res.status(401).send('Invalid signature');
}
console.log(`Scrapfly ${resourceType} webhook (job ${jobId}, id ${webhookId})`);
// CRITICAL: dispatch BEFORE JSON.parse — Screenshot API deliveries carry
// r
Установить scrapfly-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл scrapfly-webhooks?
Receive and verify Scrapfly webhooks. Use when setting up Scrapfly webhook handlers for async scrape, extraction, screenshot, or crawler jobs, debugging X-Scrapfly-Webhook-Signature verification, or routing on X-Scrapfly-Webhook-Resource-Type.
Как установить скилл scrapfly-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scrapfly-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic