Spaces:
Sleeping
Sleeping
File size: 877 Bytes
2fe6fa2 5e0e8a4 2fe6fa2 969ac52 2fe6fa2 969ac52 2fe6fa2 9a1f584 2fe6fa2 9a1f584 2fe6fa2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
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"]) |