X (Twitter)

Formerly known as Twitter. From breaking news and entertainment to sports and politics, get the full story with all the live commentary. Use a X developer app you've created to send API requests.

Go to site
Explore
/
Apps
/
X (Twitter)

X (Twitter) API Integrations

Build and run workflows using the X (Twitter) API. Use 1000s of source-available triggers and actions across 2,000+ apps. Or write custom code to integrate any app or API in seconds.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { axios } from "@pipedream/platform"
import twitter from "@pipedream/twitter"
export default defineComponent({
  props: {
    twitter
  },
  async run({steps, $}) {
    const config = {
      url: `https://api.twitter.com/2/users/me`,
      params: {
        "user.fields": `created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,url,username,verified,withheld`,
        expansions: `pinned_tweet_id`,
      },
    }
    const headers = this.twitter._getAuthHeader(config)
    return await axios($, {
      ...config,
      headers
    })
  },
})

Choose an API to Connect with X (Twitter) API

1
-
24
of
2,000+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Google Drive
Google Drive
Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere.
Google Sheets
Google Sheets
Use Google Sheets to create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device.
Filter
Filter
Specify a condition that your workflow must meet and whether you'd like to proceed or end workflow execution.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Data Stores
Data Stores
Use Pipedream Data Stores to manage state throughout your workflows.
GitHub
GitHub
Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.
Formatting
Formatting
Pre-built actions to make formatting and manipulating data within your workflows easier.
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Airtable (OAuth)
Airtable (OAuth)
Airtable is a low-code platform to build next-gen apps. Move beyond rigid tools, operationalize your critical data, and reimagine workflows with AI.
Zoom
Zoom
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars.
Google Calendar
Google Calendar
With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next.
Gmail
Gmail
Gmail offers private and secure email by Google at no cost, for business and consumer accounts.
Gmail (Developer App)
Gmail (Developer App)
Private and secure email by Google at no cost, for business and consumer accounts. Use this app to connect your own developer account credentials.
Email
Email
Trigger workflows on new emails, and send emails to yourself as part of a Pipedream workflow.
Delay
Delay
Delay, pause, suspend, or have the execution of your workflow wait for as little as one millisecond, or as long as one year.
Go
Go
Anything you can do in Go, you can do in a Pipedream Workflow. You can use any of Go packages available with a simple import.
Premium
Zoom Admin
Zoom Admin
Video conferencing (includes account-level scopes) for Zoom Admins.
Twilio
Twilio
Twilio is a cloud communications platform for building SMS, Voice & Messaging applications on an API built for global scale.
Bash
Bash
Run any Bash in a Pipedream step within your workflow, including making curl requests.

Getting Started

In order to connect your Twitter account to Pipedream, you'll need to create a developer project and app.

  1. First, visit Twitter's developer dashboard and sign in
  2. Next, create a new project and give it a name, select a use case, and provide a description

Creating a Project and App

  1. Provide a name for your app
  2. Note the API Key and API Key Secret that are displayed (the setup isn't done yet, but note these down)
  3. Click "App settings" at the bottom right of the screen

Configuring Authentication Settings

  1. In the bottom of your app's settings, in the "User Authentication Settings", choose "Set Up"
  2. Select the appropriate app permissions based on your use case
  3. Select "Web App, Automated App or Bot (Confidential client)" in the "Type of App" section
  4. Enter this URI in the "Callback URI / Redirect URI": https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback
  5. Enter a website URL
  6. Click "Done" (the Client ID and Client Secret that are shown on the next page are not required for this setup)
  7. Enter the API Key and API Key Secret when prompted in Pipedream (if you lose them and need to regenerate new keys, you can do so from the "Keys and tokens" tab in your app's settings in Twitter's developer dashboard, in the "Consumer Keys" section)

Consumer API key

Simple Search with Twitter API on New Review Request (Instant) from Gitlab API
Gitlab + X (Twitter)
 
Try it
Simple Search with Twitter API on Activity Deleted from Strava API
Strava + X (Twitter)
 
Try it
Simple Search with Twitter API on New Deploy Failure (Instant) from Netlify API
Netlify + X (Twitter)
 
Try it
Simple Search with Twitter API on New Pub/Sub Messages from Google Cloud API
Google Cloud + X (Twitter)
 
Try it
Simple Search with Twitter API on New Football League Transactions from Yahoo! Fantasy Sports API
Yahoo! Fantasy Sports + X (Twitter)
 
Try it
New Follower Received by User from the X (Twitter) API

Emit new event when the specified User receives a Follower See the documentation

 
Try it
New List Followed by User from the X (Twitter) API

Emit new event when the specified User follows a List See the documentation

 
Try it
New Mention Received by User from the X (Twitter) API

Emit new event when the specified User is mentioned in a Tweet See the documentation

 
Try it
New Message Received from the X (Twitter) API

Emit new event when a new Direct Message (DM) is received See the documentation

 
Try it
New Tweet Liked by User from the X (Twitter) API

Emit new event when a Tweet is liked by the specified User See the documentation

 
Try it
Search Tweets with the X (Twitter) API

Retrieve Tweets from the last seven days that match a query. See the documentation

 
Try it
Add User To List with the X (Twitter) API

Add a member to a list owned by the user. See the documentation

 
Try it
Create Tweet with the X (Twitter) API

Create a new tweet. See the documentation

 
Try it
Delete Tweet with the X (Twitter) API

Remove a posted tweet. See the documentation

 
Try it
Follow User with the X (Twitter) API

Follow a user. See the documentation

 
Try it

Troubleshooting

Below are some of the most common issues we see.

Issues Connecting Twitter

If you run into an error during the app connection process, make sure to doublecheck the below configurations:

  1. Ensure that you've entered the correct developer_consumer_key and developer_consumer_secret in Pipedream. These map to Twitter's "API Key" and "API Key Secret" in the "Keys & Tokens" section in their dashboard.
  2. Make sure the "Callback URI / Redirect URL" that you configure within the "User Authentication settings" for your app in Twitter's developer console exactly matches: https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback

Errors from Twitter's API or Twitter Sources and Actions

  1. Free Twitter developer accounts only have access to write endpoints (for example, actions like "Create Tweet" and "Create Retweet")
  2. Twitter developer accounts on their Basic plan have access to write and read endpoints (for example, actions like "Create Tweet" and "Search Tweets", as well as sources like "New Post Matching Query")
  3. If you are getting errors from the Twitter sources or actions, please consult the developer plan to confirm if you have access to those endpoints.

Authentication

X (Twitter) uses OAuth authentication. When you connect your X (Twitter) account, Pipedream will open a popup window where you can sign into X (Twitter) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any X (Twitter) API.

Pipedream requests the following authorization scopes when you connect your account:

OAuth Request Configurations:
  1. requestToken
    POSThttps://api.twitter.com/oauth/request_token
  2. authorization
    GEThttps://api.twitter.com/oauth/authenticate?client_id={{oauth.client_id}}&force_login=true&oauth_token={{oauth.token}}&redirect_uri={{oauth.redirect_uri}}&response_type=code&state={{oauth.state}}
  3. accessToken
    POSThttps://api.twitter.com/oauth/access_tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}&code_verifier=challenge
Using Event Sources and Workflows: Analyze Twitter Sentiment in Real-Time and Save to Google Sheets
Using Event Sources and Workflows: Analyze Twitter Sentiment in Real-Time and Save to Google Sheets
Learn how you can use Pipedream event sources and serverless workflows to listen for new Twitter mentions, analyze the sentiment of each Tweet using the npm sentiment package (https://www.npmjs.com/package/sentiment), and then save that data to Google Sheets in real-time.
Entering Data in Params Forms
Entering Data in Params Forms
Learn about the new model to enter expressions and reference previous step exports in params forms.
Managing the Concurrency and Execution Rate of Workflow Events
Managing the Concurrency and Execution Rate of Workflow Events
Managing the Concurrency and Execution Rate of Workflow Events.

Community Posts

A Look at Pipedream
A Look at Pipedream
I'm going to build a workflow that will search Twitter every hour for a keyword. It will take the results, format them nicely, and then email it.
Building a Google Sheets Twitter Bot with Pipedream
Building a Google Sheets Twitter Bot with Pipedream
This is something that's been kicking around my head for a week or so and today I thought I'd try it. It ended up taking about 20 minutes total and 10 lines of code, of which 5 are a function I copied and pasted. While what I built is kind of trivial, I'm blown away by how much was done by built-in functions with Pipedream and how little work I had to do myself. In fact, most of my time was spent in setting stuff up outside of Pipedream itself. Alright, so what did I build?
Building a Twitter Bot in Pipedream
Building a Twitter Bot in Pipedream
I did this by parsing information from the GI Joe wikipedia site and implementing it on Pipedream's platform. I'm going to share how I built it, but be aware that roughly 95% of the work was involved in getting my random character. The aspects that pertain to Pipedream were incredibly simple - which is what you want in a platform.
Using State in Pipedream Workflows
Using State in Pipedream Workflows
I did this by parsing information from the GI Joe wikipedia site and implementing it on Pipedream's platform. I'm going to share how I built it, but be aware that roughly 95% of the work was involved in getting my random character. The aspects that pertain to Pipedream were incredibly simple - which is what you want in a platform.
Building a Twitter Scheduling System with Pipedream and Google Sheets
Building a Twitter Scheduling System with Pipedream and Google Sheets
A few months ago, I blogged about how I used Pipedream and Google Sheets to create a Twitter bot. The idea was simple - read a sheet - select a random row - and use that as the source of a new Tweet. I was thinking about this recently and how useful Google Sheets can be as a "light weight CMS" and figured out another interesting use case - Twitter scheduling.
A demo of using the Twitter API, via Pipedream, to render the images from a Twitter account.