This tutorial will guide you through how to get started with Answers UI, a javascript SDK for building great search experiences.

You’ll learn the basics by adding Answers to a local coffee shop. Let’s get started with an example html file. You can copy paste the following into an html file and view it in your browser or use codesandbox.

<!DOCTYPE html>
<html lang="en">

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Answers Test Experience</title>
    <!-- Answers CSS-->
    <link rel="stylesheet" type="text/css" href="https://assets.sitescdn.net/answers/v1/answers.css" />

    <!-- Answers Layout styling -->
        .answers-layout {
            max-width: 50rem;
            margin: auto;

    <!-- Answers JS-->
    <script src="https://assets.sitescdn.net/answers/v1/answers.min.js"></script>


    <div class="answers-layout">
        <div class="search-bar"></div>
        <div class="spell-check"></div>
        <div class="direct-answer"></div>
        <div class="universal-results"></div>
        <div class="location-bias"></div>

        apiKey: "3517add824e992916861b76e456724d9",  //sample test experience
        experienceKey: "answers-js-docs", //sample test experience
        businessId: "3215760",  //sample test experience
        experienceVersion: "PRODUCTION",
        onReady: function () {
            // init components
            this.addComponent("SearchBar", {
                container: ".search-bar",
                placeholderText: "Questions? I got Answers"
            this.addComponent("SpellCheck", {
                container: ".spell-check"
            this.addComponent("DirectAnswer", {
                container: ".direct-answer"
            this.addComponent("UniversalResults", {
                container: ".universal-results"
            this.addComponent("LocationBias", {
                container: ".location-bias"


Let’s get started!