Skip to main content
Image (visual) search takes one image source and returns matching products. In the browser use the SearchApp’s imageSearch method; for SSR use the standalone fetchImageSearch.
Prerequisite: the search app is registered (.use(search())), your app is wrapped in <GloodProvider>, and https://search.glood.ai is in your CSP connectSrc. See Installation.

1. Get the image as a data: URL

Pass exactly one source: image (base64 or a data: URL) or imageUrl (an http(s) URL, fetched server-side). From a file input, convert to a data: URL:
Retrieve the SearchApp via useGloodAnalytics().getApp('search') and call imageSearch:
Params are an ImageSearchParams; res is an ImageSearchResponse and each product is a SearchProduct.
imageSearch always runs against the app’s controlEndpoint (non-edge) — the vision pipeline isn’t available on regional edges. This routing is automatic; see Configuration → Edge vs. non-edge routing.

3. Image constraints

Images are validated server-side; anything outside these returns 400:

4. From a URL, or on the server

Pass imageUrl instead of image to search by a hosted image, and use fetchImageSearch when you don’t have a React component (loaders, mobile backends):

5. Attribution

Attribute clicks with search_type: 'image' via the SearchApp track helpers (trackResultClick), each taking a SearchTrack:

See also