Shop by color
Mixing the palette…
Shop by color
Every Reformation product is tagged with a shade and a color family, so your app can filter its catalog by the color a shopper asks for. See the request.
Build it
Add a color_family facet for every shade of a broad color, or a color facet for one shade (a CSS color name such as darkseagreen). catalogs keeps the search to Reformation; leave it out to search every store. A color in the query itself (“sage green linen shirt”) resolves to a shade on its own.
curl -sS https://api.storerouter.ai/v1/products/search \ -H "Authorization: Bearer $OCTOGEN_PLATFORM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "catalogs": ["thereformation"], "facets": [ {"name":"color_family","values":["black"]} ], "limit": 10 }'# Requires Python 3.11+ and uv; install from the public SDK repository:
# git clone https://github.com/octogen-ai/octogen-dev.git
# cd octogen-dev
# uv sync --project sdks/python
# Save this sample as search.py here, then run:
# uv run --project sdks/python python search.py
import asyncio
from octogen_ai_sdk import OctogenClient
async def main() -> None:
async with OctogenClient(base_url="https://api.storerouter.ai/v1") as client:
page = await client.search_products(
catalogs=["thereformation"],
facets=[
{"name": "color_family", "values": ["black"]},
],
limit=10,
)
for product in page.items:
print(product.title, product.current_price, product.product_url)
asyncio.run(main())// Node.js 20+; install: npm install @octogen-ai/sdk
// Save this sample as search.mjs, then run: node search.mjs
import { OctogenClient } from "@octogen-ai/sdk";
const client = new OctogenClient({ baseUrl: "https://api.storerouter.ai/v1" });
const page = await client.searchProducts({
catalogs: ["thereformation"],
facets: [
{ name: "color_family", values: ["black"] },
],
limit: 10,
});
for (const product of page.items) {
console.log(product.title, product.currentPrice, product.productUrl);
}