tencent cloud

All product documents
Tencent Cloud Super App as a Service
Searching Mini Programs
Last updated: 2025-02-24 19:34:38
Searching Mini Programs
Last updated: 2025-02-24 19:34:38
The mini program SDK provides an API for searching mini programs online 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 obtain the search results of the mini program.
/** * Mini program search * * @param searchOptions * @param callback */ public static void searchMiniApp(SearchOptions searchOptions, MiniCallback&lt;List<MiniApp>> callback)

Search by keyword

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

Search by a single category

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

Search by dual categories

Note:
The result will be the intersection of the two categories.
Example:
SearchOptions searchOptions = new SearchOptions("","Category name","Category name 2");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback&lt;List<MiniApp>>() {
@Override
public void value(int code, String msg, List<MiniApp> data) {
if (code == MiniCode.CODE_OK &amp;&amp; data != null) {
// Search successful, list is not empty
}else{
// Search failed, or list is empty
}
}
});

Search by keyword and categories

Note:
Search by both keyword and categories, and the result will be the intersection of the keyword and category.
Example:
SearchOptions searchOptions = new SearchOptions("keyword","Category name","Category name 2");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback&lt;List<MiniApp>>() {
@Override
public void value(int code, String msg, List<MiniApp> data) {
if (code == MiniCode.CODE_OK &amp;&amp; data != null) {
// Search successful, list is not empty
}else{
// Search failed, or list is empty
}
}
});

Specify search for mini programs or mini games

Note:
Starting from SDK version 2.2.0, the search API supports specifying whether to search for mini games or mini programs. By default, it searches both.
Example:
// Specify search for mini games
SearchOptions searchOptions = new SearchOptions("keyword", MiniEngineType.MiniGame, "Category name", "Category name 2");
TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback&lt;List<MiniApp>>() {
@Override
public void value(int code, String msg, List<MiniApp> data) {
if (code == MiniCode.CODE_OK &amp;&amp; data != null) {
// Search successful, list is not empty
}else{
// Search failed, or list is empty
}
}
});


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

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