Skip to content

小红书蒲公英粉丝分布 API (V1)

此接口已过期

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

GET
/api/xiaohongshu-pgy/get-kol-fans-portrait/v1
接口健康状态
健康 可用 少量可用 基本不可用 暂无数据
正在加载健康状态…

获取小红书蒲公英创作者市场粉丝分布数据,包括受众人口统计、兴趣和分布指标,用于创作者评估、活动策划和创作者对标。

请求参数

参数名位置类型必填默认值说明
tokenquerystring-用户鉴权令牌。
kolIdquerystring-KOL ID。
acceptCachequerybooleanfalse启用缓存。

代码示例

💡 环境说明

默认请使用 https://api.justoneapi.comprod-global)。是否需要切换环境,建议以真实接口调用的完整耗时为准;如果您在中国大陆地区发现 prod-global 完整响应时间较长,或实测 prod-cn 更快,可以将代码中的基地址切换为 http://47.117.133.51:30015prod-cn)。

bash
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 提供的“粉丝分布 (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-creator-marketplace-pugongying/follower-distribution-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
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
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
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
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
<?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": {
    "fansPortrait": {
      "cityDistribution": [
        {
          "distribution_data": {
            "cnt": 11094,
            "name": "上海"
          }
        },
        {
          "distribution_data": {
            "cnt": 9124,
            "name": "北京"
          }
        },
        {
          "distribution_data": {
            "cnt": 5600,
            "name": "广州"
          }
        },
        {
          "distribution_data": {
            "cnt": 3836,
            "name": "深圳"
          }
        },
        {
          "distribution_data": {
            "cnt": 3317,
            "name": "杭州"
          }
        },
        {
          "distribution_data": {
            "cnt": 2799,
            "name": "成都"
          }
        },
        {
          "distribution_data": {
            "cnt": 2073,
            "name": "南京"
          }
        },
        {
          "distribution_data": {
            "cnt": 1970,
            "name": "苏州"
          }
        },
        {
          "distribution_data": {
            "cnt": 1762,
            "name": "武汉"
          }
        },
        {
          "distribution_data": {
            "cnt": 1347,
            "name": "天津"
          }
        }
      ],
      "ageDistribution": [
        {
          "distribution_data": {
            "cnt": 154,
            "name": "<18"
          }
        },
        {
          "distribution_data": {
            "cnt": 8191,
            "name": "18-24"
          }
        },
        {
          "distribution_data": {
            "cnt": 34008,
            "name": "25-34"
          }
        },
        {
          "distribution_data": {
            "cnt": 35355,
            "name": "35-44"
          }
        },
        {
          "distribution_data": {
            "cnt": 25974,
            "name": ">44"
          }
        }
      ],
      "genderDistribution": [
        {
          "distribution_data": {
            "cnt": 88442,
            "name": "female"
          }
        },
        {
          "distribution_data": {
            "cnt": 15241,
            "name": "male"
          }
        }
      ],
      "interestDistribution": [
        {
          "distribution_data": {
            "cnt": 32660,
            "name": "美食"
          }
        },
        {
          "distribution_data": {
            "cnt": 29446,
            "name": "家居家装"
          }
        },
        {
          "distribution_data": {
            "cnt": 21980,
            "name": "娱乐"
          }
        },
        {
          "distribution_data": {
            "cnt": 20633,
            "name": "旅行"
          }
        },
        {
          "distribution_data": {
            "cnt": 16796,
            "name": "护肤"
          }
        },
        {
          "distribution_data": {
            "cnt": 12131,
            "name": "母婴"
          }
        },
        {
          "distribution_data": {
            "cnt": 10886,
            "name": "彩妆"
          }
        },
        {
          "distribution_data": {
            "cnt": 9435,
            "name": "教育"
          }
        },
        {
          "distribution_data": {
            "cnt": 8916,
            "name": "生活记录"
          }
        },
        {
          "distribution_data": {
            "cnt": 6428,
            "name": "健身"
          }
        }
      ],
      "provinceDistribution": [
        {
          "distribution_data": {
            "cnt": 11094,
            "name": "上海"
          }
        },
        {
          "distribution_data": {
            "cnt": 10679,
            "name": "广东"
          }
        },
        {
          "distribution_data": {
            "cnt": 9124,
            "name": "北京"
          }
        },
        {
          "distribution_data": {
            "cnt": 8398,
            "name": "江苏"
          }
        },
        {
          "distribution_data": {
            "cnt": 6117,
            "name": "浙江"
          }
        },
        {
          "distribution_data": {
            "cnt": 3317,
            "name": "山东"
          }
        },
        {
          "distribution_data": {
            "cnt": 3006,
            "name": "四川"
          }
        },
        {
          "distribution_data": {
            "cnt": 2281,
            "name": "湖北"
          }
        },
        {
          "distribution_data": {
            "cnt": 2281,
            "name": "福建"
          }
        },
        {
          "distribution_data": {
            "cnt": 1866,
            "name": "河南"
          }
        }
      ]
    }
  }
}

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