apify-deploy-integration
Deploy Apify Actors and integrate scraping into external applications. Use when deploying Actors to the platform, integrating Actor results into web apps, or connecting Apify with external services. Trigger: "deploy apify actor", "apify Vercel integration", "apify production deploy", "integrate apify results", "apify API endpoint".
What this skill does
# Apify Deploy Integration
## Overview
Deploy Actors to the Apify platform and integrate their results into external applications. Covers `apify push` deployment, API-triggered runs from web apps, scheduled scraping with data pipelines, and platform-specific integration patterns.
## Prerequisites
- Actor tested locally (`apify run`)
- `apify login` completed
- Target application ready for integration
## Instructions
### Step 1: Deploy Actor to Platform
```bash
# Push Actor code to Apify
apify push
# Push to a specific Actor (creates if doesn't exist)
apify push username/my-scraper
# Pull an existing Actor to modify
apify pull username/existing-actor
```
### Step 2: Integrate with a Web Application
The most common pattern: trigger an Actor from your app and consume results.
```typescript
// src/services/apify.ts
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
interface ScrapeResult {
url: string;
title: string;
price: number;
inStock: boolean;
}
/**
* Run a scraping Actor and return typed results.
* Blocks until the Actor finishes (synchronous pattern).
*/
export async function scrapeProducts(urls: string[]): Promise<ScrapeResult[]> {
const run = await client.actor('username/product-scraper').call({
startUrls: urls.map(url => ({ url })),
maxItems: 500,
}, {
memory: 2048,
timeout: 600, // 10 minutes
});
if (run.status !== 'SUCCEEDED') {
throw new Error(`Scrape failed: ${run.status} — ${run.statusMessage}`);
}
const { items } = await client.dataset(run.defaultDatasetId).listItems();
return items as ScrapeResult[];
}
/**
* Start a scraping Actor without waiting (async pattern).
* Returns run ID for later polling.
*/
export async function startScrape(urls: string[]): Promise<string> {
const run = await client.actor('username/product-scraper').start({
startUrls: urls.map(url => ({ url })),
});
return run.id;
}
/**
* Check if a run has finished and get results.
*/
export async function getScrapeResults(runId: string): Promise<{
status: string;
items?: ScrapeResult[];
}> {
const run = await client.run(runId).get();
if (run.status === 'RUNNING' || run.status === 'READY') {
return { status: run.status };
}
if (run.status === 'SUCCEEDED') {
const { items } = await client.dataset(run.defaultDatasetId).listItems();
return { status: 'SUCCEEDED', items: items as ScrapeResult[] };
}
return { status: run.status };
}
```
### Step 3: Next.js API Route Integration
```typescript
// app/api/scrape/route.ts (Next.js App Router)
import { NextResponse } from 'next/server';
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
export async function POST(request: Request) {
const { urls } = await request.json();
if (!urls?.length) {
return NextResponse.json({ error: 'urls required' }, { status: 400 });
}
try {
// Start Actor (non-blocking)
const run = await client.actor('username/product-scraper').start({
startUrls: urls.map((url: string) => ({ url })),
maxItems: 100,
});
return NextResponse.json({
runId: run.id,
status: run.status,
statusUrl: `/api/scrape/${run.id}`,
});
} catch (error) {
return NextResponse.json(
{ error: (error as Error).message },
{ status: 500 },
);
}
}
// app/api/scrape/[runId]/route.ts
export async function GET(
_req: Request,
{ params }: { params: { runId: string } },
) {
const run = await client.run(params.runId).get();
if (run.status === 'SUCCEEDED') {
const { items } = await client
.dataset(run.defaultDatasetId)
.listItems({ limit: 100 });
return NextResponse.json({ status: 'SUCCEEDED', items });
}
return NextResponse.json({
status: run.status,
statusMessage: run.statusMessage,
});
}
```
### Step 4: Express.js Webhook Receiver
```typescript
// Receive notifications when an Actor run completes
import express from 'express';
import { ApifyClient } from 'apify-client';
const app = express();
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
app.use(express.json());
app.post('/webhooks/apify', async (req, res) => {
const { eventType, eventData } = req.body;
// Verify the webhook (check run exists)
const { actorRunId } = eventData;
const run = await client.run(actorRunId).get();
if (!run) {
return res.status(400).json({ error: 'Invalid run ID' });
}
switch (eventType) {
case 'ACTOR.RUN.SUCCEEDED': {
const { items } = await client
.dataset(run.defaultDatasetId)
.listItems();
console.log(`Run succeeded with ${items.length} items`);
// Process items: save to DB, send notifications, etc.
await processScrapedData(items);
break;
}
case 'ACTOR.RUN.FAILED':
case 'ACTOR.RUN.TIMED_OUT':
console.error(`Run ${eventType}: ${run.statusMessage}`);
// Alert team via Slack, PagerDuty, etc.
await sendAlert(`Apify run ${eventType}: ${run.statusMessage}`);
break;
}
res.json({ received: true });
});
```
### Step 5: Scheduled Pipeline with Data Export
```typescript
// Run daily via cron, schedule, or Apify Schedule
import { ApifyClient } from 'apify-client';
import { writeFileSync } from 'fs';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
async function dailyScrapeAndExport() {
// Run Actor
const run = await client.actor('username/product-scraper').call({
startUrls: [{ url: 'https://target-store.com/products' }],
maxItems: 5000,
});
if (run.status !== 'SUCCEEDED') {
throw new Error(`Run failed: ${run.status}`);
}
// Export as CSV
const csvBuffer = await client
.dataset(run.defaultDatasetId)
.downloadItems('csv');
writeFileSync(`exports/products-${Date.now()}.csv`, csvBuffer);
// Also store in a named dataset for historical access
const archive = await client.datasets().getOrCreate('product-archive');
const { items } = await client.dataset(run.defaultDatasetId).listItems();
await client.dataset(archive.id).pushItems(
items.map(item => ({ ...item, scrapedDate: new Date().toISOString() })),
);
console.log(`Exported ${items.length} products`);
}
```
### Step 6: Docker Deployment (Self-Hosted Integration)
```dockerfile
# Dockerfile for an app that calls Apify
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "dist/index.js"]
```
```bash
# Build and deploy
docker build -t apify-integration .
docker run -e APIFY_TOKEN=apify_api_xxx apify-integration
# Or deploy to Cloud Run
gcloud run deploy apify-service \
--source . \
--set-secrets=APIFY_TOKEN=apify-token:latest \
--region us-central1
```
## Integration Architecture
```
┌────────────────┐ ┌──────────────┐ ┌────────────────┐
│ Your App │────▶│ Apify API │────▶│ Actor Run │
│ (apify-client)│ │ │ │ (on Apify │
│ │◀────│ │◀────│ platform) │
└────────────────┘ └──────────────┘ └────────────────┘
│ │
│ Poll or Webhook │
▼ ▼
┌────────────────┐ ┌────────────────┐
│ Your DB │ │ Dataset │
│ (processed) │ │ (raw results) │
└────────────────┘ └────────────────┘
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| `apify push` fails | Auth or build error | Check `apify login` and Dockerfile |
| Webhook not received | URL unreachable from internet | Use ngrok for dev; verify HTTPS in prod |
| Timeout in API route | Actor takes too long | Use async pattern (start + poll) |
| Memory error on platform | Actor needs more RAM | Increase `memory` option |
| Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.