Skip to main content

Recipe

This recipe shows how to use persistentStore (TypeScript) or persistent_store (Python) to cache scraped data across executions of the same project.
TypeScript

How it works

  1. Check the cache — Use persistentStore.get() / persistent_store.get() to look for existing data.
  2. Return cached data — If found, return immediately without re-scraping.
  3. Scrape and store — On cache miss, navigate to the page, extract data, and store it with persistentStore.set() / persistent_store.set() for future runs.
Data persists across all executions within the same project, making it ideal for data that doesn’t change frequently.

persistentStore (TypeScript)

TypeScript SDK helper for persistent key-value storage

persistent_store (Python)

Python SDK helper for persistent key-value storage