Skip to content

xhs_publish_content ​

Publish image/text note or save as draft.

Parameters ​

ParameterTypeRequiredDescription
titlestringYesTitle (max 20 chars)
contentstringYesContent
imagesstring[]YesArray of absolute image paths
tagsstring[]NoTopic tags
scheduleTimestringNoScheduled time (ISO 8601)
saveDraftbooleanNoSave as draft instead of publishing, default false
accountstringNoAccount to use
accountsstring[] | "all"NoMulti-account publish

Response ​

json
{
  "success": true,
  "noteId": "xxx"
}

Example ​

Basic publish ​

xhs_publish_content({
  title: "Today's Share",
  content: "Content here...",
  images: ["/path/to/image1.jpg", "/path/to/image2.jpg"]
})

Save as draft ​

xhs_publish_content({
  title: "Draft Title",
  content: "Save now, publish later...",
  images: ["/path/to/image.jpg"],
  saveDraft: true
})

With tags ​

xhs_publish_content({
  title: "OOTD",
  content: "Today's outfit...",
  images: ["/path/to/ootd.jpg"],
  tags: ["fashion", "daily", "style"]
})

Scheduled publish ​

xhs_publish_content({
  title: "Good Morning",
  content: "...",
  images: ["/path/to/image.jpg"],
  scheduleTime: "2024-01-20T08:00:00+08:00"
})

Multi-account ​

xhs_publish_content({
  title: "...",
  content: "...",
  images: [...],
  accounts: ["acc1", "acc2"]
})

Notes ​

  • Image paths must be absolute
  • Title max 20 characters
  • Requires visible browser window
  • Drafts are saved to Xiaohongshu Creator Center

Released under the MIT License.