Docs
Lists a user is on

Lists a user is on

Public lists other accounts have added the user to, newest first.

GET/user/{userId}/lists/memberships

Parameters

  • userIdpath · string · required

    Numeric user ID (digits only, up to 30). To pass a handle instead, use -1 here and set username.

  • usernamequery · string · optional

    Handle, with or without @. When set, it is used instead of userId: the API looks up the ID first, which makes the call a little slower. Still one billed call.

  • countquery · integer · optional · default 20

    Number of lists to ask X for, 1 to 100. Other values fall back to 20. X treats it as a hint.

  • cursorquery · string · optional

    Bottom cursor from the previous page. Leave it out for the first page. See Pagination.

Paginated: pass the bottom cursor of one page as cursor to get the next. Each page is one billed call. See Pagination.

Example request

curl 'https://api.twittrapi.com/user/11348282/lists/memberships?count=20' \
  --header 'X-API-KEY: YOUR_API_KEY'

Base URL https://api.twittrapi.com, key in the X-API-KEY header. Python and Node.js use the official SDKs.

Response

Raw JSON of X's ListMemberships query, in the same shape as /user/{userId}/lists. X may add an errors array next to complete data when it cannot decode one nested field of a list; the lists are still there.

Simple format (?format=simple or X-Response-Format: simple): Collection of List objects, as /user/{userId}/lists. Schema.

{
  "data": {
    "user": {
      "result": {
        "__typename": "User",
        "timeline": {
          "timeline": {
            "instructions": [
              {
                "type": "TimelineClearCache"
              },
              {
                "direction": "Top",
                "type": "TimelineTerminateTimeline"
              },
              {
                "entries": [
                  {
                    "content": {
                      "__typename": "TimelineTimelineItem",
                      "clientEventInfo": {
                        "component": "MembershipsSgs",
                        "element": "list"
                      },
                      "entryType": "TimelineTimelineItem",
                      "itemContent": {
                        "__typename": "TimelineTwitterList",
                        "itemType": "TimelineTwitterList",
                        "list": {
                          "created_at": 1796025212000,
                          "default_banner_media": {
                            "media_info": {
                              "original_img_height": 375,
                              "original_img_url": "https://pbs.twimg.com/media/GkIQZXyWsAAs-uP.png",
                              "original_img_width": 1125,
                              "salient_rect": {
                                "height": 1,
                                "left": 562,
                                "top": 187,
                                "width": 1
                              }
                            }
                          },
                          "default_banner_media_results": {},
                          "description": "",
                          "facepile_urls": [],
                          "following": false,
                          "id": "TGlzdDoxOTAwMDAwMDAwMDAwMDAwMDAx",
                          "id_str": "1900000000000000001",
                          "is_member": false,
                          "member_count": 25,
                          "members_context": "25 members",
                          "mode": "Public",
                          "muting": false,
                          "name": "HABERLER",
                          "pinning": false,
                          "subscriber_count": 0,
                          "user_results": {
                            "result": {
                              "__typename": "User",
                              "action_counts": {
                                "favorites_count": 62
                              },
                              "affiliates_highlighted_label": {},
                              "avatar": {
                                "image_url": "https://pbs.twimg.com/profile_images/example/avatar_normal.jpg"
                              },
                              "core": {
                                "created_at": "Sun Mar 31 16:00:39 +0000 2024",
                                "name": "Example User 1",
                                "screen_name": "example_user_1"
                              },
                              "follow_request_sent": false,
                              "has_graduated_access": true,
                              "id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
                              "is_blue_verified": false,
                              "location": {
                                "location": ""
                              },
                              "media_permissions": {
                                "can_media_tag": true
                              },
                              "notifications_settings": {
                                "notifications_enabled": false
                              },
                              "parody_commentary_fan_label": "None",
                              "pinned_items": {},
                              "possibly_sensitive": false,
                              "privacy": {
                                "protected": false
                              },
                              "profile_bio": {
                                "description": "Example bio.",
                                "entities": {
                                  "description": {
                                    "urls": []
                                  }
                                }
                              },
                              "profile_image_shape": "Circle",
                              "profile_metadata": {
                                "profile_interstitial_type": ""
                              },
                              "profile_translation": {
                                "translator_type": "none"
                              },
                              "relationship_counts": {
                                "followers": 0,
                                "following": 0
                              },
                              "relationship_perspectives": {
                                "blocked_by": false,
                                "blocking": false,
                                "followed_by": false,
                                "following": false,
                                "live_following": false,
                                "muting": false
                              },
                              "rest_id": "1000000000000000001",
                              "super_follow_eligible": false,
                              "super_followed_by": false,
                              "super_following": false,
                              "tweet_counts": {
                                "media_tweets": 0,
                                "tweets": 1
                              },
                              "verification": {
                                "verified": false
                              },
                              "website": {
                                "url": ""
                              },
                              "legacy": {
                                "blocked_by": false,
                                "blocking": false,
                                "can_media_tag": true,
                                "created_at": "Sun Mar 31 16:00:39 +0000 2024",
                                "default_profile_image": true,
                                "description": "Example bio.",
                                "entities": {
                                  "description": {
                                    "urls": []
                                  }
                                },
                                "fast_followers_count": 0,
                                "favourites_count": 62,
                                "follow_request_sent": false,
                                "followed_by": false,
                                "followers_count": 0,
                                "following": false,
                                "friends_count": 0,
                                "is_translator": false,
                                "location": "",
                                "media_count": 0,
                                "muting": false,
                                "name": "Example User 1",
                                "needs_phone_verification": false,
                                "normal_followers_count": 0,
                                "notifications": false,
                                "possibly_sensitive": false,
                                "profile_image_url_https": "https://pbs.twimg.com/profile_images/example/avatar_normal.jpg",
                                "profile_interstitial_type": "",
                                "protected": false,
                                "screen_name": "example_user_1",
                                "statuses_count": 1,
                                "time_zone": "",
                                "translator_type": "none",
                                "utc_offset": 0,
                                "verified": false,
                                "want_retweets": false,
                                "withheld_description": "",
                                "withheld_scope": ""
                              }
                            }
                          }
                        }
                      }
                    },
                    "entryId": "list-2127310045327057210",
                    "sortIndex": "2127344550585303040"
                  },
                  {
                    "content": {
                      "__typename": "TimelineTimelineItem",
                      "clientEventInfo": {
                        "component": "MembershipsSgs",
                        "element": "list"
                      },
                      "entryType": "TimelineTimelineItem",
                      "itemContent": {
                        "__typename": "TimelineTwitterList",
                        "itemType": "TimelineTwitterList",
                        "list": {
                          "created_at": 1795990341000,
                          "default_banner_media": {
                            "media_info": {
                              "original_img_height": 375,
                              "original_img_url": "https://pbs.twimg.com/media/GkIPtGVXMAAz8Rh.png",
                              "original_img_width": 1125,
                              "salient_rect": {
                                "height": 1,
                                "left": 562,
                                "top": 187,
                                "width": 1
                              }
                            }
                          },
                          "default_banner_media_results": {},
                          "description": "",
                          "facepile_urls": [],
                          "following": false,
                          "id": "TGlzdDoxOTAwMDAwMDAwMDAwMDAwMDAy",
                          "id_str": "1900000000000000002",
                          "is_member": false,
                          "member_count": 40,
                          "members_context": "40 members",
                          "mode": "Public",
                          "muting": false,
                          "name": "News",
                          "pinning": false,
                          "subscriber_count": 0,
                          "user_results": {
                            "result": {
                              "__typename": "User",
                              "action_counts": {
                                "favorites_count": 131
                              },
                              "affiliates_highlighted_label": {},
                              "avatar": {
                                "image_url": "https://pbs.twimg.com/profile_images/example/avatar_normal.jpg"
                              },
                              "core": {
                                "created_at": "Sun Nov 15 14:20:53 +0000 2015",
                                "name": "Example User 2",
                                "screen_name": "example_user_2"
                              },
                              "follow_request_sent": false,
                              "has_graduated_access": true,
                              "id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAy",
                              "is_blue_verified": false,
                              "location": {
                                "location": ""
                              },
                              "media_permissions": {
                                "can_media_tag": true
                              },
                              "notifications_settings": {
                                "notifications_enabled": false
                              },
                              "parody_commentary_fan_label": "None",
                              "pinned_items": {
                                "tweet_ids_str": [
                                  "966839684621103106"
                                ]
                              },
                              "possibly_sensitive": false,
                              "privacy": {
                                "protected": false
                              },
                              "profile_bio": {
                                "description": "Example bio.",
                                "entities": {
                                  "description": {
                                    "urls": []
                                  }
                                }
                              },
                              "profile_image_shape": "Circle",
                              "profile_metadata": {
                                "profile_interstitial_type": ""
                              },
                              "profile_translation": {
                                "translator_type": "none"
                              },
                              "relationship_counts": {
                                "followers": 107,
                                "following": 80
                              },
                              "relationship_perspectives": {
                                "blocked_by": false,
                                "blocking": false,
                                "followed_by": false,
                                "following": false,
                                "live_following": false,
                                "muting": false
                              },
                              "rest_id": "1000000000000000002",
                              "super_follow_eligible": false,
                              "super_followed_by": false,
                              "super_following": false,
                              "tweet_counts": {
                                "media_tweets": 0,
                                "tweets": 10
                              },
                              "verification": {
                                "verified": false
                              },
                              "website": {
                                "url": ""
                              },
                              "legacy": {
                                "blocked_by": false,
                                "blocking": false,
                                "can_media_tag": true,
                                "created_at": "Sun Nov 15 14:20:53 +0000 2015",
                                "default_profile_image": false,
                                "description": "Example bio.",
                                "entities": {
                                  "description": {
                                    "urls": []
                                  }
                                },
                                "fast_followers_count": 0,
                                "favourites_count": 131,
                                "follow_request_sent": false,
                                "followed_by": false,
                                "followers_count": 107,
                                "following": false,
                                "friends_count": 80,
                                "is_translator": false,
                                "location": "",
                                "media_count": 0,
                                "muting": false,
                                "name": "Example User 2",
                                "needs_phone_verification": false,
                                "normal_followers_count": 107,
                                "notifications": false,
                                "pinned_tweet_ids_str": [
                                  "966839684621103106"
                                ],
                                "possibly_sensitive": false,
                                "profile_image_url_https": "https://pbs.twimg.com/profile_images/example/avatar_normal.jpg",
                                "profile_interstitial_type": "",
                                "protected": false,
                                "screen_name": "example_user_2",
                                "statuses_count": 10,
                                "time_zone": "",
                                "translator_type": "none",
                                "utc_offset": 0,
                                "verified": false,
                                "want_retweets": false,
                                "withheld_description": "",
                                "withheld_scope": ""
                              }
                            }
                          }
                        }
                      }
                    },
                    "entryId": "list-2127163783395086489",
                    "sortIndex": "2127344550585303039"
                  },
                  {
                    "content": {
                      "__typename": "TimelineTimelineCursor",
                      "cursorType": "Bottom",
                      "entryType": "TimelineTimelineCursor",
                      "value": "6738721989367153024|2127344550585303033"
                    },
                    "entryId": "cursor-bottom-2127344550585303035",
                    "sortIndex": "2127344550585303035"
                  },
                  {
                    "content": {
                      "__typename": "TimelineTimelineCursor",
                      "cursorType": "Top",
                      "entryType": "TimelineTimelineCursor",
                      "value": "-1|2127344550585303041"
                    },
                    "entryId": "cursor-top-2127344550585303041",
                    "sortIndex": "2127344550585303041"
                  }
                ],
                "type": "TimelineAddEntries"
              }
            ]
          }
        }
      }
    }
  }
}

In the raw format, field names and nesting come from X and can change without notice. See Response format; the simple format keeps a fixed schema.

Errors

  • 422userId is not numeric, or the username lookup failed.
  • 400userId is -1 and username is missing, or the username contains characters X blocks.
  • 404The user could not be found.

Errors every endpoint can return (401, 402, 403, 404, 408, 409, 429, 5xx), and which of them are charged, are on the Errors page. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded.