apify / apify-client-python

Apify API client for Python
https://docs.apify.com/api/client/python/
Apache License 2.0
47 stars 11 forks source link

Document how to add input to an actor #121

Closed rokcarl closed 1 year ago

rokcarl commented 1 year ago

I'm trying to find out how to run an actor and specify the input for it. E.g., the LinkedIn Company URL needs something like {"queries": "Tesla\nmicrosoft.com"}

The API docs are clear that whatever data is passed to the POST request will be interpreted as input to the actor.

However, I can't find a proper alternative in the Python docs, e.g. in the Usage concepts. There's dataset's push_items(), but I don't think that's it. Is there an equivalent?

fnesveda commented 1 year ago

Good point. The API Client docs aren't really good right now, and they don't have many examples. We've been focusing mostly on the SDK docs these days, but we should give some love to the client docs too.

Anyway, to add input to an actor, you can just pass an argument to the ActorClient.call() method:

run = apify_client.actor("anchor/linkedin-company-url").call(run_input={"queries": "Tesla\nmicrosoft.com"})
rokcarl commented 1 year ago

Thanks, that works.