1
votes

I'm trying to retrieve embedded tweets using statuses/oembed , the url sent to the api is https://api.twitter.com/1.1/statuses/oembed/507185938620219395.json but i noticed in the documentation the sent url should be https://api.twitter.com/1.1/statuses/oembed.json?id=507185938620219395

i'm already using search/tweets smoothly, the problem is only with oembed. Below is a sample of what i'm doing

  from twitter import *
  class TwitterCrawler(object):
    # Authenticate twitter API
    # Access token, Access token secret, Consumer key, Consumer secret
    def __init__(self):
        self.t = Twitter(
                         auth=OAuth(self.accessToken, 
                                self.accessTokenSecret,
                                self.consumerKey, 
                                self.consumerSecret)
                         )

    def getEmbeddedTweet(self):
        result =self.t.statuses.oembed(id="507185938620219395")
        return result

the error returned is: TwitterHTTPError Twitter sent status 404 for URL: 1.1/statuses/oembed/567386147631144960.json using parameters:...details: b'{"errors":[{"message":"Sorry, that page does not exist","code":34}]}'

1

1 Answers

0
votes

The correct endpoint for this is publish.twitter.com/oembed