tencent cloud

$0 14-Day TrialExperience EdgeOne for acceleration and security protection!

Feedback

Tencent Cloud Mini Program Platform

Searching Mini Programs

Last updated: 2024-11-21 17:27:16
The mini program SDK provides an online search API for mini programs. This API allows you to search for mini programs by keywords and categories.
API description:
Note:
The 'SearchOptions' parameter is used to specify the keywords and category information for the mini program search;
The 'MiniCallback' parameter is used to retrieve the search results of the mini program.
/** * Search for a mini program * * @param searchOptions * @param callback */ public static void searchMiniApp(SearchOptions searchOptions, MiniCallback<List<MiniApp>> callback)

Searching mini program by keyword

Sample code:
SearchOptions searchOptions = new SearchOptions("yourkeyword");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
   @Override
   public void value(int code, String msg, List<MiniApp> data) {
       if (code == MiniCode.CODE_OK && data != null) {
           //Search succeeded. The list is not empty
       }else{
           //Search failed. The list is empty
       }
    }
});

Searching by single category

Sample code:
SearchOptions searchOptions = new SearchOptions("","category name","");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
   @Override
   public void value(int code, String msg, List<MiniApp> data) {
       if (code == MiniCode.CODE_OK && data != null) {
           //Search succeeded. The list is not empty
       }else{
           //Search failed. The list is empty
       }
    }
});

Searching by dual category

Note
The results of a dual category search are the intersection of the two categories.
Sample code:
SearchOptions searchOptions = new SearchOptions("","category name","category name 2");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
   @Override
   public void value(int code, String msg, List<MiniApp> data) {
       if (code == MiniCode.CODE_OK && data != null) {
           //Search succeeded. The list is not empty
       }else{
           //Search failed. The list is empty
       }
    }
});

Searching by keyword and category

Note
When both keyword and category are set as search parameters, the results will be the intersection of the keyword and category.
Sample code:
SearchOptions searchOptions = new SearchOptions("keyword","category name","category name 2");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
   @Override
   public void value(int code, String msg, List<MiniApp> data) {
       if (code == MiniCode.CODE_OK && data != null) {
           //Search succeeded. The list is not empty
       }else{
           //Search failed. The list is empty
       }
    }
});

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon