Semantic search API: what it is and how to choose one
A semantic search API is a service you send a text to, and it returns the elements in your catalogue with the closest meaning, even if they do not share a single word. It saves you choosing an embedding model, computing and storing the vectors, building the index and keeping it running: you upload the data and make an HTTP call.
By Joan Martorell
What exactly does a semantic search API do?
Three things, always the same, whatever the provider:
- It indexes your catalogue. It turns each element into a numeric vector, called an embedding, that represents its meaning. Two texts that mean the same end up close together, even if they use different words.
- It turns each query into a vector with the same model.
- It returns the elements closest to the query, ordered by a similarity score.
That is why “cordless earphones for running” can return “Bluetooth sports headphones”: they share no words, but their vectors are close.
How is it different from a keyword search engine?
A keyword search engine compares letters: it finds what contains the terms of the query. It works very well with codes, references and exact names, and fails with synonyms and with queries that describe a need. A semantic one does the opposite. The best results come from combining the two, and that is called hybrid search. We cover it in semantic search versus keyword search.
What do I need to use one?
- Your data as short texts: one product, one article or one question per element.
- An API key, which is secret and lives on your server.
- An HTTP call from your server every time someone searches.
With XEYE, this is the call. The list name and the search text are the only required fields:
curl -X POST https://search.xeye.es/api/v1/search \
-H "Content-Type: application/json" \
-H "X-API-Key: $XEYE_API_KEY" \
-d '{
"list_name": "products",
"search_term": "cordless earphones for running",
"limit": 5
}'
And the response brings each result with its score and with the parameters you stored alongside the element, so you can render it without a second query:
{
"success": true,
"results": [
{
"item": "Wireless Bluetooth headphones with noise cancelling",
"score": 0.93,
"params": {
"id": 1842,
"sku": "HP-BT-900",
"url": "/products/bluetooth-headphones-900",
"price": 89.9
}
}
],
"total_results": 1,
"duration_ms": 42
}
The full reference for parameters, errors and limits is in the API integration guide.
What should I look at when choosing one?
| Criterion | Why it matters | What XEYE offers |
|---|---|---|
| Type of search | Semantic search alone fails with typos and codes; hybrid search covers both cases. | Hybrid: fuzzy text matching and semantic matching on every query. |
| Languages | The model must understand the language of your catalogue and of your users. | Two multilingual models. The measured results are in Spanish. |
| How the data gets in | It decides how much work it takes to keep the catalogue up to date. | Web console and JSON import. There is no automatic sync and no upload API. |
| Latency | It adds to the response time of your own page. | 28 to 55 ms on average on the server with the default model, measured. |
| Price | A flat fee is expensive at low volume; pay per use is expensive at high volume. | Pay per use: €0.001 per search, no fee. See pricing. |
| Filters and facets | Needed if your users narrow down by price, size or category. | None. It returns your parameters and you do the filtering. |
| Limits and guarantees | They matter if your business depends on search. | 120 searches per minute per account. There is no service level agreement. |
When do I not need one?
- If your users search mostly by exact code or reference, a keyword search engine is enough and cheaper.
- If you need facets, filters and results as you type with the interface included, a full search product suits you better. We compare them in XEYE versus Algolia.
- If your data is already in PostgreSQL and you have someone to code it, you can do it in your own database. We compare them in XEYE versus pgvector.
- If you handle millions of documents or need aggregations, see XEYE versus Elasticsearch.
How do I get started with XEYE?
- Create an account. You start with welcome credit and no card is needed.
- Create a list, mark it as public and add elements by hand or by importing a JSON file.
- Launch the training from the Trainings tab and wait for it to finish.
- Try searches in the console playground, which is free.
- Create an API key and call the endpoint from your server.
The full walkthrough, step by step, is in getting started. If you use Nuxt, Shopify or WooCommerce, there is a tutorial for each in resources.
Frequently asked questions
What is an embedding?
- A list of numbers that represents the meaning of a text. It is computed by a language model trained so that texts with similar meaning give similar numbers. Searching by meaning is searching for the embeddings closest to that of the query.
Does it work in languages other than English?
- XEYE uses multilingual models. All our measurements were made with catalogues and queries in Spanish, and we have not measured other languages. The results are in measured results.
Can I call the API directly from the browser?
- You should not. The API key is secret: whoever has it can search your public lists and spend your credit. The call is made from your server or from an intermediate function. The integration tutorials include that intermediary.
Do I have to train an AI model?
- No. The models are already trained. What XEYE calls training is computing the embeddings of your list, and optionally generating AI descriptions for each element. You launch it with a button.
Try it with your own data
Create an account, upload a list and run your first search in about five minutes. You start with €5 of credit, no card required.
Keep reading
- Semantic search versus keyword searchKeyword search compares letters and semantic search compares meanings. When each one gets it right, what hybrid search is and measured data.
- Semantic search for your online shop: how to set it upHow to add search that understands synonyms, intent and typos to an online shop: the data it needs, the steps to set it up and what it does not do.
- Measured results: XEYE accuracy and latencyTop-1 of 0.91 on a catalogue of 10 products, 0.85 with 250 elements and 0.49 with 4,727 codes. Mean latency of 28 to 55 ms. Methodology and limits.