Squid processors are standard Node.js processes, enabling you to fetch data from external APIs or IPFS gateways right in the batch handler. This allows you to enrich blockchain data with off-chain information.
For squids deployed to SQD Cloud, use API calls in combination with
API keys set via secrets for secure access.
External API Integration
Price Data Example
You can enrich indexed transactions with historical price data using external APIs like CoinGecko:
Use caching mechanisms to avoid hitting rate limits and improve performance
when fetching external data.
The example above awaits an external call for every transaction, which can dominate sync time. Fetch each distinct input (e.g. one price per day) once and reuse it, and keep database writes batched as described in the batch processing guide.
IPFS Integration
For reliable indexing of content stored on IPFS (e.g., NFT metadata), we recommend using dedicated IPFS gateways like those provided by Filebase.
Public IPFS gateways may have rate limits and reliability issues. Use
dedicated gateways for production squids.
IPFS Fetching Example
Using IPFS in Processor