Twitter API v2
  1. Tweets
Twitter API v2
  • General
    • Returns the open api spec document.
      GET
  • Spaces
    • Space lookup up Space IDs
      GET
    • Space lookup by their creators
      GET
    • Search for Spaces
      GET
    • Space lookup by Space ID
      GET
  • Tweets
    • Tweet lookup by Tweet IDs
      GET
    • Full archive search counts
      GET
    • Recent search counts
      GET
    • Sample stream
      GET
    • Full-archive search
      GET
    • Recent search
      GET
    • Filtered stream
      GET
    • Rules lookup
      GET
    • Add/Delete rules
      POST
    • Tweet lookup by Tweet ID
      GET
    • Hide replies
      PUT
    • Returns Tweet objects liked by the provided User ID
      GET
    • Causes the user (in the path) to like the specified tweet
      POST
    • Causes the user (in the path) to unlike the specified tweet
      DELETE
    • User mention timeline by User ID
      GET
    • Causes the user (in the path) to retweet the specified tweet
      POST
    • Causes the user (in the path) to unretweet the specified tweet
      DELETE
    • User Tweets timeline by User ID
      GET
  • Users
    • Returns user objects that have liked the provided Tweet ID
      GET
    • Returns user objects that have retweeted the provided Tweet ID
      GET
    • User lookup by IDs
      GET
    • User lookup by usernames
      GET
    • User lookup by username
      GET
    • User lookup by ID
      GET
    • Returns user objects that are blocked by provided user ID
      GET
    • Block User by User ID
      POST
    • Returns user objects that follow the provided user ID
      GET
    • Following by User ID
      GET
    • Follow User
      POST
    • Mute User by User ID
      POST
    • Unblock User by User ID
      DELETE
    • Unfollow User
      DELETE
    • Unmute User by User ID
      DELETE
  1. Tweets

Rules lookup

GET
/2/tweets/search/stream/rules
Tweets
Returns rules from a user's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.twitter.com/2/tweets/search/stream/rules'
Response Response Example
200 - Example 1
{
  "data": [
    {
      "id": "120897978112909812",
      "tag": "Non-retweeted coffee tweets",
      "value": "coffee -is:retweet"
    }
  ],
  "meta": {
    "sent": "string",
    "summary": {
      "created": 1,
      "invalid": 1,
      "not_created": 1,
      "valid": 1
    }
  }
}

Request

Query Params
ids
array[string]
optional
A comma-separated list of Rule IDs.

Responses

🟢200The request was successful
application/json
Body
data
array[object (Rule) {3}] 
required
id
string 
optional
Unique identifier of this rule.
Example:
120897978112909812
Match pattern:
^[0-9]{1,19}$
tag
string 
optional
A tag meant for the labeling of user provided rules.
Example:
Non-retweeted coffee tweets
value
string 
required
The filterlang value of the rule.
Example:
coffee -is:retweet
meta
object (RulesResponseMetadata) 
required
sent
string 
required
summary
RulesRequestSummary
optional
🔴500500
Modified at 2022-09-10 21:25:17
Previous
Filtered stream
Next
Add/Delete rules
Built with