Dynamic Input avatar
Dynamic Input
Try for free

No credit card required

View all Actors
Dynamic Input

Dynamic Input

useful-tools/dynamic-input
Try for free

No credit card required

Actor for calling other Actors with dynamic input

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

Node.js

Python

curl

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8    "input": """// Available packages:
9//  - Apify Actor - https://docs.apify.com/sdk/js/reference/class/Actor
10//    - example:
11//      await Actor.pushData({ my : 'data'});
12//  - Axios - https://axios-http.com/
13//    - example:
14//      log.info(`Current IP is: ${(await Axios.get('https://ipinfo.io/json')).data.ip}`)
15//  - Moment.js - https://momentjs.com/
16//    - example:
17//      log.info(`Tomorrow is: ${moment().add(1, 'day').toISOString()}`)
18
19const waitTime = Math.ceil(5 + Math.random() * 10);
20
21return {
22    minWaitTime: waitTime,
23    maxWaitTime: waitTime + 2_000
24}""",
25    "proxyConfiguration": { "useApifyProxy": True },
26}
27
28# Run the Actor and wait for it to finish
29run = client.actor("useful-tools/dynamic-input").call(run_input=run_input)
30
31# Fetch and print Actor results from the run's dataset (if there are any)
32for item in client.dataset(run["defaultDatasetId"]).iterate_items():
33    print(item)
Developer
Maintained by Community
Actor metrics
  • 2 monthly users
  • 94.1% runs succeeded
  • 0.0 days response time
  • Created in Sep 2023
  • Modified 13 days ago