trying to download all profile images from a userl...
# apify-platform
h
message has been deleted
n
Hello, I found apify on the internet and through chatgpt I am trying to create a tiktok profile photo scraper but I can't find the solution... my current code takes a list of users from a text file and I would like it with the api The images will be downloaded to a particular directory but I am getting an error that I have not even been able to resolve with gpt chat. Can I publish my code here or should I do it another way? The console say : "We have bad news: there is no API endpoint at this URL. Did you specify it correctly?" but i don't know how to fix that :( https://cdn.discordapp.com/attachments/1287495703530049648/1287495703731503296/bajarfotos2.py?ex=66f1c150&is=66f06fd0&hm=5677449738e8b819760aa30b2a77f2c9c45f612d3921bfc32857c0c8053e2007&
r
hey, this code is quite clunky, the best approach would be to follow the example in the docs and edit it based on your use case: https://apify.com/clockworks/tiktok-profile-scraper/api/python
this can be a minimal example of how to print out profile images, you can add reading from/saving to files as needed, also you can specify more than one profile in the input
Copy code
python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { 
    "profiles": ["apifyoffice"],
    "resultsPerPage": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("clockworks/tiktok-profile-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item['authorMeta']['avatar'])

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start