SocialAPIs — Facebook & Instagram Data
官方適用於AI代理的Facebook與Instagram資料 — 粉絲專頁、貼文、社團、廣告檔案庫、Marketplace、個人檔案及Reels。47個唯讀工具,結構化輸出。免費方案:每月200次呼叫。
你可以用 SocialAPIs — Facebook & Instagram Data MCP 做什麼?
- Facebook 粉絲專頁和社團資料 — 透過連結或 ID 擷取粉絲專頁或社團詳細資料、貼文、影片、Reels 和相簿。
- Facebook 貼文和留言查詢 — 透過貼文連結取得貼文詳細資料、附件、留言和留言回覆。
- Meta Ads Library 搜尋 — 依關鍵字或廣告主搜尋廣告、取得廣告主粉絲專頁詳細資料,並列出支援的國家/地區。
- Instagram 個人檔案和貼文資料 — 透過使用者名稱或 shortcode 擷取個人檔案詳細資料、貼文、Reels、精選動態和完整貼文詳細資料。
- Instagram 搜尋和地點 — 依關鍵字搜尋使用者、主題標籤和地點,或列出標記特定地點的貼文。
- Facebook Marketplace 搜尋 — 使用篩選條件搜尋商品刊登、車輛和租屋資訊,並取得刊登或賣家詳細資料。
託管 MCP 伺服器
npx add-mcp 'https://mcp.socialapis.io/mcp'可安裝到 Claude Code、Codex、Cursor 等客戶端
文件
透過 SocialAPIs Model Context Protocol (MCP) 伺服器,讓 AI 助理直接存取公開的 Facebook 和 Instagram 資料。
伺服器提供 12 個唯讀工具,涵蓋 50 種操作:粉絲專頁、貼文、留言、社團、Meta Ads Library、Marketplace、Instagram 個人檔案、貼文、Reels 和地點。每個工具涵蓋一種資源,並接受一個 action 引數。每次呼叫都會傳回結構化輸出,包括扣除的點數和剩餘點數。
1. 取得 API 金鑰
在 socialapis.io 註冊,並從控制台複製金鑰。免費方案每月包含 200 點數,無需信用卡。
2. 連線用戶端
有兩種連線方式。
託管端點(建議)
無需安裝。將任何支援遠端 MCP 伺服器的用戶端指向:
https://mcp.socialapis.io/mcp
在標頭中傳送金鑰:
Authorization: Bearer YOUR_API_KEY
x-api-token: YOUR_API_KEY 也可使用。請勿將金鑰放在 URL 中。
本機伺服器 (npx)
適用於只執行本機伺服器的用戶端,例如 Claude Desktop。需要 Node.js 18 或更新版本。
{
"mcpServers": {
"socialapis": {
"command": "npx",
"args": ["-y", "@socialapis/mcp"],
"env": {
"SOCIALAPIS_API_KEY": "YOUR_API_KEY"
}
}
}
}
用戶端設定
Claude Code
claude mcp add --transport http socialapis https://mcp.socialapis.io/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
VS Code
新增至 .vscode/mcp.json。伺服器啟動時,VS Code 會要求輸入金鑰,因此金鑰不會儲存在檔案中:
{
"servers": {
"socialapis": {
"type": "http",
"url": "https://mcp.socialapis.io/mcp",
"headers": {
"Authorization": "Bearer ${input:socialapis-key}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "socialapis-key",
"description": "SocialAPIs API key",
"password": true
}
]
}
Cline
在 MCP Servers → Configure 中,新增至 cline_mcp_settings.json:
{
"mcpServers": {
"socialapis": {
"type": "streamableHttp",
"url": "https://mcp.socialapis.io/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Windsurf
新增至 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"socialapis": {
"serverUrl": "https://mcp.socialapis.io/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
可用工具
目前版本:2.0.2。伺服器有 12 個唯讀工具。每個工具涵蓋一種資源,並接受一個 action 引數,以及該操作的輸入:
| 工具 | 操作 |
|---|---|
facebook_page | details, id, posts, videos, reels, albums, album_items |
facebook_group | details, id, posts, videos, albums, album_items |
facebook_post | details, details_extended, id, attachments, video, comments, comment_replies |
facebook_search | pages, people, posts, videos, locations |
facebook_ads | search, keywords, page_details, archive_details, countries |
facebook_marketplace | search, vehicles, rentals, listing, seller, categories, city_coordinates |
facebook_media_download | download |
instagram_profile | details, id, posts, reels, highlights, highlight_details |
instagram_post | details, id |
instagram_reels | feed, by_audio |
instagram_search | search |
instagram_location | posts, nearby |
呼叫範例:
{ "name": "facebook_post", "arguments": { "action": "comments", "link": "https://www.facebook.com/nike/posts/POST_ID", "limit": 20 } }
缺少 action 或必要輸入時,會在扣除任何點數前傳回錯誤。用戶端中每個工具的說明都會列出相同的輸入,並依操作區分。
從 1.x 升級? 直接呼叫時,舊版的每個端點工具名稱(例如 facebook_get_page_details)仍可使用,因此現有指令碼會繼續執行。如果用戶端會自動核准工具或依名稱設定允許清單,請新增上方的新名稱。
各操作的輸入
除非另有註明,點數按每次呼叫計算。分頁:傳入回應中的 end_cursor 以取得下一頁。
facebook_page
Facebook 粉絲專頁:個人檔案詳細資料、粉絲專頁 ID、貼文、影片、Reels 和相簿。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
details | link | exact_followers_count | 1(使用 exact_followers_count=true 時為 5) |
id | link | — | 1 |
posts | link | limit, end_cursor, after_time, before_time, timezone | 每傳回 3 篇貼文扣 1 點(至少 1 點) |
videos | link 或 profile_id | limit, end_cursor | 1 |
reels | link | end_cursor | 1 |
albums | profile_id(來自 id) | limit(8-16)、end_cursor | 1 |
album_items | album_id(來自 albums) | end_cursor | 1 |
facebook_group
公開 Facebook 社團:詳細資料、社團 ID、貼文、影片和相簿。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
details | link | — | 1 |
id | link | — | 1 |
posts | link | limit, end_cursor, after_time, before_time, timezone | 每傳回 3 篇貼文扣 1 點(至少 1 點) |
videos | link | end_cursor | 1 |
albums | group_id(來自 id) | limit(8-16) | 1 |
album_items | album_id(來自 albums) | end_cursor | 1 |
facebook_post
Facebook 貼文、影片和留言:貼文詳細資料、附件、留言和回覆。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
details | link | — | 1 |
details_extended | link | — | 1 |
id | link | — | 1 |
attachments | post_id | — | 5 |
video | video_id | — | 1 |
comments | link | limit, end_cursor, include_reply_info | 1 |
comment_replies | comment_feedback_id, expansion_token | — | 1 |
facebook_search
依關鍵字搜尋 Facebook:粉絲專頁、人物、貼文、影片和地點。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
pages | query | location_uid, end_cursor | 1 |
people | query | location_uid, end_cursor | 1 |
posts | query | location_uid, start_time, end_time, recent_posts, end_cursor | 1 |
videos | query | most_recent, videos_live, fields, end_cursor | 1 |
locations | query | — | 1 |
facebook_ads
Meta Ads Library:搜尋廣告、依關鍵字尋找廣告主、取得廣告主粉絲專頁詳細資料、單則廣告詳細資料和支援的國家/地區。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
search | — | query, ad_page_id, country, activeStatus, after_time, before_time, sort_data, end_cursor | 1 |
keywords | query | country | 1 |
page_details | page_id | — | 1 |
archive_details | ad_archive_id | page_id, country, is_ad_non_political, is_ad_not_aaa_eligible | 1 |
countries | — | — | 1 |
facebook_marketplace
Facebook Marketplace:搜尋刊登項目、車輛和租屋資訊,取得刊登項目和賣家詳細資料、類別及城市座標。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
search | — | query, category_url, commerce_search_sort_by, commerce_search_and_rp_condition, filter_location_latitude, filter_location_longitude, filter_price_lower_bound, filter_price_upper_bound, filter_radius_km, posted_today, exact_match, limit, end_cursor | 1 |
vehicles | — | sort_by, filter_location_latitude, filter_location_longitude, filter_price_lower_bound, filter_price_upper_bound, filter_radius_km, is_c2c_listing_only, end_cursor | 1 |
rentals | — | sort_by, filter_location_latitude, filter_location_longitude, filter_price_lower_bound, filter_price_upper_bound, filter_radius_km, filter_bedrooms_min, filter_bedrooms_max, filter_bathrooms_min, filter_bathrooms_max, end_cursor | 1 |
listing | listing_id | — | 1 |
seller | seller_id | — | 1 |
categories | — | — | 1 |
city_coordinates | city | country, exactly_one | 1 |
facebook_media_download
從 URL 下載 Facebook 媒體(圖片、影片、音訊)。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
download | url | — | 1 |
instagram_profile
Instagram 個人檔案:詳細資料、使用者 ID、貼文、Reels、精選動態和精選動態限時動態。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
details | username | link | 1 |
id | — | link, username | 1 |
posts | — | username, user_id, end_cursor | 1 |
reels | user_id | end_cursor | 1 |
highlights | user_id | — | 1 |
highlight_details | highlight_id | — | 1 |
instagram_post
Instagram 貼文:完整貼文詳細資料,或貼文 URL 中的 shortcode。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
details | shortcode | — | 1 |
id | link | — | 1 |
instagram_reels
Instagram Reels:熱門動態消息,或使用指定音軌的 Reels。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
feed | — | clips_media_id | 1 |
by_audio | audio_id | max_id | 1 |
instagram_search
依關鍵字搜尋 Instagram 上的熱門使用者、主題標籤和地點。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
search | keyword | end_cursor | 1 |
instagram_location
Instagram 地點:在某地標記的貼文,以及附近地點。
| 操作 | 必要輸入 | 選用輸入 | 點數 |
|---|---|---|---|
posts | location_id | tab, end_cursor | 1 |
nearby | location_id | — | 1 |
提示範例
「取得 Nike 的 Facebook 粉絲專頁詳細資料,並摘要他們最近的 10 篇貼文。」
「比較 Adidas 和 Nike 在 Instagram 上的追蹤者人數。」
「在美國的 Meta Ads Library 中,尋找提及 'running shoes' 的有效廣告。」
疑難排解
| 症狀 | 解決方法 |
|---|---|
Missing SocialAPIs API key | 加入 Authorization: Bearer <key> 標頭(託管端點)或 SOCIALAPIS_API_KEY(npx)。 |
| 結果中出現 HTTP 401 或 403 | 從控制台重新複製金鑰。 |
Insufficient credits | 前往 socialapis.io/pricing 升級或加值。 |
| 未列出任何工具 | 編輯設定後重新啟動用戶端,並確認 https://mcp.socialapis.io/health 有回應(在瀏覽器中開啟)。 |
聯絡我們
此伺服器已列於官方 MCP Registry,名稱為 io.github.SocialAPIsHub/social-media-api,也列於 Smithery、Glama、cursor.directory、LobeHub、mcp.so 和 mcpservers.org。請參閱 socialapis.io/integrations 取得連結。
原始碼:github.com/SocialAPIsHub/mcp-server。有任何問題,請寄信至 support@socialapis.io。