# social-media-api [Health: Active]

**Category:** 🌐 Social Media  
**Repository:** https://github.com/SocialAPIsHub/mcp-server  
**GitHub Stars:** 3  
**npm Downloads (last month):** 781  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/social-media-api

## Description
Unified social media API for AI agents. Access Facebook, Instagram, TikTok, and more.

## Tools
Capabilities this server exposes over MCP:

- **facebook_page** — Facebook pages: profile details, page ID, posts, videos, reels and photo albums.

Actions:
- action=details: Get a Facebook page's profile: name, category, follower and like counts, bio, contact info (email, phone, website, address), rating and the ad_page_id used by the Ads Library tools. Use it when you have the page URL; to find a page by name, use facebook_search (action=pages) first. Pricing: 1 credit per call; 5 credits when exact_followers_count=true.
  Inputs: link (required), exact_followers_count (optional).
- action=id: Resolve a Facebook page URL to its numeric page ID. Use it when another tool needs a page or profile ID; use action=details for the page's data. Pricing: 1 credit per call.
  Inputs: link (required).
- action=posts: List a Facebook page's recent posts, newest first, with text, media, reactions, comment and share counts. Returns 3-9 posts per call plus an end_cursor for the next page; filter by date with after_time / before_time. For reels or videos only, use action=reels or action=videos. Pricing: ceil(posts_returned / 3) credits per call, minimum 1.
  Inputs: link (required), limit (optional), end_cursor (optional), after_time (optional), before_time (optional), timezone (optional).
- action=videos: List videos uploaded to a Facebook page, with video_id, title, duration, view count and thumbnail. Provide the page URL (link) or its numeric profile_id. Returns an end_cursor for the next page. For short-form reels, use action=reels. Pricing: 1 credit per call.
  Inputs: link (optional), profile_id (optional), limit (optional), end_cursor (optional).
- action=reels: List a Facebook page's reels (short-form videos). Returns an end_cursor for the next page. For long-form videos, use action=videos. Pricing: 1 credit per call.
  Inputs: link (required), end_cursor (optional).
- action=albums: List the photo albums of a Facebook page, with album_id, album_title, url, thumbnail_uri and album_items_count (text, e.g. "400 items"). Needs the numeric page ID (profile_id) from action=id. Returns an end_cursor for the next page. To get the photos in an album, pass its album_id to action=album_items. Pricing: 1 credit per call.
  Inputs: profile_id (required), limit (optional), end_cursor (optional).
- action=album_items: Get the photos and videos inside a Facebook album (from a page or a group): media_id, media_type, url, thumbnail_uri and timestamp (Unix seconds). Needs an album_id from action=albums or facebook_group (action=albums). Returns an end_cursor for the next page. Pricing: 1 credit per call.
  Inputs: album_id (required), end_cursor (optional).
- **facebook_group** — Public Facebook groups: details, group ID, posts, videos and photo albums.

Actions:
- action=details: Get a public Facebook group's profile: name, description, member count, privacy, rules and activity stats. Use action=posts for its posts. Pricing: 1 credit per call.
  Inputs: link (required).
- action=id: Resolve a Facebook group URL to its numeric group ID. Use action=details for the group's data. Pricing: 1 credit per call.
  Inputs: link (required).
- action=posts: List recent posts from a public Facebook group, with text, media, author, reactions and comment counts. Returns 3-9 posts per call plus an end_cursor for the next page; filter by date with after_time / before_time. Pricing: ceil(posts_returned / 3) credits per call, minimum 1.
  Inputs: link (required), limit (optional), end_cursor (optional), after_time (optional), before_time (optional), timezone (optional).
- action=videos: List videos posted in a public Facebook group, with video_id, title, duration, view count and thumbnail. Returns an end_cursor for the next page. Pricing: 1 credit per call.
  Inputs: link (required), end_cursor (optional).
- action=albums: List the photo albums of a public Facebook group, with album_id, album_title, url, thumbnail_uri, photos_count and videos_count. Returns an end_cursor for the next page. Needs the numeric group ID (group_id) from action=id. To get the photos in an album, pass its album_id to action=album_items. Pricing: 1 credit per call.
  Inputs: group_id (required), limit (optional).
- action=album_items: Get the photos and videos inside a Facebook album (from a page or a group): media_id, media_type, url, thumbnail_uri and timestamp (Unix seconds). Needs an album_id from facebook_page (action=albums) or action=albums. Returns an end_cursor for the next page. Pricing: 1 credit per call.
  Inputs: album_id (required), end_cursor (optional).
- **facebook_post** — Facebook posts, videos and comments: post details, attachments, comments and replies.

Actions:
- action=details: Get a Facebook post's text, author, timestamp, media, and reaction, comment and share counts. Start here for any post. If you need view counts, video download URLs or audio metadata (common for reels and videos), use action=details_extended instead. Pricing: 1 credit per call.
  Inputs: link (required).
- action=details_extended: Get everything action=details returns plus view counts, HD/SD video URLs, music/audio metadata and author verification status. Use it for reels and video posts, or when the standard details lack view_count, video_hd_src or attached_track. Pricing: 1 credit per call.
  Inputs: link (required).
- action=id: Extract the numeric post ID from a Facebook post URL. Use it to get the post_id that action=attachments needs. Pricing: 1 credit per call.
  Inputs: link (required).
- action=attachments: List every media attachment (images and videos, with URLs and dimensions) on a Facebook post, including all items in multi-photo posts. Needs the numeric post_id from action=id. For the post's text and engagement, use action=details. Pricing: 5 credits per call (deeper scrape than standard post details).
  Inputs: post_id (required).
- action=video: Get a Facebook video post's metadata: title, message text and hashtags, owner, reactions and view count. Needs the numeric video_id (the number in a facebook.com/.../videos/<id> URL, or from facebook_page (action=videos)). Pricing: 1 credit per call.
  Inputs: video_id (required).
- action=comments: List top-level comments on a Facebook post or reel, with author, text, timestamp and reaction count. Returns up to 30 per call plus an end_cursor for the next page. Set include_reply_info=true to get the comment_feedback_id and expansion_token that action=comment_replies needs. Pricing: 1 credit per call.
  Inputs: link (required), limit (optional), end_cursor (optional), include_reply_info (optional).
- action=comment_replies: List replies to one Facebook comment. Needs comment_feedback_id and expansion_token, which action=comments returns when called with include_reply_info=true. Pricing: 1 credit per call.
  Inputs: comment_feedback_id (required), expansion_token (required).
- **facebook_search** — Search Facebook by keyword: pages, people, posts, videos and locations.

Actions:
- action=pages: Find Facebook pages by keyword (brand, business or topic name), optionally near a location. Returns page names, URLs, categories and follower counts, 3 per call, plus an end_cursor. Use it when you don't have the page URL; then call facebook_page (action=details) with a result's URL. For locations, get a location_uid from action=locations. Pricing: 1 credit per call.
  Inputs: query (required), location_uid (optional), end_cursor (optional).
- action=people: Find public Facebook profiles by name or keyword, optionally near a location (location_uid from action=locations). Returns names, profile URLs and pictures, plus work, education and location where public, and an end_cursor. Pricing: 1 credit per call.
  Inputs: query (required), location_uid (optional), end_cursor (optional).
- action=posts: Search public Facebook posts by keyword, optionally filtered by location (location_uid from action=locations) and date range. Returns posts with text, author and engagement, plus an end_cursor. To list one page's posts, use facebook_page (action=posts) instead. Pricing: 1 credit per call.
  Inputs: query (required), location_uid (optional), start_time (optional), end_time (optional), recent_posts (optional), end_cursor (optional).
- action=videos: Search public Facebook videos by keyword, optionally most recent first or live videos only. Returns video titles, URLs and view counts, plus an end_cursor. Pricing: 1 credit per call.
  Inputs: query (required), most_recent (optional), videos_live (optional), fields (optional), end_cursor (optional).
- action=locations: Look up Facebook places by name (city, region, venue) and get their location_uid. The location_uid is only used to filter action=pages, action=people and action=posts; it is not a Marketplace location (use facebook_marketplace (action=city_coordinates) for that). Pricing: 1 credit per call.
  Inputs: query (required).
- **facebook_ads** — Meta Ads Library: search ads, find advertisers by keyword, advertiser page details, single ad details and supported countries.

Actions:
- action=search: Search ads in the Meta Ad Library. Pass a keyword (query) to find ads about a topic, or ad_page_id to list one advertiser's ads; filter by country, active status and date range, sort by impressions or recency. Returns ads with creative, body text, dates, platforms and snapshot URL, plus an end_cursor. Get an advertiser's ad_page_id from action=keywords or facebook_page (action=details). Pricing: 1 credit per call.
  Inputs: query (optional), ad_page_id (optional), country (optional), activeStatus (optional), after_time (optional), before_time (optional), sort_data (optional), end_cursor (optional).
- action=keywords: Find advertisers running ads that match a keyword: returns Facebook pages with their page_id and ad count. Use it to discover who advertises on a topic, then pass a page_id to action=search (as ad_page_id) or action=page_details. To get the ads for a keyword directly, use action=search. Pricing: 1 credit per call.
  Inputs: query (required), country (optional).
- action=page_details: Get an advertiser's Ads Library profile: page name, verification status, category, location and total ad count. Needs the page ID (ad_page_id from facebook_page (action=details) or page_id from action=keywords). To list the ads themselves, use action=search with ad_page_id. Pricing: 1 credit per call.
  Inputs: page_id (required).
- action=archive_details: Get one Ad Library ad in full: creative, body text, CTA, platforms, countries, date range, and spend and impression estimates where Meta publishes them. Needs the ad_archive_id from a action=search result. Pricing: 1 credit per call.
  Inputs: ad_archive_id (required), page_id (optional), country (optional), is_ad_non_political (optional), is_ad_not_aaa_eligible (optional).
- action=countries: List the country codes the Ads Library tools accept in their country parameter. Pricing: 1 credit per call.
  Inputs: none.
- **facebook_marketplace** — Facebook Marketplace: search listings, vehicles and rentals, listing and seller details, categories and city coordinates.

Actions:
- action=search: Search general Facebook Marketplace listings (items for sale) by keyword or category near a location, with price, condition, radius and sort filters. Returns listings with their listing_id, plus an end_cursor. For cars and other vehicles use action=vehicles; for homes and rooms to rent use action=rentals. Get coordinates from action=city_coordinates. Pricing: 1 credit per call.
  Inputs: query (optional), category_url (optional), commerce_search_sort_by (optional), commerce_search_and_rp_condition (optional), filter_location_latitude (optional), filter_location_longitude (optional), filter_price_lower_bound (optional), filter_price_upper_bound (optional), filter_radius_km (optional), posted_today (optional), exact_match (optional), limit (optional), end_cursor (optional).
- action=vehicles: Search Facebook Marketplace vehicle listings (cars, trucks, motorcycles) near a location, with price, radius and seller-type filters. Returns listings with title, price, mileage, year and listing_id, plus an end_cursor. For non-vehicle items, use action=search. Pricing: 1 credit per call.
  Inputs: sort_by (optional), filter_location_latitude (optional), filter_location_longitude (optional), filter_price_lower_bound (optional), filter_price_upper_bound (optional), filter_radius_km (optional), is_c2c_listing_only (optional), end_cursor (optional).
- action=rentals: Search Facebook Marketplace rental listings (apartments, houses, rooms) near a location, with price, bedroom, bathroom and radius filters. Returns rental listings with their listing_id, plus an end_cursor. For items for sale, use action=search. Pricing: 1 credit per call.
  Inputs: sort_by (optional), filter_location_latitude (optional), filter_location_longitude (optional), filter_price_lower_bound (optional), filter_price_upper_bound (optional), filter_radius_km (optional), filter_bedrooms_min (optional), filter_bedrooms_max (optional), filter_bathrooms_min (optional), filter_bathrooms_max (optional), end_cursor (optional).
- action=listing: Get one Marketplace listing in full: title, price, description, condition, all photos, location and seller. Needs the listing_id from a Marketplace search result. Pricing: 1 credit per call.
  Inputs: listing_id (required).
- action=seller: Get a Marketplace seller's profile: name, join date, rating, review count and badges. Needs the seller_id from action=listing. Pricing: 1 credit per call.
  Inputs: seller_id (required).
- action=categories: List Marketplace categories with their IDs and category_url values. Use a category_url to filter action=search. Pricing: 1 credit per call.
  Inputs: none.
- action=city_coordinates: Convert a city name to the latitude and longitude that the Marketplace search tools expect in filter_location_latitude / filter_location_longitude. Pricing: 1 credit per call.
  Inputs: city (required), country (optional), exactly_one (optional).
- **facebook_media_download** — Resolve a Facebook media URL (image, video or audio, e.g. from a post or reel) to direct downloadable file URLs. Returns URLs, not file bytes. Pricing: 1 credit per call.
Inputs: url (required).
- **instagram_profile** — Instagram profiles: details, user ID, posts, reels, highlights and highlight stories.

Actions:
- action=details: Get an Instagram profile by username: bio, follower and post counts, verification status and related profiles. Pricing: 1 credit per call.
  Inputs: username (required), link (optional).
- action=id: Resolve an Instagram username or profile URL to its two IDs: user_id (long, e.g. 17841401474538262), used by action=posts and action=reels, and pk (short, e.g. 528817151), used by action=highlights. Pricing: 1 credit per call.
  Inputs: link (optional), username (optional).
- action=posts: List an Instagram profile's posts (photos, videos, carousels) with captions, like and comment counts and media URLs. Pass username (returns more results) or user_id (the long user_id from action=id, not the pk). Returns an end_cursor for the next page. For reels only, use action=reels. Pricing: 1 credit per call.
  Inputs: username (optional), user_id (optional), end_cursor (optional).
- action=reels: List an Instagram profile's reels with play counts, captions, video URLs and audio metadata. Needs the long user_id from action=id (not the pk). Returns an end_cursor for the next page. Pricing: 1 credit per call.
  Inputs: user_id (required), end_cursor (optional).
- action=highlights: List an Instagram profile's story highlights with titles, cover images and highlight IDs. Needs the profile's pk from action=id, passed as user_id (not the long user_id). Use action=highlight_details to get the stories in one highlight. Pricing: 1 credit per call.
  Inputs: user_id (required).
- action=highlight_details: Get the stories inside one Instagram highlight. Needs a highlight_id from action=highlights. Pricing: 1 credit per call.
  Inputs: highlight_id (required).
- **instagram_post** — Instagram posts: full post details, or the shortcode from a post URL.

Actions:
- action=details: Get one Instagram post or reel in full: caption, media URLs, engagement counts, timestamp and owner. Needs the shortcode (the part after /p/ or /reel/ in the URL, or from action=id). Pricing: 1 credit per call.
  Inputs: shortcode (required).
- action=id: Extract the shortcode from an Instagram post or reel URL. action=details needs the shortcode. Pricing: 1 credit per call.
  Inputs: link (required).
- **instagram_reels** — Instagram Reels: the trending feed, or reels that use a given audio track.

Actions:
- action=feed: Get Instagram's recommended and trending reels. Pass clips_media_id from a previous result to continue the feed or get similar reels by the same author. Not tied to a user; for one profile's reels use instagram_profile (action=reels). Pricing: 1 credit per call.
  Inputs: clips_media_id (optional).
- action=by_audio: List Instagram reels that use a given sound. Needs the audio_id (music/audio cluster ID) found in reel results' audio metadata. Pass max_id from the previous response for the next page. Pricing: 1 credit per call.
  Inputs: audio_id (required), max_id (optional).
- **instagram_search** — Search Instagram by keyword and get the top matching users, hashtags and places. Use it to find a username, or a place's location_id for instagram_location (action=posts). Returns an end_cursor for more. Pricing: 1 credit per call.
Inputs: keyword (required), end_cursor (optional).
- **instagram_location** — Instagram locations: posts tagged at a place, and nearby places.

Actions:
- action=posts: List Instagram posts tagged at a location: top posts (tab=ranked) or most recent (tab=recent). Needs a location_id, e.g. from a place in instagram_search (action=search). Returns an end_cursor for the next page. Pricing: 1 credit per call.
  Inputs: location_id (required), tab (optional), end_cursor (optional).
- action=nearby: List Instagram places near a given location, with name, category, coordinates and post count. Needs a location_id, e.g. from a place in instagram_search (action=search). Pricing: 1 credit per call.
  Inputs: location_id (required).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "social-media-api": {
    "command": "npx",
    "args": ["-y","@socialapis/mcp"],
    "env": {
      "SOCIALAPIS_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `SOCIALAPIS_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What social-media-api does

social-media-api exposes SocialAPIs through MCP for retrieving public Facebook and Instagram data. The server organizes related operations into resource-oriented tools, with an `action` parameter selecting the requested operation. Responses include structured results along with credit usage information, allowing an agent to track the cost of calls.

Facebook coverage includes page and public-group profiles, identifiers, posts, videos, reels, albums, album media, comments, replies, post attachments, video metadata, and downloadable media URLs. Search tools find pages, people, posts, videos, and locations. Additional tools query Meta Ads Library data and Facebook Marketplace listings, vehicles, rentals, sellers, categories, and city coordinates.

Instagram tools retrieve profile details, IDs, posts, reels, highlights, highlight stories, individual post details, trending reels, reels using a specific audio track, keyword results, location-tagged posts, and nearby places.

## How it works

Each action maps to a SocialAPIs API endpoint. Many workflows use an identifier from one action as the input to another: resolve a Facebook page or group ID before requesting albums, obtain a post ID before listing attachments, or retrieve Instagram’s long `user_id` and short `pk` for the relevant profile operations.

Paginated operations return a cursor for the next request. Date filters are available for Facebook page, group, and search results, while Marketplace searches support location, price, category, condition, radius, vehicle, and rental filters. Tool calls are read-only and expose output schemas.

Usage is credit-based. Most calls cost one credit, while some operations charge by result count or use a higher fixed cost, such as Facebook post attachments and exact follower counts. The tool descriptions expose the applicable pricing.

## Setup and configuration

The server can run locally with npm and npx, or remotely through Streamable HTTP. The local package is `@socialapis/mcp` and can be installed globally with npm:

```bash
npm install -g @socialapis/mcp
```

For a local stdio configuration, pass the API key as an argument:

```json
{
  "mcpServers": {
    "socialapis": {
      "command": "npx",
      "args": ["-y", "@socialapis/mcp", "YOUR_API_KEY"]
    }
  }
}
```

The key can instead be supplied through `SOCIALAPIS_API_KEY` or a `.env` file. The hosted endpoint is `https://mcp.socialapis.io/mcp`; send the key as an `Authorization: Bearer` header or with `x-api-token`. Tool listing works without a key, but tool calls require one.

Optional configuration controls the proxy URL, HTTP port, backend API URL, endpoint catalog location, catalog refresh interval, and whether the live catalog is enabled. The server can update descriptions, parameters, prices, and availability from the catalog without changing tool or action names.

## Tools and capabilities

- Query Facebook pages and public groups, including posts, videos, reels, albums, and comments.
- Search Facebook pages, people, posts, videos, and places.
- Inspect Meta Ads Library advertisers, ads, countries, creatives, platforms, and archive details.
- Search Facebook Marketplace items, vehicles, rentals, sellers, categories, and locations.
- Resolve Facebook image, video, and audio links to downloadable file URLs.
- Retrieve Instagram profiles, posts, reels, highlights, audio-based reel results, and location data.
- Follow cursors for additional results and apply supported date, location, price, and engagement-related filters.

## Limitations and notes

Only Facebook and Instagram data sources are live. TikTok, X/Twitter, LinkedIn, and YouTube are planned rather than available through the listed tools. The service returns download URLs for Facebook media instead of file bytes. Some actions require identifiers produced by earlier actions, and credit costs vary by operation and result size.

_Full upstream README: https://allmcps.com/mcp/social-media-api/readme_

