zshot/cliDownload

SQLite

Output type
sqlite
Extension
.sqlite
LicensePro

A page or a crawl as one SQLite database you can search and query. It holds what a WARC holds — every exchange with its body, which page it belongs to, and which responses revisit a stored payload — beside each page’s rendered HTML, text and screenshot, and the links a crawl followed.

TableHolds
crawlThe capture: the zshot version, target URL and command line
pagesEach page’s URL, title, HTML, innerText, screenshot and the page whose link led to it
resourcesEach HTTP exchange, its headers as JSON
payloadsEach response body once, by digest
page_resourcesWhich page loaded each exchange, and whether it was served in full or as a revisit
linksEach link a crawled page offered, and what the crawl made of it
pages_fts, payloads_ftsFull-text search over page text and text bodies
headersEach exchange’s headers, one per row, names lowercased

--sqlite PATH writes one beside any other output. latest.sql documents every column. /schemas/sqlite/<version>.sql holds each release’s.

Example

Run locally
zshot -f winnie-the-pooh.sqlite \
  --crawl-links \
  --crawl-link-depth 1 \
  https://zshot-cli.com/example_assets/winnie-the-pooh/

Queries

Pages that mention a word, with the matching text:

SELECT p.url, snippet(pages_fts, 1, '[', ']', '…', 10)
FROM pages_fts JOIN pages p ON p.id = pages_fts.rowid
WHERE pages_fts MATCH 'honey';

What one page loaded, and how:

SELECT resource_url, status, served, revisit_reason, size
FROM page_resources_v WHERE page_url LIKE '%/chapter-1%';

Responses a server told caches not to store:

SELECT r.url, h.value
FROM headers h JOIN resources r ON r.id = h.resource_id
WHERE h.direction = 'response' AND h.name = 'cache-control' AND h.value LIKE '%no-store%';

Each revisit, and the page that stored its payload:

SELECT page_url, resource_url, revisit_reason, original_page_id FROM revisits_v;