from apify_client import ApifyClient # Initialize the ApifyClient with your API token client = ApifyClient("apify_api_Ro2wMpbfuFrWvUDufrha7qAiyJPvPz10pPoL") def run_api(search): # Prepare the Actor input run_input = { "searchQueries": [ search ], "resultsPerPage": 100, "profileScrapeSections": ["videos"], "excludePinnedPosts": False, "searchSection": "", "maxProfilesPerQuery": 10, "shouldDownloadVideos": False, "shouldDownloadCovers": False, "shouldDownloadSubtitles": False, "shouldDownloadSlideshowImages": False, } # Run the Actor and wait for it to finish run = client.actor("OtzYfK1ndEGdwWFKQ").call(run_input=run_input) # Fetch and print Actor results from the run's dataset (if there are any) return client.dataset(run["defaultDatasetId"])