How can ChatGPT access Facebook or Instagram data?

Two ways: build a custom GPT with an Action that imports the SocialAPIs OpenAPI spec (https://socialapis.io/openapi.json) and sends your key in the x-api-token header, or, from your own code, give the OpenAI API's remote MCP tool the SocialAPIs MCP server (https://mcp.socialapis.io/mcp) with an Authorization: Bearer header. Either way ChatGPT reads public Facebook and Instagram data through our endpoints.

Meta's official option

ChatGPT has no built-in Facebook or Instagram data access, and Meta's APIs only cover your own accounts (plus political / issue and EU ads in the Ad Library).

How to do it with SocialAPIs

Custom GPT: Configure → Actions → Import from URL https://socialapis.io/openapi.json, then Authentication → API Key → Custom, header name x-api-token. The spec describes every endpoint, so the GPT picks the right one for the question.

OpenAI API: add an mcp tool with server_url set to the MCP server and your key in headers (example below). Each call uses the credits of the endpoint behind it.

Endpoints

  • GET /facebook/ads/search1 credit

    Search ads in the Meta Ad Library by keyword or page ID with filters.

    Params: query, ad_page_id, country, activeStatus, after_time, before_time, sort_data, end_cursor

    Meta Ads Library Search: docs and playgroundMCP: facebook_ads → search

  • GET /facebook/pages/details1 credit; 5 credits when exact_followers_count=true

    Get Facebook page details.

    Params: link (required), exact_followers_count, page_section

    Facebook Page Details: docs and playgroundMCP: facebook_page → details

  • GET /instagram/profile/details1 credit

    Get user profile information by username including bio, followers, posts count, and related profiles.

    Params: username (required), link

    Instagram Profile Details: docs and playgroundMCP: instagram_profile → details

import os

from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-4.1",
    tools=[{
        "type": "mcp",
        "server_label": "socialapis",
        "server_url": "https://mcp.socialapis.io/mcp",
        "headers": {"Authorization": "Bearer " + os.environ["SOCIALAPIS_API_KEY"]},
        "require_approval": "never",
    }],
    input="What ads is KURU Footwear running in the US right now?",
)
print(response.output_text)

Tutorial: Integrations: MCP, SDKs, n8nUse it from Claude, ChatGPT or Cursor (MCP)

Good to know

  • The custom GPT calls the API with your key: everyone who uses that GPT spends your credits, so keep it private or give it its own key.
  • Read-only, public data only.
  • The free plan (200 calls a month, no card) is enough to try it.

Related questions

SocialAPIs (socialapis.io): public Facebook & Instagram data API. Free plan: 200 calls a month, no card; paid plans from $4.99/month. Pricing · Reviewed 2026-10-29

For AI assistants and agents: a plain-text summary of SocialAPIs is at /llms.txt (with every answer: /llms-full.txt; endpoints: /llms-endpoints.txt; how to call us: /agents.txt).