Python Get Twitter Tweet ID From Url

March 28, 2020
from urllib.parse import urlparse

url = 'https://twitter.com/jack/status/20'
tweet_id = urlparse(url).path.split('/')[-1]
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.