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_pagedetails, id, posts, videos, reels, albums, album_items
facebook_groupdetails, id, posts, videos, albums, album_items
facebook_postdetails, details_extended, id, attachments, video, comments, comment_replies
facebook_searchpages, people, posts, videos, locations
facebook_adssearch, keywords, page_details, archive_details, countries
facebook_marketplacesearch, vehicles, rentals, listing, seller, categories, city_coordinates
facebook_media_downloaddownload
instagram_profiledetails, id, posts, reels, highlights, highlight_details
instagram_postdetails, id
instagram_reelsfeed, by_audio
instagram_searchsearch
instagram_locationposts, 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 和相簿。

操作必要輸入選用輸入點數
detailslinkexact_followers_count1(使用 exact_followers_count=true 時為 5)
idlink—1
postslinklimit, end_cursor, after_time, before_time, timezone每傳回 3 篇貼文扣 1 點(至少 1 點)
videoslink 或 profile_idlimit, end_cursor1
reelslinkend_cursor1
albumsprofile_id(來自 id)limit(8-16)、end_cursor1
album_itemsalbum_id(來自 albums)end_cursor1

facebook_group

公開 Facebook 社團:詳細資料、社團 ID、貼文、影片和相簿。

操作必要輸入選用輸入點數
detailslink—1
idlink—1
postslinklimit, end_cursor, after_time, before_time, timezone每傳回 3 篇貼文扣 1 點(至少 1 點)
videoslinkend_cursor1
albumsgroup_id(來自 id)limit(8-16)1
album_itemsalbum_id(來自 albums)end_cursor1

facebook_post

Facebook 貼文、影片和留言:貼文詳細資料、附件、留言和回覆。

操作必要輸入選用輸入點數
detailslink—1
details_extendedlink—1
idlink—1
attachmentspost_id—5
videovideo_id—1
commentslinklimit, end_cursor, include_reply_info1
comment_repliescomment_feedback_id, expansion_token—1

facebook_search

依關鍵字搜尋 Facebook:粉絲專頁、人物、貼文、影片和地點。

操作必要輸入選用輸入點數
pagesquerylocation_uid, end_cursor1
peoplequerylocation_uid, end_cursor1
postsquerylocation_uid, start_time, end_time, recent_posts, end_cursor1
videosquerymost_recent, videos_live, fields, end_cursor1
locationsquery—1

facebook_ads

Meta Ads Library:搜尋廣告、依關鍵字尋找廣告主、取得廣告主粉絲專頁詳細資料、單則廣告詳細資料和支援的國家/地區。

操作必要輸入選用輸入點數
search—query, ad_page_id, country, activeStatus, after_time, before_time, sort_data, end_cursor1
keywordsquerycountry1
page_detailspage_id—1
archive_detailsad_archive_idpage_id, country, is_ad_non_political, is_ad_not_aaa_eligible1
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_cursor1
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_cursor1
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_cursor1
listinglisting_id—1
sellerseller_id—1
categories——1
city_coordinatescitycountry, exactly_one1

facebook_media_download

從 URL 下載 Facebook 媒體(圖片、影片、音訊)。

操作必要輸入選用輸入點數
downloadurl—1

instagram_profile

Instagram 個人檔案:詳細資料、使用者 ID、貼文、Reels、精選動態和精選動態限時動態。

操作必要輸入選用輸入點數
detailsusernamelink1
id—link, username1
posts—username, user_id, end_cursor1
reelsuser_idend_cursor1
highlightsuser_id—1
highlight_detailshighlight_id—1

instagram_post

Instagram 貼文:完整貼文詳細資料,或貼文 URL 中的 shortcode。

操作必要輸入選用輸入點數
detailsshortcode—1
idlink—1

instagram_reels

Instagram Reels:熱門動態消息,或使用指定音軌的 Reels。

操作必要輸入選用輸入點數
feed—clips_media_id1
by_audioaudio_idmax_id1

instagram_search

依關鍵字搜尋 Instagram 上的熱門使用者、主題標籤和地點。

操作必要輸入選用輸入點數
searchkeywordend_cursor1

instagram_location

Instagram 地點:在某地標記的貼文,以及附近地點。

操作必要輸入選用輸入點數
postslocation_idtab, end_cursor1
nearbylocation_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。