Social Media Listening
Overview
This recipe demonstrates how to leverage Airtop’s SDK to autonomously search social media posts and automate a reply. We can achieve all that by using just the following API’s:
Demo
A live demo of this recipe is available here. You can sign up to create an API key for free and try it out yourself!
Running Locally
To get started, ensure you have:
- Node.js installed on your system.
- An Airtop API key. You can get one for free.
- Clone the repository and install dependencies
- Run the CLI. This will run the agent on the command line and is useful for quickly testing the agent.
If you want to use the same parameters as in the example. You can run the script using the default values:
- (optional) Run the web application. This will start the Next.js app that is demoed in the video above.
Walkthrough

The application will require you to enter a few parameters to accomplish the task.
- Airtop Profile (Optional): If you enter a Profile Name that is already logged in to x.com, this will skip the step of having you log in.
- Query: The query to use in X’s search bar. E.g. #ai #agents #langchain.
- Match Prompt: The criteria to use to find candidate posts to reply to. E.g. The post mentions an AI framework or tool.
- Reply Prompt: The way in which the reply should be written. E.g. Friendly response that casually mentions Airtop.
- Result Limit: The number of posts to extract.
Sign in
Here the agent is prompted to verify if the user is signed in or not.
Sign In prompt
Extract posts
After the agent has validated that the user is signed in, it will proceed with finding the posts based on the query
and the matchPrompt
.
Extraction Prompt
Reply to the first matched post
The agent will generate a reply based on replyPrompt
provided at the beginning. It will generate a reply
only for the first matched post just to keep this recipe simple, however, this behavior could be easily adjusted
to cover all the extracted posts.