ArakunDocsDownloadarakun on GitHub

The arakun command

Fetch web pages

Read a web page or a whole site as Markdown with arakun fetch and arakun crawl, loaded in a real browser on Cloudflare Browser Run.

On this page
  1. Set up a token
  2. Fetch a page
  3. Crawl a site
  4. Limits

Some pages need JavaScript to show anything. arakun fetch and arakun crawl load them in Cloudflare Browser Run, a real browser on Cloudflare's network, and give back Markdown an agent can read.

They work without a running Arakun.

#Set up a token

  1. Create a Cloudflare API token

    Give it the Browser Run - Edit permission. The cf sign-in doesn't carry it.

  2. Store it with its account

    sh
    arakun fetch --set-token <account-id> < token.txt

    The token is read from stdin and kept in the system keyring.

Or set CLOUDFLARE_BROWSER_RUN_TOKEN and CLOUDFLARE_ACCOUNT_ID instead.

#Fetch a page

sh
arakun fetch https://example.com          # the page as Markdown
arakun fetch --html https://example.com   # the rendered HTML
arakun fetch --links https://example.com  # the links on the page

#Crawl a site

sh
arakun crawl --limit 50 --depth 2 https://example.com/docs

This prints the site's pages as Markdown, one after another, as they are read.

--limit N

The maximum number of pages to read. The default is 20.

--depth N

How many links deep to go from the first page.

--render

Run each page's JavaScript before reading it.

--include <glob>

Read only pages whose address matches. Repeat it for more patterns.

--exclude <glob>

Skip pages whose address matches. Repeat it for more patterns.

A crawl gives up after 30 minutes.

#Limits

  • What you can fetch depends on your Workers plan. On a rate limit, Arakun waits and tries again a few times.
  • It does not get past captchas.
  • arakun crawl honors robots.txt and Content Signals.

Did this page help?

Tell us about a mistake on this page, or ask for help with Arakun.