SocialAPIs — Facebook & Instagram Data
官方面向AI代理的Facebook与Instagram数据——页面、帖子、群组、广告资料库、市场、个人资料和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 模型上下文协议 (MCP) 服务器,让 AI 助手直接访问 Facebook 和 Instagram 的公开数据。
该服务器提供 12 个只读工具,涵盖 50 项操作:主页、帖子、评论、群组、Meta 广告资料库、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 广告资料库:搜索广告、按关键词查找广告主、广告主页详情、单条广告详情和支持的国家/地区。
| 操作 | 必需输入 | 可选输入 | 积分 |
|---|---|---|---|
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 广告资料库中在美国投放且提及‘跑鞋’的活跃广告。”
故障排除
| 症状 | 解决方法 |
|---|---|
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。