1.. _api_reference:
2
3.. include:: parameters.rst
4
5API Reference
6=============
7
8This page contains some basic documentation for the Tweepy module.
9
10
11:mod:`tweepy.api` --- Twitter API wrapper
12=========================================
13
14.. class:: API([auth_handler=None], [host='api.twitter.com'], \
15               [search_host='search.twitter.com'], [cache=None], \
16               [api_root='/1'], [search_root=''], [retry_count=0], \
17               [retry_delay=0], [retry_errors=None], [timeout=60], \
18               [parser=ModelParser], [compression=False], \
19               [wait_on_rate_limit=False], [wait_on_rate_limit_notify=False], \
20               [proxy=None])
21
22   This class provides a wrapper for the API as provided by Twitter.
23   The functions provided in this class are listed below.
24
25   :param auth_handler: authentication handler to be used
26   :param host: general API host
27   :param search_host: search API host
28   :param cache: cache backend to use
29   :param api_root: general API path root
30   :param search_root: search API path root
31   :param retry_count: default number of retries to attempt when error occurs
32   :param retry_delay: number of seconds to wait between retries
33   :param retry_errors: which HTTP status codes to retry
34   :param timeout: The maximum amount of time to wait for a response from
35                   Twitter
36   :param parser: The object to use for parsing the response from Twitter
37   :param compression: Whether or not to use GZIP compression for requests
38   :param wait_on_rate_limit: Whether or not to automatically wait for rate
39                              limits to replenish
40   :param wait_on_rate_limit_notify: Whether or not to print a notification
41                                     when Tweepy is waiting for rate limits to
42                                     replenish
43   :param proxy: The full url to an HTTPS proxy to use for connecting to
44                 Twitter.
45
46
47Timeline methods
48----------------
49
50.. method:: API.home_timeline([count], [since_id], [max_id], [trim_user], \
51                              [exclude_replies], [include_entities])
52
53   Returns the 20 most recent statuses, including retweets, posted by the
54   authenticating user and that user's friends. This is the equivalent of
55   /timeline/home on the Web.
56
57   :param count: |count|
58   :param since_id: |since_id|
59   :param max_id: |max_id|
60   :param trim_user: |trim_user|
61   :param exclude_replies: This parameter will prevent replies from appearing
62                           in the returned timeline. Using ``exclude_replies``
63                           with the ``count`` parameter will mean you will
64                           receive up-to count Tweets — this is because the
65                           ``count`` parameter retrieves that many Tweets
66                           before filtering out retweets and replies.
67   :param include_entities: |include_entities|
68   :rtype: list of :class:`Status` objects
69
70
71.. method:: API.statuses_lookup(id_, [include_entities], [trim_user], [map_], \
72                                [include_ext_alt_text], [include_card_uri])
73
74   Returns full Tweet objects for up to 100 tweets per request, specified by
75   the ``id_`` parameter.
76
77   :param id\_: A list of Tweet IDs to lookup, up to 100
78   :param include_entities: |include_entities|
79   :param trim_user: |trim_user|
80   :param map\_: A boolean indicating whether or not to include tweets that
81                 cannot be shown. Defaults to False.
82   :param include_ext_alt_text: |include_ext_alt_text|
83   :param include_card_uri: |include_card_uri|
84   :rtype: list of :class:`Status` objects
85
86
87.. method:: API.user_timeline([id/user_id/screen_name], [since_id], [max_id], \
88                              [count], [page])
89
90   Returns the 20 most recent statuses posted from the authenticating user or
91   the user specified. It's also possible to request another user's timeline
92   via the id parameter.
93
94   :param id: |uid|
95   :param user_id: |user_id|
96   :param screen_name: |screen_name|
97   :param since_id: |since_id|
98   :param max_id: |max_id|
99   :param count: |count|
100   :param page: |page|
101   :rtype: list of :class:`Status` objects
102
103
104.. method:: API.retweets_of_me([since_id], [max_id], [count], [page])
105
106   Returns the 20 most recent tweets of the authenticated user that have been
107   retweeted by others.
108
109   :param since_id: |since_id|
110   :param max_id: |max_id|
111   :param count: |count|
112   :param page: |page|
113   :rtype: list of :class:`Status` objects
114
115
116.. method:: API.mentions_timeline([since_id], [max_id], [count])
117
118   Returns the 20 most recent mentions, including retweets.
119
120   :param since_id: |since_id|
121   :param max_id: |max_id|
122   :param count: |count|
123   :rtype: list of :class:`Status` objects
124
125
126Status methods
127--------------
128
129.. method:: API.get_status(id, [trim_user], [include_my_retweet], \
130                           [include_entities], [include_ext_alt_text], \
131                           [include_card_uri])
132
133   Returns a single status specified by the ID parameter.
134
135   :param id: |sid|
136   :param trim_user: |trim_user|
137   :param include_my_retweet: A boolean indicating if any Tweets returned that
138      have been retweeted by the authenticating user should include an
139      additional current_user_retweet node, containing the ID of the source
140      status for the retweet.
141   :param include_entities: |include_entities|
142   :param include_ext_alt_text: |include_ext_alt_text|
143   :param include_card_uri: |include_card_uri|
144   :rtype: :class:`Status` object
145
146
147.. method:: API.update_status(status, [in_reply_to_status_id], \
148                              [auto_populate_reply_metadata], \
149                              [exclude_reply_user_ids], [attachment_url], \
150                              [media_ids], [possibly_sensitive], [lat], \
151                              [long], [place_id], [display_coordinates], \
152                              [trim_user], [enable_dmcommands], \
153                              [fail_dmcommands], [card_uri])
154
155   Updates the authenticating user's current status, also known as Tweeting.
156
157   For each update attempt, the update text is compared with the authenticating
158   user's recent Tweets. Any attempt that would result in duplication will be
159   blocked, resulting in a 403 error. A user cannot submit the same status
160   twice in a row.
161
162   While not rate limited by the API, a user is limited in the number of Tweets
163   they can create at a time. If the number of updates posted by the user
164   reaches the current allowed limit this method will return an HTTP 403 error.
165
166   :param status: The text of your status update.
167   :param in_reply_to_status_id: The ID of an existing status that the update
168      is in reply to. Note: This parameter will be ignored unless the author of
169      the Tweet this parameter references is mentioned within the status text.
170      Therefore, you must include @username, where username is the author of
171      the referenced Tweet, within the update.
172   :param auto_populate_reply_metadata: If set to true and used with
173      in_reply_to_status_id, leading @mentions will be looked up from the
174      original Tweet, and added to the new Tweet from there. This wil append
175      @mentions into the metadata of an extended Tweet as a reply chain grows,
176      until the limit on @mentions is reached. In cases where the original
177      Tweet has been deleted, the reply will fail.
178   :param exclude_reply_user_ids: When used with auto_populate_reply_metadata,
179      a comma-separated list of user ids which will be removed from the
180      server-generated @mentions prefix on an extended Tweet. Note that the
181      leading @mention cannot be removed as it would break the
182      in-reply-to-status-id semantics. Attempting to remove it will be
183      silently ignored.
184   :param attachment_url: In order for a URL to not be counted in the status
185      body of an extended Tweet, provide a URL as a Tweet attachment. This URL
186      must be a Tweet permalink, or Direct Message deep link. Arbitrary,
187      non-Twitter URLs must remain in the status text. URLs passed to the
188      attachment_url parameter not matching either a Tweet permalink or Direct
189      Message deep link will fail at Tweet creation and cause an exception.
190   :param media_ids: A list of media_ids to associate with the Tweet.
191      You may include up to 4 photos or 1 animated GIF or 1 video in a Tweet.
192   :param possibly_sensitive: If you upload Tweet media that might be
193      considered sensitive content such as nudity, or medical procedures, you
194      must set this value to true.
195   :param lat: The latitude of the location this Tweet refers to. This
196      parameter will be ignored unless it is inside the range -90.0 to +90.0
197      (North is positive) inclusive. It will also be ignored if there is no
198      corresponding long parameter.
199   :param long: The longitude of the location this Tweet refers to. The valid
200      ranges for longitude are -180.0 to +180.0 (East is positive) inclusive.
201      This parameter will be ignored if outside that range, if it is not a
202      number, if geo_enabled is disabled, or if there no corresponding lat
203      parameter.
204   :param place_id: A place in the world.
205   :param display_coordinates: Whether or not to put a pin on the exact
206      coordinates a Tweet has been sent from.
207   :param trim_user: |trim_user|
208   :param enable_dmcommands: When set to true, enables shortcode commands for
209      sending Direct Messages as part of the status text to send a Direct
210      Message to a user. When set to false, disables this behavior and includes
211      any leading characters in the status text that is posted
212   :param fail_dmcommands: When set to true, causes any status text that starts
213      with shortcode commands to return an API error. When set to false, allows
214      shortcode commands to be sent in the status text and acted on by the API.
215   :param card_uri: Associate an ads card with the Tweet using the card_uri
216      value from any ads card response.
217   :rtype: :class:`Status` object
218
219
220.. method:: API.update_with_media(filename, [status], \
221                                  [in_reply_to_status_id], \
222                                  [auto_populate_reply_metadata], [lat], \
223                                  [long], [source], [place_id], [file])
224
225   *Deprecated*: Use :func:`API.media_upload` instead. Update the authenticated
226   user's status. Statuses that are duplicates or too long will be silently
227   ignored.
228
229   :param filename: The filename of the image to upload. This will
230                    automatically be opened unless `file` is specified
231   :param status: The text of your status update.
232   :param in_reply_to_status_id: The ID of an existing status that the update
233                                 is in reply to.
234   :param auto_populate_reply_metadata: Whether to automatically include the
235                                        @mentions in the status metadata.
236   :param lat: The location's latitude that this tweet refers to.
237   :param long: The location's longitude that this tweet refers to.
238   :param source: Source of the update. Only supported by Identi.ca. Twitter
239                  ignores this parameter.
240   :param place_id: Twitter ID of location which is listed in the Tweet if
241                    geolocation is enabled for the user.
242   :param file: A file object, which will be used instead of opening
243                `filename`. `filename` is still required, for MIME type
244                detection and to use as a form field in the POST data
245   :rtype: :class:`Status` object
246
247
248.. method:: API.destroy_status(id)
249
250   Destroy the status specified by the id parameter. The authenticated user
251   must be the author of the status to destroy.
252
253   :param id: |sid|
254   :rtype: :class:`Status` object
255
256
257.. method:: API.retweet(id)
258
259   Retweets a tweet. Requires the id of the tweet you are retweeting.
260
261   :param id: |sid|
262   :rtype: :class:`Status` object
263
264
265.. method:: API.retweeters(id, [cursor], [stringify_ids])
266
267   Returns up to 100 user IDs belonging to users who have retweeted the Tweet
268   specified by the id parameter.
269
270   :param id: |sid|
271   :param cursor: |cursor|
272   :param stringify_ids: Have ids returned as strings instead.
273   :rtype: list of Integers
274
275
276.. method:: API.retweets(id, [count])
277
278   Returns up to 100 of the first retweets of the given tweet.
279
280   :param id: |sid|
281   :param count: Specifies the number of retweets to retrieve.
282   :rtype: list of :class:`Status` objects
283
284
285.. method:: API.unretweet(id)
286
287   Untweets a retweeted status. Requires the id of the retweet to unretweet.
288
289   :param id: |sid|
290   :rtype: :class:`Status` object
291
292
293.. method:: API.get_oembed(url, [maxwidth], [hide_media], [hide_thread], \
294                           [omit_script], [align], [related], [lang], \
295                           [theme], [link_color], [widget_type], [dnt])
296
297   Returns a single Tweet, specified by either a Tweet web URL or the Tweet ID,
298   in an oEmbed-compatible format. The returned HTML snippet will be
299   automatically recognized as an Embedded Tweet when Twitter's widget
300   JavaScript is included on the page.
301
302   The oEmbed endpoint allows customization of the final appearance of an
303   Embedded Tweet by setting the corresponding properties in HTML markup to be
304   interpreted by Twitter's JavaScript bundled with the HTML response by
305   default. The format of the returned markup may change over time as Twitter
306   adds new features or adjusts its Tweet representation.
307
308   The Tweet fallback markup is meant to be cached on your servers for up to
309   the suggested cache lifetime specified in the ``cache_age``.
310
311   :param url: The URL of the Tweet to be embedded
312   :param maxwidth: The maximum width of a rendered Tweet in whole pixels. A
313                    supplied value under or over the allowed range will be
314                    returned as the minimum or maximum supported width
315                    respectively; the reset width value will be reflected in
316                    the returned ``width`` property. Note that Twitter does not
317                    support the oEmbed ``maxheight`` parameter. Tweets are
318                    fundamentally text, and are therefore of unpredictable
319                    height that cannot be scaled like an image or video.
320                    Relatedly, the oEmbed response will not provide a value for
321                    ``height``. Implementations that need consistent heights
322                    for Tweets should refer to the ``hide_thread`` and
323                    ``hide_media`` parameters below.
324   :param hide_media: When set to ``true``, ``"t"``, or ``1``, links in a
325                      Tweet are not expanded to photo, video, or link previews.
326   :param hide_thread: When set to ``true``, ``"t"``, or ``1``, a collapsed
327                       version of the previous Tweet in a conversation thread
328                       will not be displayed when the requested Tweet is in
329                       reply to another Tweet.
330   :param omit_script: When set to ``true``, ``"t"``, or ``1``, the
331                       ``<script>`` responsible for loading ``widgets.js`` will
332                       not be returned. Your webpages should include their own
333                       reference to ``widgets.js`` for use across all Twitter
334                       widgets including Embedded Tweets.
335   :param align: Specifies whether the embedded Tweet should be floated left,
336                 right, or center in the page relative to the parent element.
337   :param related: A comma-separated list of Twitter usernames related to your
338                   content. This value will be forwarded to Tweet action
339                   intents if a viewer chooses to reply, like, or retweet the
340                   embedded Tweet.
341   :param lang: Request returned HTML and a rendered Tweet in the specified
342                Twitter language supported by embedded Tweets.
343   :param theme: When set to ``dark``, the Tweet is displayed with light text
344                 over a dark background.
345   :param link_color: Adjust the color of Tweet text links with a hexadecimal
346                      color value.
347   :param widget_type: Set to ``video`` to return a Twitter Video embed for the
348                       given Tweet.
349   :param dnt: When set to ``true``, the Tweet and its embedded page on your
350               site are not used for purposes that include personalized
351               suggestions and personalized ads.
352
353   :rtype: :class:`JSON` object
354
355
356User methods
357------------
358
359.. method:: API.get_user(id/user_id/screen_name)
360
361   Returns information about the specified user.
362
363   :param id: |uid|
364   :param user_id: |user_id|
365   :param screen_name: |screen_name|
366   :rtype: :class:`User` object
367
368
369.. method:: API.me()
370
371   Returns the authenticated user's information.
372
373   :rtype: :class:`User` object
374
375
376.. method:: API.friends([id/user_id/screen_name], [cursor], [skip_status], \
377                        [include_user_entities])
378
379   Returns a user's friends ordered in which they were added 100 at a time.
380   If no user is specified it defaults to the authenticated user.
381
382   :param id: |uid|
383   :param user_id: |user_id|
384   :param screen_name: |screen_name|
385   :param cursor: |cursor|
386   :param count: |count|
387   :param skip_status: |skip_status|
388   :param include_user_entities: |include_user_entities|
389   :rtype: list of :class:`User` objects
390
391
392.. method:: API.followers([id/screen_name/user_id], [cursor])
393
394   Returns a user's followers ordered in which they were added. If no user is
395   specified by id/screen name, it defaults to the authenticated user.
396
397   :param id: |uid|
398   :param user_id: |user_id|
399   :param screen_name: |screen_name|
400   :param cursor: |cursor|
401   :param count: |count|
402   :param skip_status: |skip_status|
403   :param include_user_entities: |include_user_entities|
404   :rtype: list of :class:`User` objects
405
406
407.. method:: API.lookup_users([user_ids], [screen_names], [include_entities], \
408                             [tweet_mode])
409
410   Returns fully-hydrated user objects for up to 100 users per request.
411
412   There are a few things to note when using this method.
413
414   * You must be following a protected user to be able to see their most recent
415     status update. If you don't follow a protected user their status will be
416     removed.
417   * The order of user IDs or screen names may not match the order of users in
418     the returned array.
419   * If a requested user is unknown, suspended, or deleted, then that user will
420     not be returned in the results list.
421   * If none of your lookup criteria can be satisfied by returning a user
422     object, a HTTP 404 will be thrown.
423
424   :param user_ids: A list of user IDs, up to 100 are allowed in a single
425                    request.
426   :param screen_names: A list of screen names, up to 100 are allowed in a
427                        single request.
428   :param include_entities: |include_entities|
429   :param tweet_mode: Valid request values are compat and extended, which give
430                      compatibility mode and extended mode, respectively for
431                      Tweets that contain over 140 characters.
432   :rtype: list of :class:`User` objects
433
434
435.. method:: API.search_users(q, [count], [page])
436
437   Run a search for users similar to Find People button on Twitter.com; the
438   same results returned by people search on Twitter.com will be returned by
439   using this API (about being listed in the People Search). It is only
440   possible to retrieve the first 1000 matches from this API.
441
442   :param q: The query to run against people search.
443   :param count: Specifies the number of statuses to retrieve.
444                 May not be greater than 20.
445   :param page: |page|
446   :rtype: list of :class:`User` objects
447
448
449Direct Message Methods
450----------------------
451
452.. method:: API.get_direct_message([id], [full_text])
453
454   Returns a specific direct message.
455
456   :param id: The id of the Direct Message event that should be returned.
457   :param full_text: |full_text|
458   :rtype: :class:`DirectMessage` object
459
460
461.. method:: API.list_direct_messages([count], [cursor])
462
463   Returns all Direct Message events (both sent and received) within the last
464   30 days. Sorted in reverse-chronological order.
465
466   :param count: |count|
467   :param cursor: |cursor|
468   :rtype: list of :class:`DirectMessage` objects
469
470
471.. method:: API.send_direct_message(recipient_id, text, [quick_reply_type], \
472                                    [attachment_type], [attachment_media_id])
473
474   Sends a new direct message to the specified user from the authenticating
475   user.
476
477   :param recipient_id: The ID of the user who should receive the direct
478                        message.
479   :param text: The text of your Direct Message. Max length of 10,000
480                characters.
481   :param quick_reply_type: The Quick Reply type to present to the user:
482
483                            * options - Array of Options objects (20 max).
484                            * text_input - Text Input object.
485                            * location - Location object.
486   :param attachment_type: The attachment type. Can be media or location.
487   :param attachment_media_id: A media id to associate with the message.
488                               A Direct Message may only reference a single
489                               media_id.
490   :rtype: :class:`DirectMessage` object
491
492
493.. method:: API.destroy_direct_message(id)
494
495   Deletes the direct message specified in the required ID parameter. The
496   authenticating user must be the recipient of the specified direct message.
497   Direct Messages are only removed from the interface of the user context
498   provided. Other members of the conversation can still access the Direct
499   Messages.
500
501   :param id: The id of the Direct Message that should be deleted.
502   :rtype: None
503
504
505Friendship Methods
506------------------
507
508.. method:: API.create_friendship(id/screen_name/user_id, [follow])
509
510   Create a new friendship with the specified user (aka follow).
511
512   :param id: |uid|
513   :param screen_name: |screen_name|
514   :param user_id: |user_id|
515   :param follow: Enable notifications for the target user in addition to
516                  becoming friends.
517   :rtype: :class:`User` object
518
519
520.. method:: API.destroy_friendship(id/screen_name/user_id)
521
522   Destroy a friendship with the specified user (aka unfollow).
523
524   :param id: |uid|
525   :param screen_name: |screen_name|
526   :param user_id: |user_id|
527   :rtype: :class:`User` object
528
529
530.. method:: API.show_friendship(source_id/source_screen_name, \
531                                target_id/target_screen_name)
532
533   Returns detailed information about the relationship between two users.
534
535   :param source_id: The user_id of the subject user.
536   :param source_screen_name: The screen_name of the subject user.
537   :param target_id: The user_id of the target user.
538   :param target_screen_name: The screen_name of the target user.
539   :rtype: :class:`Friendship` object
540
541
542.. method:: API.lookup_friendships(user_ids/screen_names)
543
544   Returns the relationships of the authenticated user to the list of up to
545   100 screen_names or user_ids provided.
546
547   :param user_ids: A list of user IDs, up to 100 are allowed in a single
548                    request.
549   :param screen_names: A list of screen names, up to 100 are allowed in a
550                        single request.
551   :rtype: :class:`Relationship` object
552
553
554.. method:: API.friends_ids(id/screen_name/user_id, [cursor])
555
556   Returns an array containing the IDs of users being followed by the specified
557   user.
558
559   :param id: |uid|
560   :param screen_name: |screen_name|
561   :param user_id: |user_id|
562   :param cursor: |cursor|
563   :rtype: list of Integers
564
565
566.. method:: API.followers_ids(id/screen_name/user_id)
567
568   Returns an array containing the IDs of users following the specified user.
569
570   :param id: |uid|
571   :param screen_name: |screen_name|
572   :param user_id: |user_id|
573   :param cursor: |cursor|
574   :rtype: list of Integers
575
576
577Account Methods
578---------------
579
580.. method:: API.verify_credentials([include_entities], [skip_status], \
581                                   [include_email])
582
583   Verify the supplied user credentials are valid.
584
585   :param include_entities: |include_entities|
586   :param skip_status: |skip_status|
587   :param include_email: When set to true email will be returned in the user
588                         objects as a string.
589   :rtype: :class:`User` object if credentials are valid, otherwise False
590
591
592.. method:: API.rate_limit_status()
593
594   Returns the current rate limits for methods belonging to the specified
595   resource families. When using application-only auth, this method's response
596   indicates the application-only auth rate limiting context.
597
598   :param resources: A comma-separated list of resource families you want to
599                     know the current rate limit disposition for.
600   :rtype: :class:`JSON` object
601
602
603.. method:: API.update_profile_image(filename)
604
605   Update the authenticating user's profile image. Valid formats: GIF, JPG, or
606   PNG
607
608   :param filename: local path to image file to upload. Not a remote URL!
609   :rtype: :class:`User` object
610
611
612.. method:: API.update_profile([name], [url], [location], [description])
613
614   Sets values that users are able to set under the "Account" tab of their
615   settings page.
616
617   :param name: Maximum of 20 characters
618   :param url: Maximum of 100 characters.
619               Will be prepended with "http://" if not present
620   :param location: Maximum of 30 characters
621   :param description: Maximum of 160 characters
622   :rtype: :class:`User` object
623
624
625Favorite Methods
626----------------
627
628.. method:: API.favorites([id], [page])
629
630   Returns the favorite statuses for the authenticating user or user specified
631   by the ID parameter.
632
633   :param id: The ID or screen name of the user to request favorites
634   :param page: |page|
635   :rtype: list of :class:`Status` objects
636
637
638.. method:: API.create_favorite(id)
639
640   Favorites the status specified in the ID parameter as the authenticating
641   user.
642
643   :param id: |sid|
644   :rtype: :class:`Status` object
645
646
647.. method:: API.destroy_favorite(id)
648
649   Un-favorites the status specified in the ID parameter as the authenticating
650   user.
651
652   :param id: |sid|
653   :rtype: :class:`Status` object
654
655
656Block Methods
657-------------
658
659.. method:: API.create_block(id/screen_name/user_id)
660
661   Blocks the user specified in the ID parameter as the authenticating user.
662   Destroys a friendship to the blocked user if it exists.
663
664   :param id: |uid|
665   :param screen_name: |screen_name|
666   :param user_id: |user_id|
667   :rtype: :class:`User` object
668
669
670.. method:: API.destroy_block(id/screen_name/user_id)
671
672   Un-blocks the user specified in the ID parameter for the authenticating
673   user.
674
675   :param id: |uid|
676   :param screen_name: |screen_name|
677   :param user_id: |user_id|
678   :rtype: :class:`User` object
679
680
681.. method:: API.blocks([page])
682
683   Returns an array of user objects that the authenticating user is blocking.
684
685   :param page: |page|
686   :rtype: list of :class:`User` objects
687
688
689.. method:: API.blocks_ids([cursor])
690
691   Returns an array of numeric user ids the authenticating user is blocking.
692
693   :param cursor: |cursor|
694   :rtype: list of Integers
695
696
697Mute Methods
698------------
699
700.. method:: API.create_mute(id/screen_name/user_id)
701
702   Mutes the user specified in the ID parameter for the authenticating user.
703
704   :param id: |uid|
705   :param screen_name: |screen_name|
706   :param user_id: |user_id|
707   :rtype: :class:`User` object
708
709
710.. method:: API.destroy_mute(id/screen_name/user_id)
711
712   Un-mutes the user specified in the ID parameter for the authenticating user.
713
714   :param id: |uid|
715   :param screen_name: |screen_name|
716   :param user_id: |user_id|
717   :rtype: :class:`User` object
718
719
720.. method:: API.mutes([cursor], [include_entities], [skip_status])
721
722   Returns an array of user objects the authenticating user has muted.
723
724   :param cursor: |cursor|
725   :param include_entities: |include_entities|
726   :param skip_status: |skip_status|
727   :rtype: list of :class:`User` objects
728
729
730.. method:: API.mutes_ids([cursor])
731
732   Returns an array of numeric user ids the authenticating user has muted.
733
734   :param cursor: |cursor|
735   :rtype: list of Integers
736
737
738Spam Reporting Methods
739----------------------
740
741.. method:: API.report_spam(id/screen_name/user_id, [perform_block])
742
743   The user specified in the id is blocked by the authenticated user and
744   reported as a spammer.
745
746   :param id: |uid|
747   :param screen_name: |screen_name|
748   :param user_id: |user_id|
749   :param perform_block: A boolean indicating if the reported account should be
750                         blocked. Defaults to True.
751   :rtype: :class:`User` object
752
753
754Saved Searches Methods
755----------------------
756
757.. method:: API.saved_searches()
758
759   Returns the authenticated user's saved search queries.
760
761   :rtype: list of :class:`SavedSearch` objects
762
763
764.. method:: API.get_saved_search(id)
765
766   Retrieve the data for a saved search owned by the authenticating user
767   specified by the given id.
768
769   :param id: The id of the saved search to be retrieved.
770   :rtype: :class:`SavedSearch` object
771
772
773.. method:: API.create_saved_search(query)
774
775   Creates a saved search for the authenticated user.
776
777   :param query: The query of the search the user would like to save.
778   :rtype: :class:`SavedSearch` object
779
780
781.. method:: API.destroy_saved_search(id)
782
783   Destroys a saved search for the authenticated user. The search specified by
784   id must be owned by the authenticating user.
785
786   :param id: The id of the saved search to be deleted.
787   :rtype: :class:`SavedSearch` object
788
789
790Search Methods
791--------------
792
793.. method:: API.search(q, [geocode], [lang], [locale], [result_type], \
794                       [count], [until], [since_id], [max_id], \
795                       [include_entities])
796
797   Returns a collection of relevant Tweets matching a specified query.
798
799   Please note that Twitter's search service and, by extension, the Search API
800   is not meant to be an exhaustive source of Tweets. Not all Tweets will be
801   indexed or made available via the search interface.
802
803   In API v1.1, the response format of the Search API has been improved to
804   return Tweet objects more similar to the objects you’ll find across the REST
805   API and platform. However, perspectival attributes (fields that pertain to
806   the perspective of the authenticating user) are not currently supported on
807   this endpoint.\ [#]_\ [#]_
808
809   :param q: the search query string of 500 characters maximum, including
810      operators. Queries may additionally be limited by complexity.
811   :param geocode: Returns tweets by users located within a given radius of the
812      given latitude/longitude.  The location is preferentially taking from the
813      Geotagging API, but will fall back to their Twitter profile. The
814      parameter value is specified by "latitide,longitude,radius", where radius
815      units must be specified as either "mi" (miles) or "km" (kilometers). Note
816      that you cannot use the near operator via the API to geocode arbitrary
817      locations; however you can use this geocode parameter to search near
818      geocodes directly. A maximum of 1,000 distinct "sub-regions" will be
819      considered when using the radius modifier.
820   :param lang: Restricts tweets to the given language, given by an ISO 639-1
821      code. Language detection is best-effort.
822   :param locale: Specify the language of the query you are sending (only ja is
823      currently effective). This is intended for language-specific consumers
824      and the default should work in the majority of cases.
825   :param result_type: Specifies what type of search results you would prefer
826      to receive. The current default is "mixed." Valid values include:
827
828      * mixed : include both popular and real time results in the response
829      * recent : return only the most recent results in the response
830      * popular : return only the most popular results in the response
831   :param count: |count|
832   :param until: Returns tweets created before the given date. Date should be
833      formatted as YYYY-MM-DD. Keep in mind that the search index has a 7-day
834      limit. In other words, no tweets will be found for a date older than one
835      week.
836   :param since_id: |since_id| There are limits to the number of Tweets which
837      can be accessed through the API. If the limit of Tweets has occurred
838      since the since_id, the since_id will be forced to the oldest ID
839      available.
840   :param max_id: |max_id|
841   :param include_entities: |include_entities|
842   :rtype: :class:`SearchResults` object
843
844
845.. method:: API.search_30_day(environment_name, query, [tag], [fromDate], \
846                              [toDate], [maxResults], [next])
847
848   Premium search that provides Tweets posted within the last 30 days.
849
850   :param environment_name: The (case-sensitive) label associated with your
851      search developer environment, as displayed at
852      https://developer.twitter.com/en/account/environments.
853   :param query: The equivalent of one premium rule/filter, with up to 1,024
854      characters (256 with Sandbox dev environments).
855      This parameter should include ALL portions of the rule/filter, including
856      all operators, and portions of the rule should not be separated into
857      other parameters of the query.
858   :param tag: Tags can be used to segregate rules and their matching data into
859      different logical groups. If a rule tag is provided, the rule tag is
860      included in the 'matching_rules' attribute.
861      It is recommended to assign rule-specific UUIDs to rule tags and maintain
862      desired mappings on the client side.
863   :param fromDate: The oldest UTC timestamp (from most recent 30 days) from
864      which the Tweets will be provided. Timestamp is in minute granularity and
865      is inclusive (i.e. 12:00 includes the 00 minute).
866      Specified: Using only the fromDate with no toDate parameter will deliver
867      results for the query going back in time from now( ) until the fromDate.
868      Not Specified: If a fromDate is not specified, the API will deliver all
869      of the results for 30 days prior to now( ) or the toDate (if specified).
870      If neither the fromDate or toDate parameter is used, the API will deliver
871      all results for the most recent 30 days, starting at the time of the
872      request, going backwards.
873   :param toDate: The latest, most recent UTC timestamp to which the Tweets
874      will be provided. Timestamp is in minute granularity and is not inclusive
875      (i.e. 11:59 does not include the 59th minute of the hour).
876      Specified: Using only the toDate with no fromDate parameter will deliver
877      the most recent 30 days of data prior to the toDate.
878      Not Specified: If a toDate is not specified, the API will deliver all of
879      the results from now( ) for the query going back in time to the fromDate.
880      If neither the fromDate or toDate parameter is used, the API will deliver
881      all results for the entire 30-day index, starting at the time of the
882      request, going backwards.
883   :param maxResults: The maximum number of search results to be returned by a
884      request. A number between 10 and the system limit (currently 500, 100 for
885      Sandbox environments). By default, a request response will return 100
886      results.
887   :param next: This parameter is used to get the next 'page' of results. The
888      value used with the parameter is pulled directly from the response
889      provided by the API, and should not be modified.
890
891
892.. method:: API.search_full_archive(environment_name, query, [tag], \
893                                    [fromDate], [toDate], [maxResults], [next])
894
895   Premium search that provides Tweets from as early as 2006, starting with the
896   first Tweet posted in March 2006.
897
898   :param environment_name: The (case-sensitive) label associated with your
899      search developer environment, as displayed at
900      https://developer.twitter.com/en/account/environments.
901   :param query: The equivalent of one premium rule/filter, with up to 1,024
902      characters (256 with Sandbox dev environments).
903      This parameter should include ALL portions of the rule/filter, including
904      all operators, and portions of the rule should not be separated into
905      other parameters of the query.
906   :param tag: Tags can be used to segregate rules and their matching data into
907      different logical groups. If a rule tag is provided, the rule tag is
908      included in the 'matching_rules' attribute.
909      It is recommended to assign rule-specific UUIDs to rule tags and maintain
910      desired mappings on the client side.
911   :param fromDate: The oldest UTC timestamp (from most recent 30 days) from
912      which the Tweets will be provided. Timestamp is in minute granularity and
913      is inclusive (i.e. 12:00 includes the 00 minute).
914      Specified: Using only the fromDate with no toDate parameter will deliver
915      results for the query going back in time from now( ) until the fromDate.
916      Not Specified: If a fromDate is not specified, the API will deliver all
917      of the results for 30 days prior to now( ) or the toDate (if specified).
918      If neither the fromDate or toDate parameter is used, the API will deliver
919      all results for the most recent 30 days, starting at the time of the
920      request, going backwards.
921   :param toDate: The latest, most recent UTC timestamp to which the Tweets
922      will be provided. Timestamp is in minute granularity and is not inclusive
923      (i.e. 11:59 does not include the 59th minute of the hour).
924      Specified: Using only the toDate with no fromDate parameter will deliver
925      the most recent 30 days of data prior to the toDate.
926      Not Specified: If a toDate is not specified, the API will deliver all of
927      the results from now( ) for the query going back in time to the fromDate.
928      If neither the fromDate or toDate parameter is used, the API will deliver
929      all results for the entire 30-day index, starting at the time of the
930      request, going backwards.
931   :param maxResults: The maximum number of search results to be returned by a
932      request. A number between 10 and the system limit (currently 500, 100 for
933      Sandbox environments). By default, a request response will return 100
934      results.
935   :param next: This parameter is used to get the next 'page' of results. The
936      value used with the parameter is pulled directly from the response
937      provided by the API, and should not be modified.
938
939
940List Methods
941------------
942
943.. method:: API.create_list(name, [mode], [description])
944
945   Creates a new list for the authenticated user.
946   Note that you can create up to 1000 lists per account.
947
948   :param name: The name of the new list.
949   :param mode: |list_mode|
950   :param description: The description of the list you are creating.
951   :rtype: :class:`List` object
952
953
954.. method:: API.destroy_list([owner_screen_name/owner_id], list_id/slug)
955
956   Deletes the specified list.
957   The authenticated user must own the list to be able to destroy it.
958
959   :param owner_screen_name: |owner_screen_name|
960   :param owner_id: |owner_id|
961   :param list_id: |list_id|
962   :param slug: |slug|
963   :rtype: :class:`List` object
964
965
966.. method:: API.update_list(list_id/slug, [name], [mode], [description], \
967                            [owner_screen_name/owner_id])
968
969   Updates the specified list.
970   The authenticated user must own the list to be able to update it.
971
972   :param list_id: |list_id|
973   :param slug: |slug|
974   :param name: The name for the list.
975   :param mode: |list_mode|
976   :param description: The description to give the list.
977   :param owner_screen_name: |owner_screen_name|
978   :param owner_id: |owner_id|
979   :rtype: :class:`List` object
980
981
982.. method:: API.lists_all([screen_name], [user_id], [reverse])
983
984   Returns all lists the authenticating or specified user subscribes to,
985   including their own. The user is specified using the ``user_id`` or
986   ``screen_name`` parameters. If no user is given, the authenticating user is
987   used.
988
989   A maximum of 100 results will be returned by this call. Subscribed lists are
990   returned first, followed by owned lists. This means that if a user
991   subscribes to 90 lists and owns 20 lists, this method returns 90
992   subscriptions and 10 owned lists. The ``reverse`` method returns owned lists
993   first, so with ``reverse=true``, 20 owned lists and 80 subscriptions would
994   be returned.
995
996   :param screen_name: |screen_name|
997   :param user_id: |user_id|
998   :param reverse: A boolean indicating if you would like owned lists to be
999                   returned first. See description above for information on how
1000                   this parameter works.
1001   :rtype: list of :class:`List` objects
1002
1003
1004.. method:: API.lists_memberships([screen_name], [user_id], \
1005                                  [filter_to_owned_lists], [cursor], [count])
1006
1007   Returns the lists the specified user has been added to. If ``user_id`` or
1008   ``screen_name`` are not provided, the memberships for the authenticating
1009   user are returned.
1010
1011   :param screen_name: |screen_name|
1012   :param user_id: |user_id|
1013   :param filter_to_owned_lists: A boolean indicating whether to return just
1014      lists the authenticating user owns, and the user represented by
1015      ``user_id`` or ``screen_name`` is a member of.
1016   :param cursor: |cursor|
1017   :param count: |count|
1018   :rtype: list of :class:`List` objects
1019
1020
1021.. method:: API.lists_subscriptions([screen_name], [user_id], [cursor], \
1022                                    [count])
1023
1024   Obtain a collection of the lists the specified user is subscribed to, 20
1025   lists per page by default. Does not include the user's own lists.
1026
1027   :param screen_name: |screen_name|
1028   :param user_id: |user_id|
1029   :param cursor: |cursor|
1030   :param count: |count|
1031   :rtype: list of :class:`List` objects
1032
1033
1034.. method:: API.list_timeline(list_id/slug, [owner_id/owner_screen_name], \
1035                              [since_id], [max_id], [count], \
1036                              [include_entities], [include_rts])
1037
1038   Returns a timeline of tweets authored by members of the specified list.
1039   Retweets are included by default. Use the ``include_rts=false`` parameter to
1040   omit retweets.
1041
1042   :param list_id: |list_id|
1043   :param slug: |slug|
1044   :param owner_id: |owner_id|
1045   :param owner_screen_name: |owner_screen_name|
1046   :param since_id: |since_id|
1047   :param max_id: |max_id|
1048   :param count: |count|
1049   :param include_entities: |include_entities|
1050   :param include_rts: A boolean indicating whether the list timeline will
1051      contain native retweets (if they exist) in addition to the standard
1052      stream of tweets. The output format of retweeted tweets is identical to
1053      the representation you see in home_timeline.
1054   :rtype: list of :class:`Status` objects
1055
1056
1057.. method:: API.get_list(list_id/slug, [owner_id/owner_screen_name])
1058
1059   Returns the specified list. Private lists will only be shown if the
1060   authenticated user owns the specified list.
1061
1062   :param list_id: |list_id|
1063   :param slug: |slug|
1064   :param owner_id: |owner_id|
1065   :param owner_screen_name: |owner_screen_name|
1066   :rtype: :class:`List` object
1067
1068
1069.. method:: API.add_list_member(list_id/slug, screen_name/user_id, \
1070                                [owner_id/owner_screen_name])
1071
1072   Add a member to a list. The authenticated user must own the list to be able
1073   to add members to it. Lists are limited to 5,000 members.
1074
1075   :param list_id: |list_id|
1076   :param slug: |slug|
1077   :param screen_name: |screen_name|
1078   :param user_id: |user_id|
1079   :param owner_id: |owner_id|
1080   :param owner_screen_name: |owner_screen_name|
1081   :rtype: :class:`List` object
1082
1083
1084.. method:: API.add_list_members(list_id/slug, screen_name/user_id, \
1085                                 [owner_id/owner_screen_name])
1086
1087   Add up to 100 members to a list. The authenticated user must own the list to
1088   be able to add members to it. Lists are limited to 5,000 members.
1089
1090   :param list_id: |list_id|
1091   :param slug: |slug|
1092   :param screen_name: A comma separated list of screen names, up to 100 are
1093                       allowed in a single request
1094   :param user_id: A comma separated list of user IDs, up to 100 are allowed in
1095                   a single request
1096   :param owner_id: |owner_id|
1097   :param owner_screen_name: |owner_screen_name|
1098   :rtype: :class:`List` object
1099
1100
1101.. method:: API.remove_list_member(list_id/slug, screen_name/user_id, \
1102                                   [owner_id/owner_screen_name])
1103
1104   Removes the specified member from the list. The authenticated user must be
1105   the list's owner to remove members from the list.
1106
1107   :param list_id: |list_id|
1108   :param slug: |slug|
1109   :param screen_name: |screen_name|
1110   :param user_id: |user_id|
1111   :param owner_id: |owner_id|
1112   :param owner_screen_name: |owner_screen_name|
1113   :rtype: :class:`List` object
1114
1115
1116.. method:: API.remove_list_members(list_id/slug, screen_name/user_id, \
1117                                    [owner_id/owner_screen_name])
1118
1119   Remove up to 100 members from a list. The authenticated user must own the
1120   list to be able to remove members from it. Lists are limited to 5,000
1121   members.
1122
1123   :param list_id: |list_id|
1124   :param slug: |slug|
1125   :param screen_name: A comma separated list of screen names, up to 100 are
1126                       allowed in a single request
1127   :param user_id: A comma separated list of user IDs, up to 100 are allowed in
1128                   a single request
1129   :param owner_id: |owner_id|
1130   :param owner_screen_name: |owner_screen_name|
1131   :rtype: :class:`List` object
1132
1133
1134.. method:: API.list_members(list_id/slug, [owner_id/owner_screen_name], \
1135                             [cursor])
1136
1137   Returns the members of the specified list.
1138
1139   :param list_id: |list_id|
1140   :param slug: |slug|
1141   :param owner_id: |owner_id|
1142   :param owner_screen_name: |owner_screen_name|
1143   :param cursor: |cursor|
1144   :rtype: list of :class:`User` objects
1145
1146
1147.. method:: API.show_list_member(list_id/slug, screen_name/user_id, \
1148                                 [owner_id/owner_screen_name])
1149
1150   Check if the specified user is a member of the specified list.
1151
1152   :param list_id: |list_id|
1153   :param slug: |slug|
1154   :param screen_name: |screen_name|
1155   :param user_id: |user_id|
1156   :param owner_id: |owner_id|
1157   :param owner_screen_name: |owner_screen_name|
1158   :rtype: :class:`User` object if user is a member of list
1159
1160
1161.. method:: API.subscribe_list(list_id/slug, [owner_id/owner_screen_name])
1162
1163   Subscribes the authenticated user to the specified list.
1164
1165   :param list_id: |list_id|
1166   :param slug: |slug|
1167   :param owner_id: |owner_id|
1168   :param owner_screen_name: |owner_screen_name|
1169   :rtype: :class:`List` object
1170
1171
1172.. method:: API.unsubscribe_list(list_id/slug, [owner_id/owner_screen_name])
1173
1174   Unsubscribes the authenticated user from the specified list.
1175
1176   :param list_id: |list_id|
1177   :param slug: |slug|
1178   :param owner_id: |owner_id|
1179   :param owner_screen_name: |owner_screen_name|
1180   :rtype: :class:`List` object
1181
1182
1183.. method:: API.list_subscribers(list_id/slug, [owner_id/owner_screen_name], \
1184                                 [cursor], [count], [include_entities], \
1185                                 [skip_status])
1186
1187   Returns the subscribers of the specified list. Private list subscribers will
1188   only be shown if the authenticated user owns the specified list.
1189
1190   :param list_id: |list_id|
1191   :param slug: |slug|
1192   :param owner_id: |owner_id|
1193   :param owner_screen_name: |owner_screen_name|
1194   :param cursor: |cursor|
1195   :param count: |count|
1196   :param include_entities: |include_entities|
1197   :param skip_status: |skip_status|
1198   :rtype: list of :class:`User` objects
1199
1200
1201.. method:: API.show_list_subscriber(list_id/slug, screen_name/user_id, \
1202                                     [owner_id/owner_screen_name])
1203
1204   Check if the specified user is a subscriber of the specified list.
1205
1206   :param list_id: |list_id|
1207   :param slug: |slug|
1208   :param screen_name: |screen_name|
1209   :param user_id: |user_id|
1210   :param owner_id: |owner_id|
1211   :param owner_screen_name: |owner_screen_name|
1212   :rtype: :class:`User` object if user is subscribed to list
1213
1214
1215Trends Methods
1216--------------
1217
1218.. method:: API.trends_available()
1219
1220   Returns the locations that Twitter has trending topic information for.
1221   The response is an array of "locations" that encode the location's WOEID
1222   (a Yahoo! Where On Earth ID) and some other human-readable information such
1223   as a canonical name and country the location belongs in.
1224
1225   :rtype: :class:`JSON` object
1226
1227
1228.. method:: API.trends_place(id, [exclude])
1229
1230   Returns the top 50 trending topics for a specific WOEID,
1231   if trending information is available for it.
1232
1233   The response is an array of “trend” objects that encode the name of the
1234   trending topic, the query parameter that can be used to search for the topic
1235   on Twitter Search, and the Twitter Search URL.
1236
1237   This information is cached for 5 minutes. Requesting more frequently than
1238   that will not return any more data, and will count against your rate limit
1239   usage.
1240
1241   The tweet_volume for the last 24 hours is also returned for many trends if
1242   this is available.
1243
1244   :param id: The Yahoo! Where On Earth ID of the location to return trending
1245              information for. Global information is available by using 1 as
1246              the WOEID.
1247   :param exclude: Setting this equal to hashtags will remove all hashtags
1248                   from the trends list.
1249   :rtype: :class:`JSON` object
1250
1251
1252.. method:: API.trends_closest(lat, long)
1253
1254   Returns the locations that Twitter has trending topic information for,
1255   closest to a specified location.
1256
1257   The response is an array of “locations” that encode the location’s WOEID and
1258   some other human-readable information such as a canonical name and country
1259   the location belongs in.
1260
1261   A WOEID is a Yahoo! Where On Earth ID.
1262
1263   :param lat: If provided with a long parameter the available trend locations
1264               will be sorted by distance, nearest to furthest, to the
1265               co-ordinate pair. The valid ranges for longitude is -180.0 to
1266               +180.0 (West is negative, East is positive) inclusive.
1267   :param long: If provided with a lat parameter the available trend locations
1268                will be sorted by distance, nearest to furthest, to the
1269                co-ordinate pair. The valid ranges for longitude is -180.0 to
1270                +180.0 (West is negative, East is positive) inclusive.
1271   :rtype: :class:`JSON` object
1272
1273
1274Geo Methods
1275-----------
1276
1277.. method:: API.reverse_geocode([lat], [long], [accuracy], [granularity], \
1278                                [max_results])
1279
1280   Given a latitude and longitude, looks for places (cities and neighbourhoods)
1281   whose IDs can be specified in a call to :func:`update_status` to appear as
1282   the name of the location. This call provides a detailed response about the
1283   location in question; the :func:`nearby_places` function should be preferred
1284   for getting a list of places nearby without great detail.
1285
1286   :param lat: The location's latitude.
1287   :param long: The location's longitude.
1288   :param accuracy: Specify the "region" in which to search, such as a number
1289                    (then this is a radius in meters, but it can also take a
1290                    string that is suffixed with ft to specify feet).
1291                    If this is not passed in, then it is assumed to be 0m
1292   :param granularity: Assumed to be ``neighborhood`` by default; can also be
1293                       ``city``.
1294   :param max_results: A hint as to the maximum number of results to return.
1295                       This is only a guideline, which may not be adhered to.
1296
1297
1298.. method:: API.geo_id(id)
1299
1300   Given *id* of a place, provide more details about that place.
1301
1302   :param id: Valid Twitter ID of a location.
1303
1304
1305Utility methods
1306---------------
1307
1308.. method:: API.configuration()
1309
1310   Returns the current configuration used by Twitter including twitter.com
1311   slugs which are not usernames, maximum photo resolutions, and t.co
1312   shortened URL length. It is recommended applications request this endpoint
1313   when they are loaded, but no more than once a day.
1314
1315
1316Media methods
1317-------------
1318
1319.. method:: API.media_upload(filename, [file])
1320
1321   Use this endpoint to upload images to Twitter.
1322
1323   :param filename: The filename of the image to upload. This will
1324                    automatically be opened unless ``file`` is specified.
1325   :param file: A file object, which will be used instead of opening
1326                ``filename``. ``filename`` is still required, for MIME type
1327                detection and to use as a form field in the POST data.
1328   :rtype: :class:`Media` object
1329
1330
1331.. method:: API.create_media_metadata(media_id, alt_text)
1332
1333   This endpoint can be used to provide additional information about the
1334   uploaded media_id. This feature is currently only supported for images and
1335   GIFs. Call this endpoint to attach additional metadata such as image alt
1336   text.
1337
1338   :param media_id: The ID of the media to add alt text to.
1339   :param alt_text: The alt text to add to the image.
1340
1341
1342:mod:`tweepy.error` --- Exceptions
1343==================================
1344
1345The exceptions are available in the ``tweepy`` module directly, which means
1346``tweepy.error`` itself does not need to be imported. For example,
1347``tweepy.error.TweepError`` is available as ``tweepy.TweepError``.
1348
1349
1350.. exception:: TweepError
1351
1352   The main exception Tweepy uses. Is raised for a number of things.
1353
1354   When a ``TweepError`` is raised due to an error Twitter responded with,
1355   the error code (`as described in the API documentation
1356   <https://developer.twitter.com/en/docs/basics/response-codes>`_) can be
1357   accessed at ``TweepError.response.text``. Note, however, that
1358   ``TweepError``\ s also may be raised with other things as message
1359   (for example plain error reason strings).
1360
1361
1362.. exception:: RateLimitError
1363
1364   Is raised when an API method fails due to hitting Twitter's rate limit.
1365   Makes for easy handling of the rate limit specifically.
1366
1367   Inherits from :exc:`TweepError`, so ``except TweepError`` will catch a
1368   ``RateLimitError`` too.
1369
1370
1371.. rubric:: Footnotes
1372
1373.. [#] https://web.archive.org/web/20170829051949/https://dev.twitter.com/rest/reference/get/search/tweets
1374.. [#] https://twittercommunity.com/t/favorited-reports-as-false-even-if-status-is-already-favorited-by-the-user/11145
1375