![Dynamic Input avatar](https://images.apifyusercontent.com/XrVzlfEi90jIal4mkuFN1a7ydLrgb3tPa4G_H1yVf0c/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9kYTNXNlZveDdyZ2JLM3RNMy9NcXdFcEcyeWZSaDRRTFlucy1pbnB1dF9waWMucG5n.webp)
Dynamic Input
Try for free
No credit card required
View all Actors![Dynamic Input](https://images.apifyusercontent.com/XrVzlfEi90jIal4mkuFN1a7ydLrgb3tPa4G_H1yVf0c/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9kYTNXNlZveDdyZ2JLM3RNMy9NcXdFcEcyeWZSaDRRTFlucy1pbnB1dF9waWMucG5n.webp)
![Dynamic Input](https://images.apifyusercontent.com/XrVzlfEi90jIal4mkuFN1a7ydLrgb3tPa4G_H1yVf0c/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9kYTNXNlZveDdyZ2JLM3RNMy9NcXdFcEcyeWZSaDRRTFlucy1pbnB1dF9waWMucG5n.webp)
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 more
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)
32print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
33for item in client.dataset(run["defaultDatasetId"]).iterate_items():
34 print(item)
35
36# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start
Developer
Maintained by Community
Actor metrics
- 3 monthly users
- 3 stars
- 100.0% runs succeeded
- Created in Sep 2023
- Modified 4 months ago
Categories