Rules lookup

GET /2/tweets/search/stream/rules

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.

Query parameters

  • ids array[string]

    A comma-separated list of Rule IDs.

  • max_results integer(int32)

    The maximum number of results

    Minimum value is 1, maximum value is 1000. Default value is 1000.

  • pagination_token string

    This value is populated by passing the 'next_token' returned in a request to paginate through results.

Responses

  • 200

    The request was successful

    Hide response attributes Show response attributes object
    • data array[object] Required

      A user-provided stream filtering rule.

      Hide data attributes Show data attributes array[object]
      • value string Required

        The filterlang value of the rule.

      • tag string

        A tag meant for the labeling of user provided rules.

      • id string

        Unique identifier of this rule.

        Format should match the following pattern: ^[0-9]{1,19}$.

    • meta object Required
      Hide meta attributes Show meta attributes object
      • sent string Required
      • summary object

        One of:
  • default

    The request has failed.

    Hide response attributes Show response attributes object
    • code integer(int32) Required
    • message string Required
GET /2/tweets/search/stream/rules
curl \
 -X GET https://api.twitter.com/2/tweets/search/stream/rules \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "value": "coffee -is:retweet",
      "tag": "Non-retweeted coffee tweets",
      "id": "120897978112909812"
    }
  ],
  "meta": {
    "sent": "string",
    "summary": {
      "created": 1,
      "not_created": 1,
      "valid": 1,
      "invalid": 1
    }
  }
}
Response examples (200)
{
  "data": [
    {
      "value": "coffee -is:retweet",
      "tag": "Non-retweeted coffee tweets",
      "id": "120897978112909812"
    }
  ],
  "meta": {
    "sent": "string",
    "summary": {
      "created": 1,
      "not_created": 1,
      "valid": 1,
      "invalid": 1
    }
  }
}
Response examples (default)
{
  "code": 42,
  "message": "string"
}
Response examples (default)
{
  "code": 42,
  "message": "string"
}