Looking up tweets with tweepy using tweet ids stops after a few tweets - user suspended error












1














I have a dataset with tweet ids and I'd like to look up the tweets using Tweepy and save them in a csvfile.



auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)

api = tweepy.API(auth, wait_on_rate_limit=True)

def get_tweet_text(tweet_id):
tweet = api.get_status(tweet_id)
return tweet.text

with open('NAACL_SRW_2016_cleaned.csv', 'a') as csvfile_clean:
writer = csv.writer(csvfile_clean, delimiter=';')
writer.writerow(['ID', 'Form of Hate Speech', 'Tweet'])

with open('NAACL_SRW_2016.csv') as csvfile:
csv_reader: object = csv.reader(csvfile, delimiter=',')
for row in csv_reader:
id_of_tweet = (row[0])
hate = (row[1])
tweet = get_tweet_text(id_of_tweet)
print(tweet)

writer = csv.writer(csvfile_clean, delimiter=';')
writer.writerow([id_of_tweet, hate, tweet])


The code works fine, but it stops after a few tweets and I get the error message below. However, I'm not suspended - I don't get any kind of message about that on my account and I can also still stream tweets just fine. I've tried different IPs and regenerated the keys, but I always get said error. Anyone experienced something similar? If you have any tips on what I could try to make it work, I'd be very grateful.



So Drasko just said he was impressed the girls cooked half a chicken.. 
They cooked a whole one #MKR
Drasko they didn't cook half a bird you idiot #mkr
Hopefully someone cooks Drasko in the next ep of #MKR
of course you were born in serbia...you're as fucked as A Serbian Film
These girls are the equivalent of the irritating Asian girls #MKR
Lost the plot - where's the big Texan with the elephant sized steaks

tweepy.error.TweepError: [{'code': 63, 'message': 'User has been
suspended.'}]









share|improve this question



























    1














    I have a dataset with tweet ids and I'd like to look up the tweets using Tweepy and save them in a csvfile.



    auth = OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_token, access_secret)

    api = tweepy.API(auth, wait_on_rate_limit=True)

    def get_tweet_text(tweet_id):
    tweet = api.get_status(tweet_id)
    return tweet.text

    with open('NAACL_SRW_2016_cleaned.csv', 'a') as csvfile_clean:
    writer = csv.writer(csvfile_clean, delimiter=';')
    writer.writerow(['ID', 'Form of Hate Speech', 'Tweet'])

    with open('NAACL_SRW_2016.csv') as csvfile:
    csv_reader: object = csv.reader(csvfile, delimiter=',')
    for row in csv_reader:
    id_of_tweet = (row[0])
    hate = (row[1])
    tweet = get_tweet_text(id_of_tweet)
    print(tweet)

    writer = csv.writer(csvfile_clean, delimiter=';')
    writer.writerow([id_of_tweet, hate, tweet])


    The code works fine, but it stops after a few tweets and I get the error message below. However, I'm not suspended - I don't get any kind of message about that on my account and I can also still stream tweets just fine. I've tried different IPs and regenerated the keys, but I always get said error. Anyone experienced something similar? If you have any tips on what I could try to make it work, I'd be very grateful.



    So Drasko just said he was impressed the girls cooked half a chicken.. 
    They cooked a whole one #MKR
    Drasko they didn't cook half a bird you idiot #mkr
    Hopefully someone cooks Drasko in the next ep of #MKR
    of course you were born in serbia...you're as fucked as A Serbian Film
    These girls are the equivalent of the irritating Asian girls #MKR
    Lost the plot - where's the big Texan with the elephant sized steaks

    tweepy.error.TweepError: [{'code': 63, 'message': 'User has been
    suspended.'}]









    share|improve this question

























      1












      1








      1







      I have a dataset with tweet ids and I'd like to look up the tweets using Tweepy and save them in a csvfile.



      auth = OAuthHandler(consumer_key, consumer_secret)
      auth.set_access_token(access_token, access_secret)

      api = tweepy.API(auth, wait_on_rate_limit=True)

      def get_tweet_text(tweet_id):
      tweet = api.get_status(tweet_id)
      return tweet.text

      with open('NAACL_SRW_2016_cleaned.csv', 'a') as csvfile_clean:
      writer = csv.writer(csvfile_clean, delimiter=';')
      writer.writerow(['ID', 'Form of Hate Speech', 'Tweet'])

      with open('NAACL_SRW_2016.csv') as csvfile:
      csv_reader: object = csv.reader(csvfile, delimiter=',')
      for row in csv_reader:
      id_of_tweet = (row[0])
      hate = (row[1])
      tweet = get_tweet_text(id_of_tweet)
      print(tweet)

      writer = csv.writer(csvfile_clean, delimiter=';')
      writer.writerow([id_of_tweet, hate, tweet])


      The code works fine, but it stops after a few tweets and I get the error message below. However, I'm not suspended - I don't get any kind of message about that on my account and I can also still stream tweets just fine. I've tried different IPs and regenerated the keys, but I always get said error. Anyone experienced something similar? If you have any tips on what I could try to make it work, I'd be very grateful.



      So Drasko just said he was impressed the girls cooked half a chicken.. 
      They cooked a whole one #MKR
      Drasko they didn't cook half a bird you idiot #mkr
      Hopefully someone cooks Drasko in the next ep of #MKR
      of course you were born in serbia...you're as fucked as A Serbian Film
      These girls are the equivalent of the irritating Asian girls #MKR
      Lost the plot - where's the big Texan with the elephant sized steaks

      tweepy.error.TweepError: [{'code': 63, 'message': 'User has been
      suspended.'}]









      share|improve this question













      I have a dataset with tweet ids and I'd like to look up the tweets using Tweepy and save them in a csvfile.



      auth = OAuthHandler(consumer_key, consumer_secret)
      auth.set_access_token(access_token, access_secret)

      api = tweepy.API(auth, wait_on_rate_limit=True)

      def get_tweet_text(tweet_id):
      tweet = api.get_status(tweet_id)
      return tweet.text

      with open('NAACL_SRW_2016_cleaned.csv', 'a') as csvfile_clean:
      writer = csv.writer(csvfile_clean, delimiter=';')
      writer.writerow(['ID', 'Form of Hate Speech', 'Tweet'])

      with open('NAACL_SRW_2016.csv') as csvfile:
      csv_reader: object = csv.reader(csvfile, delimiter=',')
      for row in csv_reader:
      id_of_tweet = (row[0])
      hate = (row[1])
      tweet = get_tweet_text(id_of_tweet)
      print(tweet)

      writer = csv.writer(csvfile_clean, delimiter=';')
      writer.writerow([id_of_tweet, hate, tweet])


      The code works fine, but it stops after a few tweets and I get the error message below. However, I'm not suspended - I don't get any kind of message about that on my account and I can also still stream tweets just fine. I've tried different IPs and regenerated the keys, but I always get said error. Anyone experienced something similar? If you have any tips on what I could try to make it work, I'd be very grateful.



      So Drasko just said he was impressed the girls cooked half a chicken.. 
      They cooked a whole one #MKR
      Drasko they didn't cook half a bird you idiot #mkr
      Hopefully someone cooks Drasko in the next ep of #MKR
      of course you were born in serbia...you're as fucked as A Serbian Film
      These girls are the equivalent of the irritating Asian girls #MKR
      Lost the plot - where's the big Texan with the elephant sized steaks

      tweepy.error.TweepError: [{'code': 63, 'message': 'User has been
      suspended.'}]






      python twitter tweepy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 18 '18 at 16:47









      BirnenbrinchenBirnenbrinchen

      82




      82
























          1 Answer
          1






          active

          oldest

          votes


















          0














          That error indicates that the user who wrote the tweet you're searching for has been suspended, not that you have. It is the value returned by the tweepy api for error code 63 as listed here https://developer.twitter.com/en/docs/basics/response-codes.html .



          The twitter response codes sheet states that code 63 means The user account has been suspended and the information cannot be retrieved.



          You will not be able to access this information using the api. There is no work around.






          share|improve this answer























          • I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
            – quant
            Nov 19 '18 at 20:54










          • The link just said what I said above. It was a citation not an answer itself.
            – Kenneth Steimel
            Nov 19 '18 at 21:55










          • This answer does not require any clarification from the asker.
            – Kenneth Steimel
            Nov 21 '18 at 4:08










          • The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
            – Kenneth Steimel
            Nov 21 '18 at 4:15






          • 1




            Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
            – Birnenbrinchen
            Nov 21 '18 at 7:38











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53363234%2flooking-up-tweets-with-tweepy-using-tweet-ids-stops-after-a-few-tweets-user-su%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          That error indicates that the user who wrote the tweet you're searching for has been suspended, not that you have. It is the value returned by the tweepy api for error code 63 as listed here https://developer.twitter.com/en/docs/basics/response-codes.html .



          The twitter response codes sheet states that code 63 means The user account has been suspended and the information cannot be retrieved.



          You will not be able to access this information using the api. There is no work around.






          share|improve this answer























          • I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
            – quant
            Nov 19 '18 at 20:54










          • The link just said what I said above. It was a citation not an answer itself.
            – Kenneth Steimel
            Nov 19 '18 at 21:55










          • This answer does not require any clarification from the asker.
            – Kenneth Steimel
            Nov 21 '18 at 4:08










          • The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
            – Kenneth Steimel
            Nov 21 '18 at 4:15






          • 1




            Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
            – Birnenbrinchen
            Nov 21 '18 at 7:38
















          0














          That error indicates that the user who wrote the tweet you're searching for has been suspended, not that you have. It is the value returned by the tweepy api for error code 63 as listed here https://developer.twitter.com/en/docs/basics/response-codes.html .



          The twitter response codes sheet states that code 63 means The user account has been suspended and the information cannot be retrieved.



          You will not be able to access this information using the api. There is no work around.






          share|improve this answer























          • I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
            – quant
            Nov 19 '18 at 20:54










          • The link just said what I said above. It was a citation not an answer itself.
            – Kenneth Steimel
            Nov 19 '18 at 21:55










          • This answer does not require any clarification from the asker.
            – Kenneth Steimel
            Nov 21 '18 at 4:08










          • The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
            – Kenneth Steimel
            Nov 21 '18 at 4:15






          • 1




            Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
            – Birnenbrinchen
            Nov 21 '18 at 7:38














          0












          0








          0






          That error indicates that the user who wrote the tweet you're searching for has been suspended, not that you have. It is the value returned by the tweepy api for error code 63 as listed here https://developer.twitter.com/en/docs/basics/response-codes.html .



          The twitter response codes sheet states that code 63 means The user account has been suspended and the information cannot be retrieved.



          You will not be able to access this information using the api. There is no work around.






          share|improve this answer














          That error indicates that the user who wrote the tweet you're searching for has been suspended, not that you have. It is the value returned by the tweepy api for error code 63 as listed here https://developer.twitter.com/en/docs/basics/response-codes.html .



          The twitter response codes sheet states that code 63 means The user account has been suspended and the information cannot be retrieved.



          You will not be able to access this information using the api. There is no work around.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 4:10

























          answered Nov 19 '18 at 20:36









          Kenneth SteimelKenneth Steimel

          161




          161












          • I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
            – quant
            Nov 19 '18 at 20:54










          • The link just said what I said above. It was a citation not an answer itself.
            – Kenneth Steimel
            Nov 19 '18 at 21:55










          • This answer does not require any clarification from the asker.
            – Kenneth Steimel
            Nov 21 '18 at 4:08










          • The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
            – Kenneth Steimel
            Nov 21 '18 at 4:15






          • 1




            Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
            – Birnenbrinchen
            Nov 21 '18 at 7:38


















          • I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
            – quant
            Nov 19 '18 at 20:54










          • The link just said what I said above. It was a citation not an answer itself.
            – Kenneth Steimel
            Nov 19 '18 at 21:55










          • This answer does not require any clarification from the asker.
            – Kenneth Steimel
            Nov 21 '18 at 4:08










          • The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
            – Kenneth Steimel
            Nov 21 '18 at 4:15






          • 1




            Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
            – Birnenbrinchen
            Nov 21 '18 at 7:38
















          I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
          – quant
          Nov 19 '18 at 20:54




          I believe is not an answer. If you believe something, a comment is the right place. Apart from that please don't post link only answers, see meta.stackexchange.com/questions/8231/… so that your answer stays useful in case the link target gets removed.
          – quant
          Nov 19 '18 at 20:54












          The link just said what I said above. It was a citation not an answer itself.
          – Kenneth Steimel
          Nov 19 '18 at 21:55




          The link just said what I said above. It was a citation not an answer itself.
          – Kenneth Steimel
          Nov 19 '18 at 21:55












          This answer does not require any clarification from the asker.
          – Kenneth Steimel
          Nov 21 '18 at 4:08




          This answer does not require any clarification from the asker.
          – Kenneth Steimel
          Nov 21 '18 at 4:08












          The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
          – Kenneth Steimel
          Nov 21 '18 at 4:15




          The answer is that you can't do this because twitter won't allow you to have the information. Hopefully my edit makes this more clear.
          – Kenneth Steimel
          Nov 21 '18 at 4:15




          1




          1




          Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
          – Birnenbrinchen
          Nov 21 '18 at 7:38




          Thank you for your answer! That makes sense. If I skip that tweet, I'll probably be able to retrieve the remaining ones.
          – Birnenbrinchen
          Nov 21 '18 at 7:38


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53363234%2flooking-up-tweets-with-tweepy-using-tweet-ids-stops-after-a-few-tweets-user-su%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?