Skip to main content
This example stores a small product catalog in a private silo and shows how to read parts of it without downloading the whole thing. You will use: a private silo, an Access Key, Query, and Search.

The data

Create a Private silo named catalog with this JSON. Search works on a top-level array, so the products are the root of the document.
catalog.json
Every request below goes to your silo URL with your Access Key:
Terminal

Recipes

Get one product by position

idx picks one item from the array, counting from 0.
Response
Add path to idx to read a single field.
Response
output converts the value picked by path. Here the price comes back as text.
Response
Search with op=lt (less than). gt and lt compare as numbers.
Response
il matches a pattern, ignoring case. % is the wildcard and must be sent as %25 in a URL.
Response
A double dot (..) looks inside an array on each product. A product matches when any of its tags matches.
Response
Repeat q, value, and op for each condition. All of them must match.
Only one product matches, so it comes back on its own, not in an array:
Response
Add path to a search to pick one field from each match.
Response

A small client

Search returns an array for two or more matches, a single object for one match, and 404 for none. This helper smooths that out, so your code always gets an array.
A 404 can also mean a wrong UUID or region. If every search returns nothing, read the silo without parameters first to check the URL.

Good to know

  • Results are cached for up to 5 minutes. A search right after you update the catalog may return the previous data.
  • Every query is a read. Queries and searches count towards the silo’s rate limit like any other private silo read.
  • No sorting or paging. Sort and slice the results in your own code.
  • Private silos only. A public silo always returns the whole document.