Search API Client for Javascript
What is Algolia
  • Batching via iterators to optimize number of network calls
  • Zero downtime reindexing feature
  • Version

    • Works in node and all browsers (including IE11+)
    • Built with TypeScript" down from "Features" to match the Autocomplete libraries

    Related Integrations

    Key links


    Get started

    First, install Algolia JavaScript API Client via the npm package manager: (if needed, get a free account here)

    1npm install algoliasearch

    Then, create objects on your index:

    1const algoliasearch = require("algoliasearch");
    2
    3const client = algoliasearch("YourApplicationID", "YourAdminAPIKey");
    4const index = client.initIndex("your_index_name");
    56const objects = [
    7  {
    8    objectID: 1,
    9    name: "Foo"
    10  }
    11];
    1213index
    14  .saveObjects(objects)
    15  .then(({ objectIDs }) => {
    16    console.log(objectIDs);
    17  })
    18  .catch(err => {
    19    console.log(err);
    20  });

    Finally, let's actually search using the search method:

    1index
    2  .search("Fo")
    3  .then(({ hits }) => {
    4    console.log(hits);
    5  })
    6  .catch(err => {
    7    console.log(err);
    8  });
    Get started for freeExplore all developer docs

    Built with JavaScript on Algolia

    Showcase
    Sample Applications

    Search with Salesforce Data

    Learn how to import your existing data in Salesforce using Algolia API clients

    • javascript
    • Algolia Labs
    By
      Algolia Labs
    Showcase
    Sample Applications

    Search with Google Drive data

    Learn how to import your existing data in Google Drive using Algolia API clients

    • javascript
    Showcase
    Sample Applications

    Search with Confluence Data

    Import your existing data in Confluence using Algolia API clients

    • javascript