Weixin APIs - User Published Posts (V1)
Retrieves posts published by a specific Weixin Official Account, including title, author, publish time, content summary, and engagement metrics such as reads, likes, and shares.
Typical use cases:
- Monitoring recent activity of a specific account.
- Analyzing publishing frequency and content types.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Yes | Access token for the API. |
wxid | query | string | Yes | The ID of the Weixin Official Account (e.g., 'rmrbwx'). |
Code Samples
💡 Environment Note
Default samples use https://api.justoneapi.com (prod-global). For users in Mainland China, it is recommended to replace it with http://47.117.133.51:30015 (prod-cn) for better performance. See Environment Guide.
bash
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE"text
I want to use the "User Published Posts (V1)" API from Just One API.
API Endpoint: https://api.justoneapi.com/api/weixin/get-user-post/v1
HTTP Method: GET
Authentication: Append "?token=YOUR_API_KEY" to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/weixin-apis/user-published-posts-v1-en.json
Parameters:
- token (query): Access token for the API. (Required)
- wxid (query): The ID of the Weixin Official Account (e.g., 'rmrbwx'). (Required)
Return format: JSON
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set request timeout to at least 60 seconds.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
Please help me write a script in my preferred programming language to call this API and handle the response.python
# Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE"
response = requests.get(url)
print(response.json())js
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// Tip: For Mainland China, replace https://api.justoneapi.com with http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/weixin/get-user-post/v1?token=YOUR_API_KEY&wxid=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
json
{
"code": 0,
"data": {
"data": [
{
"articles": [
{
"title": "【夜读】总有一个春天,为你而来",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/mmbiz_jpg/QaRWjMxooXvwibHmygVBuDke1VSpSSsSMf5Tw4DC8jLmhXbNUCPxFcoR1CJI0ZZJQLqMzceGiak2zffqpM9PTzLMH3B8Picw9se17lw2Rpiaens/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002217&idx=1&sn=d424167ba5073f6d4bd57eb74a7e5dd9&chksm=bc26aaa0cc21b32078cc0feaa9b558ab8ee25e21734304264c0df2d0521122028d056ba01377&scene=126&sessionid=0#rd"
}
],
"time": 1773063954
},
{
"articles": [
{
"title": "这位人大代表,太飒了!",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/mmbiz_jpg/QaRWjMxooXvUUhXpxPHP2ictibU1ibKXNSkBIbLxTYWBl2XIDH3YayLKHVrXV3X1jMm8VLygQIuM9zo6NZlu7JoCxnqjzSOnUGp6htlwEvhQmU/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002201&idx=1&sn=f79887ca2fd2650bb8dcd34a13b4599a&chksm=bc4ed234facfb37cdb802e1e5a1efbf817f3d8bcf4157c28baffb90ed4a57774040b5f78011c&scene=126&sessionid=0#rd"
}
],
"time": 1773062256
},
{
"articles": [
{
"title": "伊朗宣布新任最高领袖,中方回应",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXtv7HzgbvqI776fFYMOrEOvN5AmSe9rJSrnj17NSCU8owcA0HDBlsPTibYVG5s1tEaBibLx6SG3R7ibgatFy3FN5yNVnP3bSsNJ08/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002184&idx=1&sn=d0ab73698836d0fc9969fea387930fa6&chksm=bcc8a2f77a5ba18fb55083c0365403e7fd613038ed71372cddc8a193e4575fa55b199db3f69c&scene=126&sessionid=0#rd"
}
],
"time": 1773059086
},
{
"articles": [
{
"title": "三连胜!中国女足,小组第一晋级!",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXt2utTANoOfYE6SGZojwic3DtuPdhhYG42TqpJM7Zm74JZT0ReWNMHgqLAE4ribknonJic1VbODdxVf2UF1Ww0Y22L4DX8wd36PAM/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002173&idx=1&sn=0127810edba50a5b82f6e7f36bad44bb&chksm=bcaaa8707861da52ebe6f03c21a2800acdabe4459c8e8d78ce82dc5beafeb471736d3b7a9d28&scene=126&sessionid=0#rd"
}
],
"time": 1773055458
},
{
"articles": [
{
"title": "今天起吃饭注意:减油、增豆、加奶!",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXuctaR5XENVYMJDfUlYxtsGib3tTib7XWWt0sd61O4ibaDcnfKnZmhXGwQCSa88kW8tt3gfpLCSL0r5tq86ja9kiaOlZBp2ePL7UuM/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002129&idx=1&sn=b48a7e005569f8aa33cb0cdfd088a550&chksm=bcad90de4236a3a5ff64f99dfff58675f1c9f3f80bfee913f5a7125ee791f4fd6d22eb933e5f&scene=126&sessionid=0#rd"
}
],
"time": 1773051526
},
{
"articles": [
{
"title": "今晚,油价调整",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/mmbiz_jpg/QaRWjMxooXuKNulz5J8gBE2a1I2SbEtcRvvLwOxfxqwAXSMAXBNqYvnEd0ut2qI8PGbDPbU8o5ib8UVGEDsicEumZlPUC137iaYr9TNvwPPLm8/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002120&idx=1&sn=2529fde5eb27ed120368947e5aa205fe&chksm=bca0a0a7caff8dee9bc3f9248800b02ac7ec21148ab6521f86d18e930bf1e6d3c2b82d7fc2ee&scene=126&sessionid=0#rd"
}
],
"time": 1773049257
},
{
"articles": [
{
"title": "油价“破百”!有哪些影响?",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXtxqAZv8nBGlYrgEx6PkjDnoK5Ub0ISL3YpUygicnuDu2eK466poCMnjkia5LA2aicLLEOHp1ApAicZJm9CFF52e4QGyFtloFrLNvc/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002113&idx=1&sn=abd8b4c9b01757576f2bcfaae5fcedee&chksm=bc192c50c891b35ee6cbb035dd240c60184cce85e27347b4a2de538e41990552275bd73504a9&scene=126&sessionid=0#rd"
}
],
"time": 1773047943
},
{
"articles": [
{
"title": "“您好,可以帮我充话费吗?”大山中,手机欠费的他打通了119……",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/mmbiz_jpg/QaRWjMxooXt2H40iauWjlu2c6mxa3DT0orc2uv575tKt47NA59lIDkgJvwbgWcccJvHVUEVO8aoia9HuCiaU22bHNRSYSYUjndmOXVTXj1liaJg/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002073&idx=1&sn=f96daf166f47d8940a02a25999a02bfa&chksm=bcead80445de6ae741150bd9df1d83499284df892fc833aaeda8520b577ad2c2d266b6c215d2&scene=126&sessionid=0#rd"
}
],
"time": 1773041255
},
{
"articles": [
{
"title": "“人肉开盒”、14岁学生杀人顶格判无期……被写入“两高”工作报告!",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXvnRyn8Qc4VwUQPxB0G7X3rbgia5KL4BmV3PK7C6hH1iaFtypHFuW6RcfaEt8oQyObFhbnfvnBH7a9XjsoGu0IFkfictgiawCPEN2k/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002047&idx=1&sn=630b92966d7389a17f92a94fb2868f22&chksm=bc9f1501506515d144f6bf4a7ee9a5112fc012804ca2dc4f578ad25af7c82f4b16e3176de4ee&scene=126&sessionid=0#rd"
}
],
"time": 1773035819
},
{
"articles": [
{
"title": "2026年度国家立法,“新看点”来了!",
"seq": 1,
"cover": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/QaRWjMxooXvHOfuib1raRAF814vYl9z2DRPqGrcUFBNo4rkYAQZicYIZjJcTzbXq6H9o4TmM6bfQiav9c6yO5mPFibwht6OAJPmzFyNibqY1NglA/640?wxtype=jpeg&wxfrom=25",
"url": "http://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667002043&idx=1&sn=bf3c128848257547435bfcaf556879c3&chksm=bc7664b4cda2d880a36a7c5084679c302940340fc01c29131413364f4154b3d60d62c48f829d&scene=126&sessionid=0#rd"
}
],
"time": 1773027862
}
]
}
}💡 Note: For list data, the example shows only 1-2 items for simplicity. The actual count depends on the API response.
