APIYard
Back to APIs
SearchAPI KeyFree tier

Algolia

Algolia provides AI-powered search with sub-10ms response times, typo tolerance, faceting, and personalization.

Base URL

https://YOUR_APP_ID-dsn.algolia.net
full-textfacetingtypo toleranceAIrealtime

Endpoints

POST/1/indexes/{index}/query

Search an Algolia index for matching records.

const response = await fetch("https://YOUR_APP_ID-dsn.algolia.net/1/indexes/products/query", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "X-Algolia-Application-Id": "YOUR_APP_ID",
  "X-Algolia-API-Key": "YOUR_API_KEY"
  },
  body: JSON.stringify({
  "query": "iPhone",
  "hitsPerPage": 5,
  "filters": "in_stock:true"
})
});

const data = await response.json();
console.log(data);

Response Preview

{
  "hits": [{
    "objectID": "prod_123",
    "name": "iPhone 15 Pro",
    "brand": "Apple",
    "price": 999,
    "_highlightResult": { "name": { "value": "<em>iPhone</em> 15 Pro" } }
  }],
  "nbHits": 42,
  "processingTimeMS": 3
}