Skip to main content
Version: Next


Baidu Smart-Program can access Baidu Search and Baidu App. setPageInfo is responsible for setting up all kinds of basic page information for the mini program, including title, keywords, page description, as well as image information and video information.By setting page information for the mini program, the developer can help the mini program to be displayed and distributed more effectively in search engines and information flow.



(option: Option) => void



titlestringYesPage title
keywordsstringYesPage keywords
descriptionstringYesPage description
releaseDatestringNoOriginal release time (year-month-day hour:minute:second with leading zeros)
articleTitlestringNoArticle (content) title.
imagestring | string[]NoImage online address for cover display after infomercial placement, maximum 3 images, single image maximum 2M;
Recommended size of cover image: height>=210px & width>=375px;
Minimum size: height>=146px & width>=218px.
For multiple images, use an array.
videoVideoNoVideo information. Representation of multiple videos in an array
visitVisitNoInformation for visit
likesstringNoThe number of likes, if the page is not counted is empty.
commentsstringNoThe number of comments, if the page is not counted is empty.
collectsstringNoThe number of collects, if the page is not counted is empty.
sharesstringNoThe number of shares, if the page is not counted is empty.
followersstringNoThe number of followers, if the page is not counted is empty.
complete(res: any) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: any) => voidNoThe callback function for a failed API call
success(res: Result) => voidNoThe callback function for a successful API call


urlstringAddress of the video
durationstringDuration of the video (in seconds)
imagestringCover image of the video


pvstringNoPage views
uvstringNoUnique views
sessionDurationstringNoLength of stay per user on the page, in seconds.

Sample Code

title: 'title',
keywords: 'keywords',
description: 'description',
articleTitle: 'articleTitle',
releaseDate: '2019-01-02 12:01:30',
image: [
video: [{
url: '',
duration: '100',
image: ''
visit: {
pv: '1000',
uv: '100',
sessionDuration: '130'
likes: '75',
comments: '13',
collects: '23',
shares: '8',
followers: '35',
success: res => {
console.log('setPageInfo success');
fail: err => {
console.log('setPageInfo fail', err);

API Support

APIWeChat Mini-ProgramBaidu Smart-ProgramH5React Native