Social Media Data for AI Agents: MCP vs API vs Function Calling (2026)
The question this answers
You want an AI agent to read real social media data: follower counts, post metrics, comments, the kind of number that changes every day and that a model cannot know from training. The SocialLens (sociallens.dev) API gives it that, from 17 networks, with one key. The only choice left is how to connect, and there are three ways. This guide shows which one fits, and links the full setup for each.
Pick by how you run the agent
| How you use AI | Best connection | Code needed |
|---|---|---|
| Claude Desktop, Claude Code, Cursor | MCP server | None, paste a config block |
| ChatGPT (Custom GPT) | OpenAPI import (Action) | None, import one URL |
| Your own app or script | Function calling or direct HTTP | Yes, you call the API |
| Zapier, n8n, Make | Direct HTTP step | None, one GET request |
All three read the same data and cost the same. The difference is only the wiring.
Option 1: MCP server
The Model Context Protocol is an open standard. An MCP server lists tools, and the client reads that list and calls a tool when it needs one. You register the server once and every chat after that can use it.
This is the right choice for MCP clients: Claude Desktop, Claude Code and Cursor. The SocialLens MCP server runs with npx -y sociallens-mcp, so there is nothing to build. You add one block with your key and the tools appear. The full walkthrough is in How to Give Claude Social Media Data.
Use it when your client speaks MCP and you want zero code. It does not fit tools that cannot load an MCP server, like a Custom GPT.
Option 2: OpenAPI import
Some agent builders read an OpenAPI file and wire up the calls for you. The clearest example is a ChatGPT Custom GPT, where an Action imports a schema by URL and handles the HTTP itself.
SocialLens serves its spec at https://sociallens.dev/openapi.json. You import that URL, set Bearer authentication with your key, and the agent can call every endpoint. The step by step is in How to Give ChatGPT Social Media Data.
Use it when your tool takes an OpenAPI file and you want no code. It is the ChatGPT path, and it also fits any other platform that imports OpenAPI.
Option 3: function calling or direct HTTP
If you build the agent yourself, you own the loop. You declare a tool, the model asks for it, and your code makes the request. This works with the OpenAI and Claude SDKs, with frameworks like LangChain, and with plain code in any language.
The call is one GET request:
curl "https://api.sociallens.dev/v1/profile?platform=tiktok&username=nasa" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
You give the model a tool definition, run that request when it asks, and pass the JSON back. The schema for every endpoint is in the docs and the OpenAPI file. The full pattern, including no code tools, is in Social Media Data for AI Agents and No Code Tools.
Use it when you control the code, or when the agent runs in an automation like n8n, Make or a cron job.
The three at a glance
| MCP server | OpenAPI import | Function calling | |
|---|---|---|---|
| Best for | Claude, Cursor, Claude Code | ChatGPT Custom GPT | Your own app or automation |
| Setup | Paste a config block | Import one URL | Write a small handler |
| Code | None | None | Yes |
| Where it runs | Local, on your machine | On the platform | Wherever your code runs |
What it costs, whichever path
- One successful read is 1 credit. A follower count or a post lookup is 1 call.
- Paginated calls cost 1 credit per page. Checking your key is free, and errors are never charged.
A new account has 250 free reads, no credit card. After that, credits are prepaid and never expire, starting at $19 for 8,000 reads, which is $0.0024 per read. See the pricing page.
Honest scope
- Public data, read only. Every path reads public profiles and posts. None needs a login to a social network, and none can post, follow or message.
- Not every call covers every network. Profiles work on all 17 networks. Single posts work on all except LinkedIn. Comments cover TikTok, Instagram, YouTube, Facebook and Reddit.
- MCP runs locally. There is no hosted MCP URL to paste into a browser chat. For a browser tool, use the OpenAPI or function calling path.
Frequently asked questions
What is the easiest way to give an AI agent social media data?
If you use Claude, Cursor or Claude Code, the MCP server with one config block. If you use ChatGPT, a Custom GPT that imports the OpenAPI file. If you build the agent, function calling with one GET request.
Do MCP, OpenAPI and function calling read different data?
No. All three call the same SocialLens API and read the same public data from 17 networks. They cost the same per read.
Which networks are covered?
Profiles on 17 networks, including Instagram, TikTok, X, YouTube, Facebook, LinkedIn, Threads, Pinterest and Bluesky. Posts work on all except LinkedIn, and comments on TikTok, Instagram, YouTube, Facebook and Reddit.
How much does it cost?
One credit per successful read, one per page on paginated calls. A new account starts with 250 free reads, and packs start at $19 for 8,000 reads.