屏蔽用户 (Block)
将目标账号加入黑名单。需附带 Twitter Cookie。
返回 API 接口列表
/Users Endpoints
POST
/twitter/user/blockAPI 鉴权
AuthorizationBearer token · header必填TwexAPI 平台的全局身份凭据 (Bearer Token)。所有接口调用均需在 Header 中携带:Authorization: Bearer <YOUR_TWEXAPI_KEY>。可在 TwexAPI 用户控制台获取。
请求体
必填application/jsonusernamestring必填要执行屏蔽的目标推特用户名
cookiestring必填用户自有授权的 Twitter 会话凭据或 auth_token(BYOC 自带 Cookie 模式)。无状态受托代理执行,凭据绝不持久化存储。详见 [鉴权与安全说明](/zh/authentication#写操作鉴权与-byoc自带授权-cookie--token) 与 [获取 Cookie 指南](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie)。
响应结果
200被屏蔽的用户信息结果
codeintegerHTTP 响应状态码(200 表示成功)
default: 200
msgstring响应提示信息(例如 'success')
default: "success"
dataUserModel | any接口返回的核心业务数据载荷
展开属性折叠属性
Any of:
UserModel
idstring必填用户唯一数字 ID
namestring必填用户昵称/显示名称
screen_namestring必填推特用户名(Handle,即 @ 后的名称)
created_atstring | any发布或创建时间(UTC 标准时间格式)
展开属性折叠属性
Any of:
string
stringany
anycreated_at_datetimestring | anyISO 8601 标准格式的账号注册时间
展开属性折叠属性
Any of:
string
stringany
anycan_dmboolean | any当前登录账号是否允许向该用户发送私信
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anycan_media_tagboolean | any他人发推附加图片或视频时是否允许 @ 圈出标记该用户
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anydefault_profileboolean | any该用户是否依然使用推特官方默认资料模板
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anydefault_profile_imageboolean | any该用户是否依然使用推特默认头像(初始蛋头图)
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anydescriptionstring | any个人主页 Bio 自我介绍文本
default: ""
展开属性折叠属性
Any of:
string
stringany
anydescription_urlsstring[]在用户 Bio 自我介绍中发现的外部链接 URL 清单
default: []
urlsurlModel[] | any在用户主页资料中填写的官网链接 URL 清单
展开属性折叠属性
Any of:
urlModel[]
Array of
urlModelurlstring必填URL
expanded_urlstring | any还原后的完整网页跳转 URL
展开属性折叠属性
Any of:
string
stringany
anydisplay_urlstring | any推特卡片上对外展示的缩略 URL
展开属性折叠属性
Any of:
string
stringany
anyany
anyfast_followers_countinteger | any优质活跃粉丝数量
default: 0
展开属性折叠属性
Any of:
integer
integerany
anyfavourites_countinteger | any该账号历史点赞过的推文总数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anyfollowers_countinteger | any关注该账号的粉丝总数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anyfollowing_countinteger | any该账号正在关注的账号总数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anyhas_custom_timelinesboolean | any该用户主页是否配置了自定义推文聚合时间线
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anyis_blue_verifiedboolean | any是否为推特蓝 V 认证用户(X Premium 会员)
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anyverified_typestring | any推特非个人官方认证徽章类型(blue 蓝 V、business 企业金 V、government 政府灰 V 等)
展开属性折叠属性
Any of:
string
stringany
anyis_verifiedboolean | any当账号具备任何形式的官方认证徽章(个人蓝 V、机构金 V、政务灰 V 或经典认证)时为 true
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anyprofile_image_shapestring | any用户头像裁切外观(Circle 圆形,Square 方形;方形通常代表官方企业机构或政务账号)
展开属性折叠属性
Any of:
string
stringany
anyis_translatorboolean | any该用户是否为推特官方多语言众包译者
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anylisted_countinteger | any该账号被收录进推特公开列表的次数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anylocationstring | any用户在个人主页填写的所在地/国家地区
default: ""
展开属性折叠属性
Any of:
string
stringany
anymedia_countinteger | any该账号累计发布的图片和视频推文总数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anynormal_followers_countinteger | any普通未认证粉丝数量
default: 0
展开属性折叠属性
Any of:
integer
integerany
anypinned_tweet_idsstring[]用户个人主页置顶的推文 ID 列表
default: []
possibly_sensitiveboolean | any该用户的个人主页是否可能涉及限制级/敏感内容
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anyprofile_banner_urlstring | any用户个人主页横幅背景图片地址
展开属性折叠属性
Any of:
string
stringany
anyprofile_image_urlstring | any用户个人主页高清头像图片的访问 URL
展开属性折叠属性
Any of:
string
stringany
anyprotectedboolean | any该博主的推文是否处于私密锁推保护状态(仅获批粉丝可阅读)
default: false
展开属性折叠属性
Any of:
boolean
booleanany
anystatuses_countinteger | any该账号历史累计发布的推文总数
default: 0
展开属性折叠属性
Any of:
integer
integerany
anyany
any422请求参数校验错误
detailValidationError[]展开属性折叠属性
Array of
ValidationErrorlocstring | integer[]必填展开属性折叠属性
Array of
string | integerAny of:
string
stringinteger
integermsgstring必填响应提示信息(例如 'success')
typestring必填inputanyctxobject⚡交互式测试POST
⚡交互式测试 / Try APIPOSTLive Console
🌐目标服务器:
https://api.twexapi.io● 生产环境就绪
✍️
写入接口凭证指引(TwexAPI 密钥 + 目标推特 Cookie)
1. TwexAPI 平台密钥 (Bearer Token):在下方「API 鉴权」中填入,用于 TwexAPI 计费与接口调用鉴权。
2. 推特账号 Cookie:本接口为代发/点赞/关注等写操作,需在下方请求体 (Request Body) 的 cookie 字段中填入目标 Twitter 账号的 Cookie 凭据(如 auth_token=...; ct0=...)。
🔑API 鉴权
📝请求体application/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
请求示例
curl -X POST "https://api.twexapi.io/twitter/user/block" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "string",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7"
}'const response = await fetch("https://api.twexapi.io/twitter/user/block", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"username": "string",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7"
})
});import requests
response = requests.post(
"https://api.twexapi.io/twitter/user/block",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"username": "string",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7"
},
)响应示例
{
"code": 200,
"msg": "success",
"data": {
"id": "1717001045992251392",
"name": "Cryptoklepto",
"screen_name": "CK_Cryptoklepto",
"created_at": "Mon Oct 28 02:32:47 +0000 2024",
"created_at_datetime": "2024-10-28T02:32:47.000Z",
"can_dm": false,
"can_media_tag": false,
"default_profile": false,
"default_profile_image": false,
"description": "",
"description_urls": [],
"urls": [
{
"url": "https://www.google.com",
"expanded_url": "https://www.google.com",
"display_url": "www.google.com"
}
],
"fast_followers_count": 0,
"favourites_count": 0,
"followers_count": 0,
"following_count": 0,
"has_custom_timelines": false,
"is_blue_verified": false,
"verified_type": "government",
"is_verified": false,
"profile_image_shape": "Circle",
"is_translator": false,
"listed_count": 0,
"location": "New York, USA",
"media_count": 0,
"normal_followers_count": 0,
"pinned_tweet_ids": [],
"possibly_sensitive": false,
"profile_banner_url": "string",
"profile_image_url": "string",
"protected": false,
"statuses_count": 0
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}