Use OpenAI Codex to research TikTok and Instagram
Updated
Virlo is social listening for TikTok and Instagram Reels. OpenAI Codex can code against any data you give it, but it has no feed of what is going viral. Run one codex mcp add command and Codex can pull trends, hooks, sounds and outlier videos from a database of 23.1M viral videos, in the Codex CLI, the IDE extension or the ChatGPT desktop app.
- One command with built-in sign-in
- Set up once for the CLI, IDE extension and desktop app
- Virlo skills that teach Codex to rank by Virality Score
Part of Virlo's AI assistant guides. Researching in a chat instead? See ChatGPT. Comparing coding agents? See Claude Code.
How do I add Virlo to OpenAI Codex?
One command adds the server and starts the sign-in. Skills are an optional extra.
Step 1: Create your Virlo account for free
Step 2: Add the Virlo server
Run this in your terminal. Codex writes the server to
~/.codex/config.toml, sees that Virlo supports sign-in and opens the Virlo page in your browser.Terminalcodex mcp add virlo --url https://dev.virlo.ai/api/mcp/mcpStep 3: Approve the sign-in
Approve access on the Virlo page and Codex saves the login. If you closed the tab, run the login command below. On a server with no browser, add
--no-browserand paste the redirect URL back.Terminalcodex mcp login virloStep 4: Optional: install the Virlo skills
Two skills:
virlopicks the right tool and ranks by Virality Score;short-form-trend-researchturns trend data into a weekly content plan.Terminalnpx skills add Virlo-AI/Virlo-Agent-PluginStep 5: Ask Codex
Run
codex mcp listto see virlo enabled, then start Codex and ask. It asks before each Virlo call unless you allow it.PromptUse Virlo to pull this week's top 10 TikTok trends to copy and save them to data/trends.json with name, stage and creators this week.
The Codex CLI, the IDE extension and the ChatGPT desktop app share one MCP configuration, so you set Virlo up once and it appears in all three.
Sign-in vs API key vs bridge: which Codex route should I pick?
| Route | Setup | Sign-in | Best for |
|---|---|---|---|
| Built-in sign-in | codex mcp add virlo --url https://dev.virlo.ai/api/mcp/mcp | Virlo sign-in in your browser (OAuth) | Your own laptop |
| API key from the environment | A [mcp_servers.virlo] table with url and bearer_token_env_var = "VIRLO_API_KEY" | API key, read from your shell | CI, servers and codex exec jobs |
| mcp-remote bridge | The npx mcp-remote config on the MCP server page | API key header | Older Codex versions |
| Virlo skills | npx skills add Virlo-AI/Virlo-Agent-Plugin | Uses the server you added | Better tool choices and rankings |
Which hook types win on Instagram, and do they win on TikTok too?
A real answer Codex can pull from Virlo and write to docs/hooks.md: hook types ranked by how often Instagram videos using them reach a Virality Score of 18 or more, next to the TikTok rate for the same hook.
In Virlo's snapshot of 262,402 hook-tagged Instagram videos, comparison hooks reached a Virality Score of 18 or more 18.9% of the time, the best rate on Instagram.
As of November 18, 2026
| Hook type | Instagram: share at 18+ | TikTok: share at 18+ | Instagram videos |
|---|---|---|---|
| Comparison | 18.9% | 29.8% | 2,909 |
| POV setup | 18.1% | 32.9% | 8,387 |
| Shock statement | 16.7% | 31.8% | 11,885 |
| Relatable scenario | 15.3% | 31.2% | 19,221 |
| Trend reference | 14.9% | 30.2% | 1,086 |
| Before and after | 14.5% | 28.6% | 1,879 |
Hook types by niche, with the Reels behind them
Split by 20+ niches, with every hook and video behind each number, in the Virlo app.
Open hooks in VirloHow this sample is made
- Source
- Virlo's daily hook snapshot: 262,402 Instagram and 1,353,173 TikTok videos whose opening hook was tagged by type.
- Window
- All tagged videos in the snapshot. Hook types with fewer than 1,000 videos on either platform, and videos with no hook, are left out.
- Method
- Share at 18+ = the share of videos with that hook type whose Virality Score is 18 or more. Sorted by the Instagram rate.
- As of
- November 18, 2026. Rebuilt every day.
- Made by
- Numbers are pulled automatically from Virlo's data; the text around them is written by the Virlo team.
Suggested citation: Source: Virlo, “Use OpenAI Codex to research TikTok and Instagram”, virlo.ai/codex
How do I run Virlo research from codex exec?
For scheduled jobs, use the API-key route so nothing waits on a browser. Put your key in VIRLO_API_KEY, add this table to ~/.codex/config.toml, and run a one-shot prompt with codex exec "…" from cron or CI.
| Line | What it does |
|---|---|
[mcp_servers.virlo] | Names the server virlo |
url = "https://dev.virlo.ai/api/mcp/mcp" | Points at Virlo's hosted server over Streamable HTTP |
bearer_token_env_var = "VIRLO_API_KEY" | Sends the key from that variable as Authorization: Bearer; keys start with virlo_tkn_ |
Keys come from your Virlo developer dashboard. The full block: [mcp_servers.virlo] url = "https://dev.virlo.ai/api/mcp/mcp" bearer_token_env_var = "VIRLO_API_KEY"
What can I ask Codex to build with Virlo?
Paste into the Codex CLI, the IDE extension or the desktop app. Replace the brackets.
Dataset
Pull 50 TikTok videos about [topic] from the last 30 days with Virlo, ranked by Virality Score, into data/videos.json.
Dashboard
Build a Next.js page that reads data/trends.json and shows each trend as a card with its stage and creators this week.
Hook study
Compare which hook types win on TikTok and on Instagram with Virlo, then write the findings to docs/hooks.md as a table.
Weekly job
Write a script that runs codex exec every Monday to refresh research/trends.md from Virlo.
Transcript tool
Get the transcript of [TikTok link] from Virlo and write a function that splits it into hook, body and call to action.
Sound picker
List the five sounds trending on Instagram Reels this week and add them to content/sounds.md with the artist.
Product match
Read README.md, then use Virlo to find 10 TikTok videos that match what this product does and explain why each worked.
Codex vs ChatGPT vs Claude Code: which guide do I need?
This page covers OpenAI Codex. All three reach the same Virlo server.
OpenAI Codex (this page)
OpenAI's coding agent in the terminal, your IDE and the ChatGPT desktop app. Add Virlo with codex mcp add.
ChatGPT
The chat assistant. Add Virlo as an app in developer mode and ask in a chat.
Claude Code
Anthropic's terminal agent. Add Virlo with claude mcp add or the Virlo plugin.
What are the limits?
- Public TikTok and Instagram data only. Virlo never connects to your social accounts and cannot post.
- Restart Codex after you add Virlo, because MCP servers load at startup.
- Keep keys out of your repo: use
bearer_token_env_varrather than writing the key intoconfig.toml. - Transcripts cover TikTok videos. Instagram Reels return hooks, formats and numbers.
- See pricing for Virlo plans.
Frequently asked questions
How do I add an MCP server to Codex?
Use codex mcp add with a name and --url. For Virlo: codex mcp add virlo --url https://dev.virlo.ai/api/mcp/mcp. Codex saves it in ~/.codex/config.toml, detects that Virlo supports OAuth and opens the sign-in page. Check it with codex mcp list, which shows virlo as enabled.
Does Codex support remote MCP servers?
Yes. Codex connects to Streamable HTTP servers by URL, with OAuth sign-in or a bearer token read from an environment variable. Virlo's hosted server works both ways, so you no longer need the mcp-remote bridge unless you run an older Codex.
How do I log in to an MCP server in Codex?
Run codex mcp login followed by the server name, for example codex mcp login virlo. Codex opens the server's sign-in page and stores the token. Add --no-browser on a remote machine, open the printed link elsewhere and paste the redirect URL back.
What are Codex skills for social media research?
Skills are instruction files an agent loads when a task matches. Virlo ships two: virlo, which picks the right tool and ranks by Virality Score, and short-form-trend-research, which turns trend data into a content plan. Install them with npx skills add Virlo-AI/Virlo-Agent-Plugin.
Can I use Virlo in the Codex IDE extension?
Yes. The Codex CLI, the IDE extension and the ChatGPT desktop app share one MCP configuration. Add Virlo once from the terminal, or from the MCP servers screen in the extension's settings, and it is available in all three.
How do I use Virlo in codex exec without a browser?
Use an API key. Set VIRLO_API_KEY in the environment, then in ~/.codex/config.toml give the virlo server a url and bearer_token_env_var = "VIRLO_API_KEY". codex exec can then call Virlo from cron or CI with no sign-in step.
Is Codex the same as ChatGPT?
No. Codex is OpenAI's coding agent; ChatGPT is the chat assistant. Both can use Virlo: Codex through codex mcp add, ChatGPT as an app in developer mode. The ChatGPT guide covers the chat route.
Can Codex post to social media through Virlo?
No. Virlo is read-only research on public TikTok and Instagram data. Codex can build tools, reports and scripts on that data, but it cannot post, comment or reach your accounts through Virlo.
Give Codex real social media data
One command connects Virlo to the CLI, your IDE and the desktop app.