Back to APIs
Meilisearch
Meilisearch is a fast, typo-tolerant, open source search engine with a clean API and strong developer experience.
Base URL
https://ms-YOUR_ID.meilisearch.ioopen sourceinstanttypo tolerancefacetingself-host
Endpoints
POST
/indexes/{uid}/searchSearch an index for matching documents.
const response = await fetch("https://ms-YOUR_ID.meilisearch.io/indexes/movies/search", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
body: JSON.stringify({
"q": "batman",
"limit": 5,
"facets": [
"genre"
]
})
});
const data = await response.json();
console.log(data);Response Preview
{
"hits": [{
"id": 29751,
"title": "Batman Begins",
"genre": ["Action", "Drama"],
"_formatted": { "title": "<em>Batman</em> Begins" }
}],
"estimatedTotalHits": 4,
"processingTimeMs": 1,
"query": "batman"
}