‘API’ object has no attribute ‘search’

AttributeError                            Traceback (most recent call last)
<ipython-input-9-4152b890358f> in <module>
     20 t = []
     21 
---> 22 for tweet in tweepy.Cursor(api.search,q=search_key,count=1000,lang="id",since="2022-11-10",until="2022-11-20").items():
     23     print(tweet.created_at,tweet.id,tweet.user.name,tweet.text)
     24     c.append(tweet.created_at)