Signup comes with $1 in credit. No subscription needed.Claim your $1

Tools / X (Twitter) / API

Search X (Twitter) from Python with one HTTP request and one key

In Python, POST to the RouterGrowth run endpoint with social.search, platform x and your keyword, and read the posts from the JSON. There is no tweepy install, no X developer app or bearer token from X, and the same request works for Reddit and LinkedIn by changing one field.

Real run: 10 records $0.0007 per post social.search MCP · REST · CLI

Ask your agent

Write a Python script that searches X for python automation every hour and appends new posts to a CSV.

Connect RouterGrowth once, then ask in plain words. New workspaces start with $1 of credit. Get a key or read the setup guide.

A real run

What does it return?

One call to social.search (social post search), run through RouterGrowth on October 19, 2026. These are the first rows it returned; fields that name a person are masked.

10records returned
5.3 sto answer
$0.007charged for the run
textlikesviewsposted
Stop building AI that just answers questions. Build AI that does the work with these automation projects. https://t.co/XINeHtUgDg84282026-10-19
Mastering Python Network Automation by GitforGits | Asian Publishing House is on sale on Leanpub! Its suggested price is $29.99; get it for…0522026-10-19

Ten of the newest posts for python automation: course offers, job posts and learning threads, all from the same morning.

Step by step

How do you do it?

  1. Store your key

    Put the RouterGrowth key in an environment variable and send it as a Bearer header.

  2. POST the search

    Body: capability social.search, input with platform x, query and limit. requests, httpx or aiohttp all work.

  3. Read result.posts

    Each item has text, engagement, created_at, url and author_url.

  4. Schedule it

    Run the script from cron or a notebook and append new posts by URL to your dataset.

Price

What does it cost?

List prices on X, read from the catalog when this page was built. The exact figure is quoted before every run, and a monthly plan lowers it.

$0.0007per post
$0.002minimum for a call that returns results
$0when the call finds nothing

In practice

What do you ask it?

You describe the job; the agent picks the calls, shows the price and runs them.

Write a Python script that searches X for python automation every hour and appends new posts to a CSV.

In Python, search X for a keyword, then pull the last ten posts from the three accounts that posted most.

Connect

How do you connect it?

One MCP server for Claude, ChatGPT, Claude Code, Codex and Cursor, or the same call over the CLI and REST with the input above.

MCP server
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
CLI
npm install -g routergrowth && routergrowth setup
routergrowth run -c social.search -i '{"platform": "x", "query": "python automation", "limit": 10}'
REST
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "social.search", "input": {"platform": "x", "query": "python automation", "limit": 10}}'

Worth knowing

What should you know first?

No tweepy needed

tweepy wraps X's own API and its credentials. This is a plain JSON API, independent of X.

Mixed languages

Keyword search returns posts in any language. Add language words or filter on text if you need English only.

Read only

Nothing in the call posts or likes on X.

FAQ

Questions about twitter api python

Is there an official Python client?

None is needed. The REST API takes JSON, and the routergrowth CLI covers shell use.

Can I use async?

Yes. Any async HTTP client can send the same request.

How fresh are the posts?

The search returns the newest public posts it finds at call time.

Does it work for Reddit too?

Yes. Set platform to reddit in the same request.

More on X (Twitter)

Related pages

Reading this as an agent? This page as markdown: /tools/x-twitter/api-python.md

One key. Every network.

Connect your agent once. The first calls run on the $1 that comes with signup.