DEV Community

Lyner Lim
Lyner Lim

Posted on

1

Tweepy - Twitter Data Scraping in 2025

Note that to select Read and write in App permissions under User authentication settings.

client = tweepy.Client(
    bearer_token=BREARER,
    consumer_key=API_KEY,
    consumer_secret=API_KEY_SECRET,
    access_token=ACCESS_TOKEN,
    access_token_secret=ACCESS_TOKEN_SECRET,
    return_type = dict,
    wait_on_rate_limit = True
)

response = client.search_recent_tweets(
    "artifical intelligence OR machine learning lang:en",
    max_results = 10,
    tweet_fields = ['author_id','created_at','text']
)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay