I have the necessary imports and Twitter API credentials
auth = tweepy.OAuthHandler(API_KEY, API_KEY_SECRET)
auth.set_access_token(Access_token, Access_token_secret)
api = tweepy.API(auth)
#Define Twitter handle and API endpoint
handle = "CommBank"
url = f"https://api.twitter.com/2/tweets/search/recent?query=from:{handle}&tweet.fields=created_at&expansions=author_id&user.fields=created_at"
headers = {"Authorization": f"Bearer {BEARER_TOKEN}"}
tweet_count = 100
params = {"max_results": tweet_count}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
tweets_data = response.json()
for tweet in tweets_data.get("data", []):
print(tweet.get("text"))
else:
print("Error")