Search

Let users explore your .appStore

Search has many faces. We will discuss search and it's use cases in your .appStore and how to implement them.

This is the most basic search. Your users will enter a couple of keywords and the API will return responses.

curl --request GET \
     --url 'https://api.meroku.store/api/v1/dapp/search?search=nft+game' \
     --header 'Accept: application/json' \
     --header 'apikey: YOUR_API_KEY'

Rerank

Sometimes, you would want to rerank the default search API response. You can easily construct a reranking function, given the following information.

The responses are ranked in order by relevance. Each response object (.app) also has metrics like relevance score, and usage/engagement metrics in addition to standard metadata like description, screenshots, and more.

If you want to rerank such that .apps with a high rating and long descriptions are ranked above .apps with similar relevance but short descriptions, you can construct one like this:

const descScore = (app) => {
    const len = app.desc.length
    switch (len) {
        case len < LOW_THRESHOLD: return 1;
        case len < MED_THRESHOLD: return 2;
        case len > HIGH_THRESHOLD: return 3;
    }
}

const newScore = (app) => {
    return app.relevance + log(app.metrics.downloads) + descScore(app.desc);
}

const rerank = (appA, appB) => {
    const scoreA = newScore(appA);
    const scoreB = newScore(appB);
    if (scoreA > scoreB) {
        return 1;
    } else if (scoreA === scoreB) {
        return 0;
    }
    return -1;
}

Filters

There are various filter options available in search API. They are documented in the Search API docs at: https://docs.meroku.store/#/operations/searchDapps

Autosuggest

Who doesn't love suggestions when you start typing? There's an API for that. You can perform autosuggest using the AutoComplete API documented at https://docs.meroku.store/#/paths/api-v1-dapp-autocomplete/get

Last updated