- a shade, a CSS color name such as
darkseagreen,navy, orgoldenrod - a color family, one of 12 broad colors such as
green,blue, orbrown
GET /v1/taxonomy/colors returns every accepted value. To see it working, open the Shop by color palette.
Three ways to ask for a color
All three are sent to
POST /v1/products/search.
Put the color in the query
The simplest option is to pass the shopper’s words inq. StoreRouter reads the color as one shade and filters by it:
effectiveQuery as a facet with source: "generated":
color or color_family facet. Either one replaces the color read from the text. To drop the color filter altogether, send "omit_generated_facets": ["color"]. See Control query understanding.
Filter by one shade
Use thecolor facet when you already know the exact shade, such as from a color picker or a swatch the shopper tapped:
color facet takes CSS color names in lowercase without spaces, such as darkseagreen, navy, maroon, or ivory. There are two more values: bronze, and multi for products that have several colors. To get all 150, see List the accepted colors. A value that is not a shade name, such as "sage", returns a 422:
q and read the color facet from effectiveQuery.
attribute_facets.color is a separate filter. It holds taxonomy color values, such as color__navy and color__clear, which are listed at GET /v1/taxonomy/attributes/color/values. They are not shades, and sending one as a color value returns a 422. For “find this color” use cases, use color or color_family.Filter by a color family
Usecolor_family when the shopper names a broad color, or when you want more results than one shade gives:
limegreen, lightseagreen, and darkolivegreen shirts in the same results. There are 12 color families:
white · gray · black · red · orange · brown · yellow · green · blue · purple · pink · multicolor
Beige, camel, and tan are part of brown. Ivory and linen are part of white. Each shade belongs to exactly one family. For example, darkseagreen belongs to green, maroon to red, and goldenrod to yellow.
To match more than one color, list several values in one facet, such as {"name": "color_family", "values": ["black", "gray"]}. To remove a color instead, send the same facet in exclude_facets.
List the accepted colors
GET /v1/taxonomy/colors returns every value the color_family and color facets accept, with each shade’s family. Use it to build a color picker, to check a value before sending it, or to give an agent the full list:
color lists all 150 shades. Every value can be sent back unchanged in a facets entry, and each shade’s colorFamily is itself a color_family value. To build a “green, then its shades” picker, keep the shades whose colorFamily is green.
The list changes only when StoreRouter adds a value, so you can cache it; the response allows caching for a day. The request is not billed. Agents connected through MCP can call the taxonomy_colors tool, which returns the same list.
The list says which values are valid, not which ones a store has products in. To see what’s in stock, use facet-counts.
Search one store or all of them
Leave outcatalogs to search every store your key can access. Send catalogs to search only certain stores:
q to list a store’s products in a color with no search text. Add a category facet such as category_path.depth_2 to narrow results to one kind of product.
Read each result’s color
When a search filters by color, each result is the specific color version of the product that matched, not the product in general. For example, a shirt sold in six colors comes back as its sage version, andproductUrl opens the page for that color. Each result has these color fields:
primaryColor and hexCode are left out of results that don’t have them, so show a fallback swatch when they are missing. You can use the color shade or color_family instead.
Show the colors available
To build color filter chips or a palette with counts, callPOST /v1/products/facet-counts. It counts the products that match each color family or each shade. It takes the same filters as search, so each count matches the results that selecting that color would return.
Count color families
color_family facet. Add catalogs to count one store’s colors.
Count the shades in a family
Sendcolor in facet_names to count shades. To count the shades of the items in one family, add that family as a facet:
white, which is not a green shade. To build a “green, then its shades” picker, keep only the values whose colorFamily is green in GET /v1/taxonomy/colors:
- Counts are per color version. With
colorinfacet_names, every count in the response counts the color versions of products, the same thing acolorsearch returns. - Shades can add up to more than the total. A product with several shades, such as
["red", "white"], counts once under each. - Your own
colorfacet is ignored. As with every counted facet, acolorcount ignores anycolorfacet you send, so each shade shows what selecting it would return. Other facets, such ascolor_familyabove, still apply. - You get every shade by default.
value_limitdefaults to 150, the number of shades.
The Python and TypeScript SDKs accept
color in facet_names from their next release. Until then, use the REST request above.Tips
- Start broad. A single shade can be narrow in a small store. If a
colorsearch returns few results, try that shade’scolor_family. - Let
relaxfall back. Withrelax: true, a query that returns nothing drops filters in stages, and color is one of the filters it can drop. Acolororcolor_familyfacet you send is never dropped unless you mark it"relaxable": true. Seerelax. - Report what ran. Show shoppers the color in
effectiveQuery, such as “Showing sage green”, so they can correct it. - Use full product details. Use the result’s
productUrlwith product lookup to get every color the product comes in, withcolors[].hexCodefor each.
Related
- Catalog Search: every search field and facet
- List taxonomy colors: the accepted
colorandcolor_familyvalues - Search products API reference
- Shop by color: a live palette of every store, with the request behind it