Threads 發佈

了解如何連結 Threads 帳號,並在 Threads 平台發佈文字貼文、圖片、輪播、影片以及多則串文。

連結 Threads 帳號

前置需求

連結步驟

  1. 在控制台按下 「Connect Threads」
  2. 如尚未登入 Threads,請先登入
  3. 授權 Boring 存取 Threads 帳號
  4. 授與以下權限:
    • threads_basic:帳號基本資訊
    • threads_content_publish:發佈內容
    • threads_manage_replies:建立與管理串文回覆(長篇串文必須)
    • threads_manage_insights:存取成效分析
    • threads_read_replies:讀取留言/回覆
  5. 點擊 「Authorize」

完成後,帳號會出現在「Authorized Accounts」列表,顯示:

權杖資訊

注意:不同於 Instagram,Threads 權杖會自動續期,通常無需手動重新連結。

支援的內容類型

Threads 提供最豐富的內容型態:

類型 說明 媒體數量 文字格式 範例
文字 純文字貼文 0 字串 快速想法、更新
照片 單張圖片 1 字串 圖片 + Caption
輪播 多張圖片 2-20 字串 圖片集、教學
影片 影片貼文 1 字串 短影音、剪輯
串文 多則長篇貼文 0-1 陣列 故事、長篇內容

亮點:Threads 是唯一同時支援:

發佈範例

1. 純文字貼文

{
  "post": {
    "accountId": "your-threads-account-id",
    "content": {
      "text": "Just launched our new feature! Check it out 🚀",
      "mediaUrls": [],
      "platform": "threads"
    },
    "target": {
      "targetType": "threads"
    }
  }
}

效果:在 Threads 發佈一則純文字貼文。

文字限制

2. 單張照片貼文

{
  "post": {
    "accountId": "your-threads-account-id",
    "content": {
      "text": "Beautiful morning view 🌅",
      "mediaUrls": ["https://example.com/morning.jpg"],
      "platform": "threads"
    },
    "target": {
      "targetType": "threads"
    }
  }
}

效果:附帶圖片與文字說明的貼文。

圖片規格

3. 輪播貼文

{
  "post": {
    "accountId": "your-threads-account-id",
    "content": {
      "text": "Our journey in photos 📸",
      "mediaUrls": [
        "https://example.com/photo1.jpg",
        "https://example.com/photo2.jpg",
        "https://example.com/photo3.jpg",
        "https://example.com/photo4.jpg",
        "https://example.com/photo5.jpg"
      ],
      "platform": "threads"
    },
    "target": {
      "targetType": "threads"
    }
  }
}

效果:建立可左右滑動的輪播貼文。

輪播限制

4. 影片貼文

{
  "post": {
    "accountId": "your-threads-account-id",
    "content": {
      "text": "Behind the scenes 🎬",
      "mediaUrls": ["https://example.com/video.mp4"],
      "platform": "threads"
    },
    "target": {
      "targetType": "threads"
    }
  }
}

效果:在 Threads 發佈影片。

影片規格

提醒:影片會以非同步方式處理,可能需要數分鐘才會上線。

5. 多則串文(Long-Form Thread)

Threads 最強大功能!

{
  "post": {
    "accountId": "your-threads-account-id",
    "content": {
      "text": [
        "Let me tell you a story about building our product 🧵",
        "It all started with a simple idea: make social media publishing easier for developers.",
        "We researched the pain points: token management, platform differences, complex APIs.",
        "So we built Boring: one API to rule them all. Simple, secure, and reliable.",
        "Today we're proud to support Facebook, Instagram, and Threads. More platforms coming soon!",
        "Thank you for being part of our journey 🙏"
      ],
      "mediaUrls": [],
      "platform": "threads"
    },
    "target": {
      "targetType": "threads"
    }
  }
}

效果:建立 6 則串連的帖子,每則為上一則的回覆。

串文限制

注意:必須授予 threads_manage_replies 權限。

文字格式判斷

Boring 會依 text 欄位自動判斷內容型態:

文字格式 結果
"text": "字串" 單一貼文(文字、照片、輪播或影片)
"text": ["段落1", "段落2"] 多則串文

範例

# 單一貼文
{"text": "Hello world", "mediaUrls": []}

# 單一貼文 + 圖片
{"text": "Check this out", "mediaUrls": ["image.jpg"]}

# 輪播
{"text": "Photo series", "mediaUrls": ["img1.jpg", "img2.jpg"]}

# 多則串文(6 則)
{"text": ["Post 1", "Post 2", "Post 3", "Post 4", "Post 5", "Post 6"], "mediaUrls": []}

API 請求格式

Python 範例:多則串文

import requests

API_URL = "https://boring.aiagent-me.com/v2/posts"
API_KEY = "boring_xxxxxxxxxxxxx"
ACCOUNT_ID = "your-threads-account-id"

# 建立長篇串文
thread_content = [
    "🚨 Product Launch Alert! 🚨",

    "We're excited to announce Boring API v3.0 with Threads integration!",

    "What's new:\n✅ Text-only posts\n✅ Carousels up to 20 images\n✅ Long-form threads\n✅ Auto token refresh",

    "Why Threads?\n\nThreads is perfect for storytelling, updates, and engaging with your audience in a conversational way.",

    "Getting started is easy:\n1. Sign in\n2. Connect Threads\n3. Generate API key\n4. Start publishing",

    "Check out our docs at boring-doc.aiagent-me.com for examples and guides!",

    "What would you like to see next? Reply and let us know! 💬"
]

post_data = {
    "post": {
        "accountId": ACCOUNT_ID,
        "content": {
            "text": thread_content,  # 字串陣列 = 串文
            "mediaUrls": [],
            "platform": "threads"
        },
        "target": {
            "targetType": "threads"
        }
    }
}

headers = {
    "boring-api-key": API_KEY,
    "Content-Type": "application/json"
}

response = requests.post(API_URL, headers=headers, json=post_data)
result = response.json()

if result["success"]:
    print(f"Thread published! Main post ID: {result['data']['post_id']}")
    print(f"Total posts: {result['data']['thread_count']}")
else:
    print(f"Error: {result['message']}")

成功回應(串文)

{
  "success": true,
  "message": "Post published successfully",
  "data": {
    "post_id": "17885748657253466",
    "post_type": "thread",
    "platform": "threads",
    "page_name": "your_username",
    "thread_count": 7,
    "post_ids": [
      "17885748657253466",
      "17885748657253467",
      "17885748657253468",
      "17885748657253469",
      "17885748657253470",
      "17885748657253471",
      "17885748657253472"
    ],
    "published_at": "2025-01-20T10:30:00Z"
  }
}

媒體 URL 要求

與其他平台相同,媒體 URL 必須:

支援格式

最佳實務

1. 串文規劃

規劃內容結構

範例結構

thread = [
    "🧵 Why [topic] matters (thread)",  # Hook
    "First, let's define [topic]...",    # 背景
    "The main problem is...",            # 問題
    "Here's how we solve it...",         # 解法
    "Real example: [case study]",        # 範例
    "Key takeaway: [summary]",           # 重點整理
    "What do you think? [CTA]"           # 互動
]

2. 純文字貼文

適用於:

Tips

3. 輪播貼文

Threads 支援 最多 20 張圖片

適合用於:

4. 影片內容

最佳實務

5. 互動經營

Threads 著重對話與互動:

疑難排解

常見錯誤

錯誤:「Invalid text format for thread」

錯誤:「Missing threads_manage_replies permission」

錯誤:「Token expired」

錯誤:「Carousel size exceeds limit」

錯誤:「Text exceeds maximum length」

發佈延遲

Threads 的處理時間可能稍長:

API 會自動處理重試與等待。

進階功能

動態產生串文

針對長文自動切割為多則 Threads 貼文:

def split_into_thread(long_text, max_chars=450):
    """將長文拆成多則串文貼文"""
    sentences = long_text.split('. ')
    posts = []
    current_post = ""

    for sentence in sentences:
        if len(current_post) + len(sentence) < max_chars:
            current_post += sentence + '. '
        else:
            posts.append(current_post.strip())
            current_post = sentence + '. '

    if current_post:
        posts.append(current_post.strip())

    return posts

# 使用方式
article = "Your very long article text here..."
thread_posts = split_into_thread(article)

post_data = {
    "post": {
        "accountId": ACCOUNT_ID,
        "content": {
            "text": thread_posts,  # 自動變成串文
            "mediaUrls": [],
            "platform": "threads"
        },
        "target": {"targetType": "threads"}
    }
}

串文附圖

在串文的第一則貼文附上圖片:

post_data = {
    "post": {
        "accountId": ACCOUNT_ID,
        "content": {
            "text": [
                "Here's our announcement 🎉",
                "This feature has been requested by many users.",
                "We're rolling it out today!"
            ],
            "mediaUrls": ["https://example.com/announcement.jpg"],  # 只有第一則有圖片
            "platform": "threads"
        },
        "target": {"targetType": "threads"}
    }
}

注意:目前只有串文第一則可以附加媒體。

跨平台內容調整

從其他平台轉換內容至 Threads:

def adapt_for_threads(content):
    text = content['text']

    # 文字過長時拆成串文
    if len(text) > 450:
        return {
            "text": split_into_thread(text),
            "mediaUrls": content['mediaUrls'][:1],  # 僅保留第一張圖片
            "platform": "threads"
        }
    else:
        return {
            "text": text,
            "mediaUrls": content['mediaUrls'][:20],  # 最多 20 張圖片
            "platform": "threads"
        }

速率限制

Threads API 速率限制:

串文提醒:串文中的每一則貼文都算一次 API 呼叫。

發佈歷史

在控制台檢視 Threads 貼文:

  1. 登入 Boring 控制台
  2. 捲動到 「Recent Posts」 區塊
  3. 篩選平台為 Threads

若為串文會顯示:

功能比較

功能 Facebook Instagram Threads
純文字貼文
單張照片
輪播 ✅ (2-10) ✅ (2-10) ✅ (2-20)
影片 ✅ (Reels)
長篇串文
文字長度 無限制 2,200 500/貼文
權杖到期 永不過期 60 天 60 天
自動刷新 N/A

下一步