Skip to content
nsin docs

Downloading Your Cached Files

The Cached items list shows what’s stored. nsin-dump-cache.sh downloads the files from your terminal, one folder per domain, keeping paths and filenames.

Files come straight from cache storage, not your site, so a dead origin makes no difference.

nsin-dump-cache.sh

Terminal window
curl -o nsin-dump-cache.sh https://nsin.ir/docs/nsin-dump-cache.sh
chmod +x nsin-dump-cache.sh

Needs only python3 — already on macOS and most Linux.

Create a key at panel.nsin.ir → Settings → API Keys and export it:

Terminal window
export NSIN_API_KEY="nsin_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

A read-only key is enough. See API keys.

Terminal window
# One domain (at least one is required)
./nsin-dump-cache.sh example.com
# Several at once — each gets its own folder
./nsin-dump-cache.sh example.com shop.example.com example.ir
# A different edge location, images only, into a chosen folder, 12 at a time
./nsin-dump-cache.sh example.com --node TH --images --out ~/backup -j 12

Live progress per domain: objects done, bytes, speed, and ETA.

▶ example.com
registry: 1284 cached entries at node IR
1190 unique URLs, 1190 objects to fetch
✓ example.com/assets/hero.webp 184.2 KB
✓ example.com/assets/app.4f2c.js 92.7 KB
⊙ example.com/old/banner.png no longer cached
████████████████▍ example.com
58% 690/1190 ↓684 ⊙6 214.6 MB · 5.1 MB/s ETA 01:24

Your site caches separately per nsin location; --node picks which copy to download:

Terminal window
./nsin-dump-cache.sh example.com # IR, the default
./nsin-dump-cache.sh example.com --node TH
./nsin-dump-cache.sh example.com --node any # whichever copy is listed first

Node names match Cached items, case-sensitive; an empty location lists the ones that aren’t:

nothing at node NY. cached at: IR (1284), TH (233)

--node any gives the widest coverage, pulling whichever copy exists.

Files land under the current folder (or --out), one folder per domain:

example.com/
├── index.html
├── assets/
│ ├── hero.webp
│ └── app.4f2c.js
└── cdn.example.com/ ← other hostnames get their own subfolder
└── logo.png
  • Subdomains and wildcards get their own subfolder — no /logo.png collisions.
  • No-extension files are named by content type — /media/8412 as WebP saves as 8412.webp.
  • Different query strings on one address (/search?q=a, /search?q=b) get a suffix per copy: search~e244bbd4.html, search~a96c6999.html.
  • Files come out uncompressed, as stored, even if gzipped for visitors.
FlagEnvironment variableWhat it does
--node NAME, -nNSIN_NODEWhich location’s copy to take. Default IR; any takes whatever’s listed.
--images, -iIMAGES=1Only images; default takes everything.
--out DIR, -oOUTDIRWhere to write. Default: current folder.
-j NCONCURRENCYHow many downloads at once. Default 8.
-kINSECURE=1Skip HTTPS certificate checks.
-h—Show help.
—NSIN_API_KEYRequired. Your API key.
—NSIN_APIAPI base URL; default https://api.nsin.ir.

Two API calls per object, both to api.nsin.ir:

  1. List — GET /domains/<domain>/cache/keys, paged and filtered to the node. Same data as the panel’s Cached items table.
  2. Download — GET /domains/<domain>/cache/keys/content per row, returning that entry’s stored bytes.

Each entry is keyed by hostname, node and key_hash. Nothing touches your site: no DNS, no edge request, no server request.

It says “not found, or this key’s user has no access”. Spell the domain exactly as your panel shows it — the key’s account must own, or have been shared, that domain.

I get far fewer files than the panel’s item count. The panel’s count covers every location; a --node run only takes that location’s copies. Try --node any.

Can I use it to migrate a site? You get cached, public files — useful, not a backup. Login-only, uncached, or unvisited pages were never stored.