Passa al contenuto principale

本地 API 概览

TikMatrix 提供了一个本地的 RESTful API,允许你以编程方式GestioneAttività。这对于将 TikMatrix 集成到你自己的Automatico化系统、构建Personalizzato工作流程或创建Operazioni in Massa非常有用。

要求

Licenza要求

本地 API 仅对 Pro、Team 和 Business 计划用户开放。 Starter 计划不提供 API 访问权限。

Base URL

API 在本机Esegui,地址为:

http://localhost:50809/api/v1/
note

Porta 50809 为PredefinitoPorta。请在发起请求前确保 TikMatrix 已在Esegui。

响应格式

Tutti API 响应遵循以下格式:

{
"code": 0,
"message": "success",
"data": { ... }
}

响应码Istruzioni

CodeDescrizione
0Successo
40001参数Errore - 无效的请求参数
40002参数Errore - 缺少 script_name
40003参数Errore - Script暂不Supporto API 调用
40301禁止 - API 访问需要 Pro+ 计划
40401未找到 - 资源不存在
50001服务器内部Errore

Avvio Rapido

1. 检查 API 访问权限

首先,Conferma你的LicenzaVuoiSupporto API:

curl http://localhost:50809/api/v1/license/check

Esempio响应:

{
"code": 0,
"message": "success",
"data": {
"plan_name": "Pro",
"api_enabled": true,
"device_limit": 20,
"message": "API access enabled"
}
}

2. 创建Attività

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1", "device_serial_2"],
"script_name": "post",
"script_config": {
"content_type": 1,
"captions": "看看我的新视频!#热门"
},
"enable_multi_account": false
}'

3. 查询Attività列表

curl http://localhost:50809/api/v1/task?status=0&page=1&page_size=20

DisponibileScript

CorrenteSupporto

目前,本地 API Supporto postfollowunfollowaccount_warmupcomment Script。AltroScript将在未来Versione中陆续Aggiungi。

script_name 参数可接受下列值:

Script名DescrizioneAPI Supporto
postPubblica Contenuto✅ 已Supporto
followSegui用户✅ 已Supporto
unfollowNon Seguire Più✅ 已Supporto
account_warmupAccount预热✅ 已Supporto
commentCommento✅ 已Supporto
likeMi Piace🔜 即将推出
messageMessaggio Diretto🔜 即将推出
super_marketingSuper Marketing活动🔜 即将推出
profileAggiornaProfilo🔜 即将推出
scrape_userScraping Utenti数据🔜 即将推出

Attività状态

状态码状态文本Descrizione
0pendingAttivitàIn AttesaEsegui
1runningAttività正在Esegui
2completedAttivitàEseguiSuccesso
3failedAttivitàEseguiFallito

后续