curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/profiles
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/profiles?refId=160c8700bd6ade&include=suspension,socialHealth,activity,quota"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/profiles', headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace ProfilesGETRequest_csharp
{
class Profiles
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/profiles";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"profiles": [
{
"status": "active",
"title": "Digg It Title",
"displayTitle": "Your title",
"created": {
"_seconds": 1604094099,
"_nanoseconds": 530000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"twitter",
"facebook",
"linkedin",
"instagram"
],
"isByokLinked": true
},
{
"status": "active",
"title": "Super Profile",
"created": {
"_seconds": 1604377627,
"_nanoseconds": 252000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "170a8700bd6ade099b242d845e268fb986130c53"
},
{
"status": "suspended",
"title": "Good Fun Title",
"created": {
"_seconds": 1605107864,
"_nanoseconds": 96000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "180s8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"facebook",
"linkedin",
"youtube"
],
"suspended": true
}
],
"count": 100,
"lastUpdated": "2025-06-14T15:53:26.016Z",
"nextUpdate": "2025-06-14T15:58:26.016Z",
"pagination": {
"hasMore": true,
"nextCursor": "eyJjcmVhdGVkIjoiMjAyNS0wNi0xNFQwMjo1",
"limit": 100
}
}
{
"profiles": {
"actionLog": [
{
"action": "create",
"refId": "2d83hd839282ehd892d2999912d1dsdgldfkepw",
"title": "Profile 1",
"created": "2025-05-29T14:10:33.709Z"
},
{
"action": "create",
"refId": "fmm02nd9c3nm9djjffdfsfshfihvp848jcsf222s",
"title": "Profile 2",
"created": "2025-05-28T20:33:32.186Z"
}
],
"userProfilesReport": [
{
"reported": "2025-03-31T08:00:22.651Z",
"userProfileCount": 135
},
{
"reported": "2025-04-01T08:00:16.632Z",
"userProfileCount": 135
}
],
"lastUpdated": "2025-06-14T15:56:02.260Z",
"nextUpdate": "2025-06-14T16:01:02.260Z"
}
{
"profiles": [
{
"title": "Brand Marketing",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"status": "suspended",
"activeSocialAccounts": ["twitter", "instagram"],
"suspension": {
"isSuspended": true,
"reason": "Too many duplicate posts",
"suspendedAt": "2026-03-01T10:00:00.000Z",
"unsuspendAt": "2026-03-03T10:00:00.000Z",
"suspensionCount": 2
},
"socialHealth": {
"twitter": {
"linked": true,
"linkedAt": "2026-01-15T10:30:00.000Z",
"relinkRecommended": false,
"messagingEnabled": true,
"tokenExpiresAt": null
},
"instagram": {
"linked": true,
"linkedAt": "2026-02-01T08:00:00.000Z",
"relinkRecommended": true,
"messagingEnabled": false,
"tokenExpiresAt": "2026-04-01T08:00:00.000Z"
}
},
"activity": {
"lastApiCall": "2026-03-05T09:15:00.000Z",
"lastPost": "2026-03-04T14:30:00.000Z"
},
"quota": {
"used": 450,
"limit": 1000
}
}
],
"count": 1,
"pagination": {
"hasMore": false,
"nextCursor": null,
"limit": 5000
}
}
Profiles
获取 User Profile 列表
获取与 Primary Profile 关联的所有 profile。
GET
/
profiles
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/profiles
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/profiles?refId=160c8700bd6ade&include=suspension,socialHealth,activity,quota"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/profiles', headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace ProfilesGETRequest_csharp
{
class Profiles
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/profiles";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"profiles": [
{
"status": "active",
"title": "Digg It Title",
"displayTitle": "Your title",
"created": {
"_seconds": 1604094099,
"_nanoseconds": 530000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"twitter",
"facebook",
"linkedin",
"instagram"
],
"isByokLinked": true
},
{
"status": "active",
"title": "Super Profile",
"created": {
"_seconds": 1604377627,
"_nanoseconds": 252000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "170a8700bd6ade099b242d845e268fb986130c53"
},
{
"status": "suspended",
"title": "Good Fun Title",
"created": {
"_seconds": 1605107864,
"_nanoseconds": 96000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "180s8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"facebook",
"linkedin",
"youtube"
],
"suspended": true
}
],
"count": 100,
"lastUpdated": "2025-06-14T15:53:26.016Z",
"nextUpdate": "2025-06-14T15:58:26.016Z",
"pagination": {
"hasMore": true,
"nextCursor": "eyJjcmVhdGVkIjoiMjAyNS0wNi0xNFQwMjo1",
"limit": 100
}
}
{
"profiles": {
"actionLog": [
{
"action": "create",
"refId": "2d83hd839282ehd892d2999912d1dsdgldfkepw",
"title": "Profile 1",
"created": "2025-05-29T14:10:33.709Z"
},
{
"action": "create",
"refId": "fmm02nd9c3nm9djjffdfsfshfihvp848jcsf222s",
"title": "Profile 2",
"created": "2025-05-28T20:33:32.186Z"
}
],
"userProfilesReport": [
{
"reported": "2025-03-31T08:00:22.651Z",
"userProfileCount": 135
},
{
"reported": "2025-04-01T08:00:16.632Z",
"userProfileCount": 135
}
],
"lastUpdated": "2025-06-14T15:56:02.260Z",
"nextUpdate": "2025-06-14T16:01:02.260Z"
}
{
"profiles": [
{
"title": "Brand Marketing",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"status": "suspended",
"activeSocialAccounts": ["twitter", "instagram"],
"suspension": {
"isSuspended": true,
"reason": "Too many duplicate posts",
"suspendedAt": "2026-03-01T10:00:00.000Z",
"unsuspendAt": "2026-03-03T10:00:00.000Z",
"suspensionCount": 2
},
"socialHealth": {
"twitter": {
"linked": true,
"linkedAt": "2026-01-15T10:30:00.000Z",
"relinkRecommended": false,
"messagingEnabled": true,
"tokenExpiresAt": null
},
"instagram": {
"linked": true,
"linkedAt": "2026-02-01T08:00:00.000Z",
"relinkRecommended": true,
"messagingEnabled": false,
"tokenExpiresAt": "2026-04-01T08:00:00.000Z"
}
},
"activity": {
"lastApiCall": "2026-03-05T09:15:00.000Z",
"lastPost": "2026-03-04T14:30:00.000Z"
},
"quota": {
"used": 450,
"limit": 1000
}
}
],
"count": 1,
"pagination": {
"hasMore": false,
"nextCursor": null,
"limit": 5000
}
}
获取与 Primary Profile 关联的所有 profile。结果中不会包含 Primary Profile 本身。
出于安全考虑,此 GET 调用不会返回 Profile Key。更多信息请参阅此处。
Header 参数
Query 参数
string
仅返回与经 URL 编码的 title 关联的 profile。
string
仅返回与给定
refId 关联的 profile。refId 在创建 profile 时或从 /user 端点返回。boolean
默认值:false
若为
true,仅返回至少已连接一个社交账户的 profile(activeSocialAccounts 长度大于零)。若为 false,仅返回未连接任何社交账户的 profile(activeSocialAccounts 长度为零)。array
筛选 profile,仅包含其
activeSocialAccounts 包含 includesActiveSocialAccounts 列表中所有社交媒体平台的 profile。profile 的 activeSocialAccounts 中可以包含 includesActiveSocialAccounts 之外的其他平台,依然会被包含在过滤结果中。可选值:bluesky、facebook、gmb、instagram、linkedin、pinterest、reddit、snapchat、telegram、threads、tiktok、twitter、youtube。boolean
按 BYOK(Bring Your Own Key)迁移状态筛选 profile。若为
true,仅返回已完成 BYOK 迁移的 profile。若为 false,仅返回连接了符合 BYOK 条件的平台但尚未完成迁移的 profile。设置该过滤器时,未连接任何符合 BYOK 条件平台的 profile 将被排除。若省略此参数,则返回所有 profile,不考虑 BYOK 状态。目前适用于 X/Twitter BYOK。boolean
默认值:false
返回过去 60 天内 User Profile 的创建与删除操作日志历史,以及过去 60 天内用于计费的活跃用户数量。注意:
- 操作日志:2025 年 3 月之前的操作日志历史中不会返回 title 和 tag。
- User Profile 报告:该时间段可能与你的计费周期不一致。例如,你的计费周期可能是每月 10 号开始至下月 10 号结束。 请查看你的发票以获取计费周期和其他详情。
actionLog=10 查询参数将返回过去 10 天的操作日志和过去 10 天报告的活跃用户数量。允许的时间范围为 1 到 365 天。number
默认值:5000
限制返回的 profile 数量。默认值和最大值均为 5000。
string
若还有更多 profile 可返回且
hasMore 标志为 true,响应中将返回 nextCursor。
将该 cursor 传入 cursor 查询参数以返回下一批 profile。string | array
返回扩展的 profile 数据以用于排障。需要
refId 参数(单个 profile 查询)。取值(逗号分隔的字符串或数组):suspension、socialHealth、linkingErrors、activity、quota、unlinkHistory、actionLog。suspension- isSuspended、reason、suspendedAt、unsuspendAt、suspensionCountsocialHealth- 每个平台:linked、linkedAt、relinkRecommended、messagingEnabled、tokenExpiresAtlinkingErrors- 每个平台:code、message、details、createdAtactivity- lastApiCall、lastPost 时间戳quota- used、limitunlinkHistory- 最近一次解绑:platform、source(user/system)、details、createdAtactionLog- profile 操作历史(create/update/delete)
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/profiles
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/profiles?refId=160c8700bd6ade&include=suspension,socialHealth,activity,quota"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/profiles', headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace ProfilesGETRequest_csharp
{
class Profiles
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/profiles";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"profiles": [
{
"status": "active",
"title": "Digg It Title",
"displayTitle": "Your title",
"created": {
"_seconds": 1604094099,
"_nanoseconds": 530000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"twitter",
"facebook",
"linkedin",
"instagram"
],
"isByokLinked": true
},
{
"status": "active",
"title": "Super Profile",
"created": {
"_seconds": 1604377627,
"_nanoseconds": 252000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "170a8700bd6ade099b242d845e268fb986130c53"
},
{
"status": "suspended",
"title": "Good Fun Title",
"created": {
"_seconds": 1605107864,
"_nanoseconds": 96000000
},
"createdUTC": "2022-03-02T16:11:00.839Z",
"refId": "180s8700bd6ade099b242d845e268fb986130c53",
"activeSocialAccounts": [
"facebook",
"linkedin",
"youtube"
],
"suspended": true
}
],
"count": 100,
"lastUpdated": "2025-06-14T15:53:26.016Z",
"nextUpdate": "2025-06-14T15:58:26.016Z",
"pagination": {
"hasMore": true,
"nextCursor": "eyJjcmVhdGVkIjoiMjAyNS0wNi0xNFQwMjo1",
"limit": 100
}
}
{
"profiles": {
"actionLog": [
{
"action": "create",
"refId": "2d83hd839282ehd892d2999912d1dsdgldfkepw",
"title": "Profile 1",
"created": "2025-05-29T14:10:33.709Z"
},
{
"action": "create",
"refId": "fmm02nd9c3nm9djjffdfsfshfihvp848jcsf222s",
"title": "Profile 2",
"created": "2025-05-28T20:33:32.186Z"
}
],
"userProfilesReport": [
{
"reported": "2025-03-31T08:00:22.651Z",
"userProfileCount": 135
},
{
"reported": "2025-04-01T08:00:16.632Z",
"userProfileCount": 135
}
],
"lastUpdated": "2025-06-14T15:56:02.260Z",
"nextUpdate": "2025-06-14T16:01:02.260Z"
}
{
"profiles": [
{
"title": "Brand Marketing",
"refId": "160c8700bd6ade099b242d845e268fb986130c53",
"status": "suspended",
"activeSocialAccounts": ["twitter", "instagram"],
"suspension": {
"isSuspended": true,
"reason": "Too many duplicate posts",
"suspendedAt": "2026-03-01T10:00:00.000Z",
"unsuspendAt": "2026-03-03T10:00:00.000Z",
"suspensionCount": 2
},
"socialHealth": {
"twitter": {
"linked": true,
"linkedAt": "2026-01-15T10:30:00.000Z",
"relinkRecommended": false,
"messagingEnabled": true,
"tokenExpiresAt": null
},
"instagram": {
"linked": true,
"linkedAt": "2026-02-01T08:00:00.000Z",
"relinkRecommended": true,
"messagingEnabled": false,
"tokenExpiresAt": "2026-04-01T08:00:00.000Z"
}
},
"activity": {
"lastApiCall": "2026-03-05T09:15:00.000Z",
"lastPost": "2026-03-04T14:30:00.000Z"
},
"quota": {
"used": 450,
"limit": 1000
}
}
],
"count": 1,
"pagination": {
"hasMore": false,
"nextCursor": null,
"limit": 5000
}
}
⌘I
