Twitter

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

Go to site
Explore
/
Apps
/
Twitter

Twitter API Integrations

Build and run workflows using the Twitter API. Use 1000s of source-available triggers and actions across 1200+ 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 Twitter API

1
-
12
of
1200+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
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.
Beta
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.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Beta
Data Stores
Data Stores
Use Pipedream Data Stores to manage state throughout your workflows.
Telegram Bot
Telegram Bot
Telegram is a cloud-based instant messaging and voice over IP service
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 apps like ChatGPT and DALL·E 2.
Google Sheets
Google Sheets
With Google Sheets, you can create, edit, and collaborate wherever you are
Discord
Discord
Use this app to create a Discord source that emits messages from your guild to a Pipedream workflow.
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.
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.

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 Requests from HTTP / Webhook API
HTTP / Webhook + Twitter
 
Try it
Send Message (Advanced) with Discord Webhook API on New Tweet in List from Twitter API
Twitter + Discord Webhook
 
Try it
Add Multiple Rows with Google Sheets API on New Tweet in List from Twitter API
Twitter + Google Sheets
 
Try it
Simple Search with Twitter API on New Item in Feed from RSS API
RSS + Twitter
 
Try it
Simple Search with Twitter API on New Message from Discord API
Discord + Twitter
 
Try it
New Follower Received by User from the Twitter API

Emit new event when the specified User receives a Follower See docs here

 
Try it
New List Followed by User from the Twitter API

Emit new event when the specified User follows a List See docs here

 
Try it
New Tweet Liked by User from the Twitter API

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

 
Try it
New Tweet Posted by User from the Twitter API

Emit new event when the specified User posts a Tweet See docs here

 
Try it
New Tweet Posted in List from the Twitter API

Emit new event when a Tweet is posted in the specified list See docs here

 
Try it
Search Tweets with the Twitter API

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

 
Try it
Add User To List with the Twitter API

Add a member to a list owned by the user. See docs here

 
Try it
Create Tweet with the Twitter API

Create a new tweet. See docs here

 
Try it
Delete Tweet with the Twitter API

Remove a posted tweet. See docs here

 
Try it
Follow User with the Twitter API

Follow a user. See docs here

 
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

Twitter uses OAuth authentication. When you connect your Twitter account, Pipedream will open a popup window where you can sign into 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 Twitter API.

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

do not use
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.