Skip to content

小红书蒲公英 API - KOL粉丝画像 (V1)

此接口已过期

此接口已过时,可能会在未来的版本中被移除。请尽快迁移到新版本。

prod-global
GET
/api/xiaohongshu-pgy/get-kol-fans-portrait/v1

获取粉丝画像(旧版)。

请求参数

参数名位置类型必填说明
tokenquerystring用户鉴权令牌。
kolIdquerystringKOL ID。
acceptCachequeryboolean启用缓存。

代码示例

💡 环境说明

默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择

bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=VALUE"
text
我想使用 Just One API 提供的“KOL粉丝画像 (V1) [已弃用]”接口。
接口地址: https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/xiaohongshu-pgy-apis/kol-follower-profile-v1-deprecated-zh.json

请求参数说明:
- token (query): 用户鉴权令牌。 (必填)
- kolId (query): KOL ID。 (必填)
- acceptCache (query): 启用缓存。

返回格式: JSON

响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
   - 0: 成功
   - 100: Token 无效或已失效
   - 301: 采集失败,请重试
   - 302: 超出速率限制
   - 303: 超出每日配额
   - 400: 参数错误
   - 500: 内部服务器错误
   - 600: 权限不足
   - 601: 余额不足

请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。
python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests

url = "https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=VALUE"
response = requests.get(url)
print(response.json())
js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=VALUE", {
  method: "GET"
});
const data = await response.json();
console.log(data);
java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 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/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=VALUE"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	client := &http.Client{}
	url := "https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=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
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/xiaohongshu-pgy/get-kol-fans-portrait/v1?token=YOUR_API_KEY&kolId=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;

响应结果

json
{
  "code": 0,
  "data": {
    "ages": [
      {
        "group": "<18",
        "percent": 0.020388213936601035
      },
      {
        "group": "18-24",
        "percent": 0.03546990643764837
      },
      {
        "group": "25-34",
        "percent": 0.27370478983382207
      },
      {
        "group": "35-44",
        "percent": 0.5362379555927943
      },
      {
        "group": ">44",
        "percent": 0.1341991341991342
      }
    ],
    "gender": {
      "male": 0.3287250384024577,
      "female": 0.6712749615975423
    },
    "interests": [
      {
        "name": "美食",
        "percent": 0.08425858389388659
      },
      {
        "name": "生活记录",
        "percent": 0.07380392792500742
      },
      {
        "name": "娱乐",
        "percent": 0.0682659318691412
      },
      {
        "name": "时尚",
        "percent": 0.06513223653996812
      },
      {
        "name": "家居家装",
        "percent": 0.050436286030742634
      },
      {
        "name": "影视",
        "percent": 0.05032822757111598
      },
      {
        "name": "情感",
        "percent": 0.04546559688791636
      },
      {
        "name": "旅游",
        "percent": 0.037847475484236975
      },
      {
        "name": "美妆",
        "percent": 0.03765837317989032
      },
      {
        "name": "社科",
        "percent": 0.03565929167679715
      },
      {
        "name": "教育",
        "percent": 0.03525407245319718
      },
      {
        "name": "母婴",
        "percent": 0.033444093254450656
      },
      {
        "name": "健康",
        "percent": 0.03198530404949077
      },
      {
        "name": "兴趣爱好",
        "percent": 0.029310857173730987
      },
      {
        "name": "汽车",
        "percent": 0.02669043952778453
      },
      {
        "name": "宠物",
        "percent": 0.024151065726558067
      },
      {
        "name": "职场",
        "percent": 0.023961963422211418
      },
      {
        "name": "健身减肥",
        "percent": 0.02242213037253154
      },
      {
        "name": "素材",
        "percent": 0.022287057297998215
      },
      {
        "name": "人文",
        "percent": 0.01931544965826512
      }
    ],
    "provinces": [
      {
        "name": "广东",
        "percent": 0.1189586597565385
      },
      {
        "name": "江苏",
        "percent": 0.0689405809328673
      },
      {
        "name": "山东",
        "percent": 0.06845847896830179
      },
      {
        "name": "海外",
        "percent": 0.06074484753525371
      },
      {
        "name": "北京",
        "percent": 0.05146438471736772
      },
      {
        "name": "浙江",
        "percent": 0.05134385922622635
      },
      {
        "name": "河南",
        "percent": 0.046402314089429915
      },
      {
        "name": "河北",
        "percent": 0.04061709051464385
      },
      {
        "name": "湖北",
        "percent": 0.039050259129805955
      },
      {
        "name": "四川",
        "percent": 0.036037121851271545
      },
      {
        "name": "辽宁",
        "percent": 0.03579607086898879
      },
      {
        "name": "上海",
        "percent": 0.03350608653730264
      },
      {
        "name": "福建",
        "percent": 0.030372423767626854
      },
      {
        "name": "湖南",
        "percent": 0.0301313727853441
      },
      {
        "name": "陕西",
        "percent": 0.028926117873930336
      },
      {
        "name": "安徽",
        "percent": 0.02711823550680969
      },
      {
        "name": "广西",
        "percent": 0.023864047245992528
      },
      {
        "name": "云南",
        "percent": 0.022899843316861516
      },
      {
        "name": "山西",
        "percent": 0.02048933349403399
      },
      {
        "name": "重庆",
        "percent": 0.018922502109196094
      },
      {
        "name": "天津",
        "percent": 0.017355670724358202
      },
      {
        "name": "江西",
        "percent": 0.017114619742075447
      },
      {
        "name": "内蒙古",
        "percent": 0.01373990599011691
      },
      {
        "name": "新疆",
        "percent": 0.013137278534410027
      },
      {
        "name": "吉林",
        "percent": 0.012655176569844523
      },
      {
        "name": "黑龙江",
        "percent": 0.01205254911413764
      },
      {
        "name": "台湾",
        "percent": 0.01108834518500663
      },
      {
        "name": "香港",
        "percent": 0.010726768711582499
      },
      {
        "name": "贵州",
        "percent": 0.009762564782451489
      },
      {
        "name": "甘肃",
        "percent": 0.009521513800168736
      },
      {
        "name": "海南",
        "percent": 0.008677835362179101
      },
      {
        "name": "宁夏",
        "percent": 0.0034952392430999154
      },
      {
        "name": "澳门",
        "percent": 0.002651560805110281
      },
      {
        "name": "青海",
        "percent": 0.0020489333494033988
      },
      {
        "name": "中国",
        "percent": 0.001205254911413764
      },
      {
        "name": "西藏",
        "percent": 0.0007231529468482585
      }
    ],
    "cities": [
      {
        "name": "北京",
        "percent": 0.05146438471736772
      },
      {
        "name": "上海",
        "percent": 0.03350608653730264
      },
      {
        "name": "深圳",
        "percent": 0.029046643365071713
      },
      {
        "name": "广州",
        "percent": 0.02579245510425455
      },
      {
        "name": "成都",
        "percent": 0.020971435458599495
      },
      {
        "name": "重庆",
        "percent": 0.018922502109196094
      },
      {
        "name": "武汉",
        "percent": 0.018560925635771965
      },
      {
        "name": "天津",
        "percent": 0.017355670724358202
      },
      {
        "name": "苏州",
        "percent": 0.017355670724358202
      }
    ],
    "devices": [
      {
        "name": "apple inc.",
        "desc": "苹果",
        "percent": 0.4340122936000964
      },
      {
        "name": "huawei",
        "desc": "华为",
        "percent": 0.2189948174038809
      },
      {
        "name": "honor",
        "desc": "honor",
        "percent": 0.07810051825961191
      },
      {
        "name": "xiaomi",
        "desc": "小米",
        "percent": 0.0776184162950464
      },
      {
        "name": "vivo",
        "desc": "vivo",
        "percent": 0.07725683982162228
      },
      {
        "name": "oppo",
        "desc": "oppo",
        "percent": 0.07159214173797758
      },
      {
        "name": "samsung",
        "desc": "三星",
        "percent": 0.013016753043268652
      },
      {
        "name": "oneplus",
        "desc": "oneplus",
        "percent": 0.011208870676148005
      },
      {
        "name": "realme",
        "desc": "realme",
        "percent": 0.006508376521634326
      },
      {
        "name": "ptac",
        "desc": "ptac",
        "percent": 0.0019284078582620225
      }
    ],
    "dateKey": "2026-03-08"
  }
}

💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。