![Batch Runner avatar](https://images.apifyusercontent.com/40Ld3hsYy_8PlW5IRk6FK4c73PqHmaEnTgIXOTui5Dg/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS94bVFtVEFVbDl5Y2N1ZnBXTC8zaHh4cjZISkhDUWpQYUc1Ui1wcm9jZXNzaW5nLnBuZw.webp)
Batch Runner
Try for free
No credit card required
View all Actors![Batch Runner](https://images.apifyusercontent.com/40Ld3hsYy_8PlW5IRk6FK4c73PqHmaEnTgIXOTui5Dg/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS94bVFtVEFVbDl5Y2N1ZnBXTC8zaHh4cjZISkhDUWpQYUc1Ui1wcm9jZXNzaW5nLnBuZw.webp)
![Batch Runner](https://images.apifyusercontent.com/40Ld3hsYy_8PlW5IRk6FK4c73PqHmaEnTgIXOTui5Dg/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS94bVFtVEFVbDl5Y2N1ZnBXTC8zaHh4cjZISkhDUWpQYUc1Ui1wcm9jZXNzaW5nLnBuZw.webp)
Batch Runner
useful-tools/batch-runner
Try for free
No credit card required
Actor for starting several Runs from single Input. It also has capability to merge the Dataset items from the created batch.
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 "batch": [
9 {
10 "actorId": "useful-tools/wait-and-finish",
11 "input": {
12 "minWaitTime": 30,
13 "dataset": { "items": [{ "key": "value1" }] },
14 },
15 },
16 {
17 "actorId": "useful-tools/wait-and-finish",
18 "input": { "dataset": { "items": [
19 { "key": "value1" },
20 { "key": "value2" },
21 ] } },
22 },
23 ],
24 "maxConcurrency": 25,
25 "maxMemoryMb": 32768,
26}
27
28# Run the Actor and wait for it to finish
29run = client.actor("useful-tools/batch-runner").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
- 1 monthly user
- 3 stars
- 100.0% runs succeeded
- 2.1 hours response time
- Created in Sep 2023
- Modified 3 months ago
Categories