add list_lookup
@@ -536,6 +536,33 @@ class Twarc2:
url, expansions, list_fields, max_results, pagination_token, user_fields
)
+ def list_lookup(self, list_id, expansions, list_fields, user_fields):
+ """
+ Returns the details of a specified List.
+
+ Calls [GET /2/lists/:id](https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id)
+
+ Args:
+ list_id (int): ID of the list.
+ expansions enum (owner_id): enable you to request additional data objects that relate to the originally returned List.
+ list_fields enum (created_at, follower_count, member_count, private, description, owner_id): This fields parameter enables you to select which specific List fields will deliver with each returned List objects.
+ user_fields enum (created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld):
+ This fields parameter enables you to select which specific user fields will deliver with the users object. Specify the desired fields in a comma-separated list without spaces between commas and fields.
+
+ Returns:
+ dict: Result dictionary.
+ """
+
+ params = self._prepare_params(
+ list_fields=list_fields,
+ user_fields=user_fields,
+ )
+
+ if expansions:
+ params["expansions"] = "owner_id"
+ url = f"https://api.twitter.com/2/lists/{list_id}"
+ return self.get(url, params=params)
+
def search_recent(
self,
query,
