Skip to content
Build Actors

Quick start

Install the CLI, build an Actor from a template, deploy it, and get your first results.

Go from an empty terminal to an Actor running on Scrape.ly, with results you can download, in about ten minutes. The whole flow:

.bash
npm install -g scrapely-cli
export SCRAPELY_API_URL=https://api.scrape.ly SCRAPELY_WEB_URL=https://my.scrape.ly
scrapely login
scrapely create my-first-actor --template crawlee-cheerio-js && cd my-first-actor
scrapely push
scrapely call -i '{"startUrls":[{"url":"https://crawlee.dev"}],"maxRequestsPerCrawl":10}' -o

You write code locally and the platform builds and runs it. The templates build on the Scrape.ly base images (scrapely/actor-node, scrapely/actor-python), which already contain the SDK, so you don't add it to package.json or requirements.txt, and you don't need Docker.

You needWhy
A Scrape.ly accountTo log in
Node.js 20.17 or newerThe CLI runs on Node.js
Git, with access to GitHubscrapely create clones the template repository
npm (JavaScript and TypeScript templates)create runs npm install

1. Install the CLI

The CLI is published as scrapely-cli and installs the scrapely executable.

.bash
npm install -g scrapely-cli
scrapely --version

Or skip the global install and use npx scrapely-cli <command>.

2. Log in

.bash
export SCRAPELY_API_URL=https://api.scrape.ly
export SCRAPELY_WEB_URL=https://my.scrape.ly
scrapely login
scrapely info

On an interactive terminal, login asks how to sign in:

ChoiceWhat happens
browser (recommended)The CLI opens the dashboard, you approve, and the CLI receives a token on a local callback. Expires after 24 hours by default
consoleCopy an API key from Settings → API & Integrations and paste it in
manualPaste a key you already have

The CLI checks the token against GET /v2/users/me and saves it to ~/.scrapely/credentials.json. scrapely info shows who you're logged in as. For CI, use an API key. See Authentication.

3. Create an Actor from a template

.bash
scrapely create my-first-actor --template crawlee-cheerio-js
cd my-first-actor
  • The name needs at least three characters: lowercase letters, digits, and hyphens, not starting or ending with a hyphen.
  • create with no arguments asks for the name, use case, language, and template.
  • create copies the template into my-first-actor/, sets the Actor name in package.json and .actor/scrapely.json, makes a first Git commit, and runs npm install. Skip the last two with --skip-git-init and --skip-dependency-install.

The templates come from the platform catalog (scrapely templates ls); sources are in scrapely-app/actor-templates.

TemplateLanguageWhat it does
crawlee-cheerio-jsJavaScriptHTTP crawler that parses HTML with Cheerio. No browser
crawlee-playwrightJavaScriptBrowser crawler with Playwright and Chromium
crawlee-puppeteer-chromeJavaScriptBrowser crawler with Puppeteer and Chrome
crawlee-playwright-tsTypeScriptBrowser crawler with Playwright and Chromium
js-bootstrap-cheerio-crawlerJavaScriptJavaScript minimal site crawler (Crawlee + Cheerio)
js-crawlee-playwright-camoufoxJavaScriptJavaScript stealth crawler (Crawlee + Playwright + Camoufox)
js-cypressJavaScriptJavaScript test runner (Cypress)
js-emptyJavaScriptEmpty JavaScript Actor
js-langchainJavaScriptJavaScript website chat (LangChain)
js-langgraph-agentJavaScriptJavaScript web search agent (LangGraph)
js-standbyJavaScriptJavaScript API Actor
js-startJavaScriptJavaScript one-page scraper (Cheerio)
ts-beeai-agentTypeScriptTypeScript social media agent (BeeAI)
ts-crawlee-cheerioTypeScriptTypeScript site crawler (Crawlee + Cheerio)
ts-crawlee-playwright-camoufoxTypeScriptTypeScript stealth crawler (Crawlee + Playwright + Camoufox)
ts-crawlee-puppeteer-chromeTypeScriptTypeScript browser crawler (Crawlee + Puppeteer + Chrome)
ts-emptyTypeScriptEmpty TypeScript Actor
ts-mastraaiTypeScriptTypeScript social media agent (Mastra)
ts-mcp-emptyTypeScriptTypeScript MCP server
ts-mcp-proxyTypeScriptTypeScript MCP proxy
ts-playwright-test-runnerTypeScriptTypeScript test runner (Playwright)
ts-standbyTypeScriptTypeScript API Actor
ts-startTypeScriptTypeScript one-page scraper (Cheerio)
ts-start-bunTypeScriptTypeScript one-page scraper (Bun + Cheerio)

crawlee-playwright-js and crawlee-puppeteer-js still work as aliases for crawlee-playwright and crawlee-puppeteer-chrome. Browser templates launch Chromium in the container; to offload it, turn on the Scrape.ly browser for the Actor later.

PathPurpose
.actor/scrapely.jsonActor config: name, version, Dockerfile, and the paths to the schemas below
.actor/input_schema.jsonThe input the Actor accepts. The dashboard builds its input form from it
.actor/dataset_schema.json, .actor/output_schema.jsonHow the dashboard displays the results
src/main.jsEntry point. Reads the input and starts the crawler
src/routes.jsRequest handler that runs for every page
DockerfileBuilds on scrapely/actor-node:24-latest
package.jsonDependencies. The SDK isn't listed: the base image provides it

4. Write your Actor

src/main.js reads the input, sets up the platform proxy, and runs the crawler. src/routes.js handles each page; this version also stores the first heading and the link count:

import { CheerioCrawler } from '@crawlee/cheerio';
import { Actor } from 'scrapely';

import { router } from './routes.js';

await Actor.init();

const { startUrls = ['https://crawlee.dev'], maxRequestsPerCrawl = 100 } = (await Actor.getInput()) ?? {};

const proxyConfiguration = await Actor.createProxyConfiguration({ checkAccess: true });

const crawler = new CheerioCrawler({
    proxyConfiguration,
    maxRequestsPerCrawl,
    requestHandler: router,
});

await crawler.run(startUrls);

await Actor.exit();
CallDoes
enqueueLinks()Adds links on the same domain to the crawl
pushData()Appends one item to the run's default dataset
maxRequestsPerCrawlStops the crawl after that many pages

5. Push and build

.bash
scrapely push

The first push creates the Actor in your account, uploads the source as version 0.0 with build tag latest, writes the Actor ID into .actor/scrapely.json, then builds and waits. A failed build prints its log and exits non-zero. Later pushes update the same Actor and always rebuild.

6. Run it

.bash
scrapely call -i '{"startUrls":[{"url":"https://crawlee.dev"}],"maxRequestsPerCrawl":10}' -o

call starts a run on the platform and streams the log until it finishes. -o prints the dataset items when it succeeds.

Input sourceFlag
Inline JSON-i '<json>'
A file, or stdin-f input.json, -f -
None givenstorage/key_value_stores/default/INPUT.json if it exists, otherwise no input (the Actor uses its defaults)

7. Get the results

.bash
scrapely runs ls --desc          # this Actor's runs, newest first
scrapely runs info <runId>       # shows the run's Dataset ID
scrapely datasets get-items <datasetId> --format csv > results.csv

--format accepts json (default), jsonl, csv, html, rss, xml, and xlsx, written to stdout. To browse the log and dataset in the dashboard, open https://my.scrape.ly/actors/<actorId>, or use scrapely push --open.

Next steps

Troubleshooting

ProblemFix
scrapely: command not foundnpm's global bin directory isn't on your PATH. Add it, or use npx scrapely-cli
You are not logged in, or a 401The token is missing or expired (browser tokens last 24 hours by default). Run scrapely login. Check SCRAPELY_API_URL and scrapely info if you hit the wrong API
Directory "my-first-actor" already existsPick another name or remove the folder. create never writes into an existing directory
create can't download the templateIt runs git clone against GitHub. Install Git and check you can reach github.com
The build failspush prints the log; see also scrapely builds log <buildId>. Often a file is missing from the upload: push skips node_modules, .git, storage, dist, .env, *.log, and anything matched by .gitignore and .actorignore
The run failsscrapely runs log <runId>. Check the input matches .actor/input_schema.json; in the Cheerio template, startUrls is a list of { "url": "…" } objects