I am trying to omit the script being appended onto the oembed twitter call. At the moment i have this:

    tweet = random.choice(result)
    tweet_id = str(tweet.id)
    embReqUrl = 'https://publish.twitter.com/oembed?url=https://twitter.com/Interior/status/'+tweet_id + '?omit_script=true'
    embResp = requests.get(embReqUrl)
    json = embResp.json()
    html = json['html']
    pprint(html)
    return html

but its still returning the script. What’s the right way to do this?

Good question; I’ll have to ask our team on this. It seems like the docs might not be completely in sync with current capability.

Hi @alvin_tung1,

I think your query sting is just misformatted. Try changing ?omit_script=true to &omit_script=true and see if that works?

Thanks @evansobkowicz
It works!

1 Like