Search

Search the catalog for items matching the query string

Parameters

To use XO Search, you only need to get the token from the search tab in the XO Console. You can also get it directly from this address.

Name
Type
Is Required?

token

string

✅

query

string

✖

token

The XO Search API token.

You can get it from this page.

query

The text query used to perform a search through the catalog.

Notes

  • If query is not specified, all items from the catalog will be fetched.

Response

All responses from XO Search uses the same format. Check API Reference page for a more detailed description of this format.

API Reference

Usage example

NodeJS / NPM example

import { search } from '@attraqt/search';

const query = 'T-shirt';

search.init({ token: SEARCH_API_TOKEN });

const response = await search.query(query);
console.log(response);

HTML example

<script type="text/javascript">
    xo.init({
        search: {
            token: SEARCH_API_TOKEN
        }
    });

    xo.search.query('T-Shirt').then((response) => {
        console.log(response);
    });
</script>

Last updated