Setup Image Search
Learn how to setup image search with Trieve
Overview
Trieve provides a simple way to integrate image search into your application. This guide will walk you through the steps to set up image search with Trieve.
For a full implementation example, take a look at the way we implement image search in our search component.
Uploading an Image
1. Allow Users to Select an Image
To let users upload an image, use an <input>
element with a file picker. Here’s a simple React component for an image uploader:
2. Upload the Image to Trieve
After the user selects an image, you can either upload it to Trieve and get a URL for it or use your own CDN. Here’s how you can do it with Trieve:
Running an Image Search
Once you have the uploaded image’s URL, you can use it to search for visually similar images.
1. Perform an Image Search
Pass the image URL into a search query using Trieve’s SDK:
2. Display Search Results
Once you get the results, you can display them in your UI as thumbnails, links, or however you’d like.
Was this page helpful?