In this article, you'll learn how to run multiple curl commands in parallel — and how to send curl requests sequentially when you need to throttle things instead. Whether you want to fire off a single curl loop 100 times, send concurrent requests to dozens of URLs, or process a large list through a proxy, there's a curl command for it. To run curl parallel requests or sequential ones, we can use:
xargs--parallel(built into curl)for loop in bashseq
You can find several examples below:

Let's discuss in more detail how to send multiple curl requests simultaneously.
1. curl parallel requests with xargs + seq
This is one of the most common ways to send curl concurrent requests without relying on curl's own --parallel flag. xargs reads a stream of input and turns it into commands, and its -P option controls how many of those commands run at the same time.
To send parallel curl requests with xargs and the -P option:
seq 1 100 | xargs -n1 -P5 -I{} curl "http://example.com/"
The command above will run the curl command 100 times total, processing 5 requests in parallel at any given moment, until all 100 are done.
Breaking it down:
seq 1 100— generates the numbers 1 through 100, one per linexargs -n1— pass one argument to each curl invocation-P5— keep 5 jobs running in parallel-I{}— placeholder for the piped-in value (not used in the URL here, but required by-I)
If you just want a fixed parallel curl pool hitting the same URL, you can drop -I{} and use -n1 alone:
seq 1 100 | xargs -n1 -P5 curl -s -o /dev/null "http://example.com/"
2. curl --parallel: native parallel curl requests
Since curl 7.66, curl has built-in support for parallel transfers — no xargs or background processes needed. We can do multiple parallel requests with curl by using the --parallel option (-Z for short).
Do 3 parallel curl requests to a list of sites given on the command line:
curl --parallel --parallel-immediate --parallel-max 3 example.com example.com example.com
--parallel(-Z) — enables parallel transfers--parallel-immediate— starts transfers immediately instead of waiting to figure out the optimal number of connections--parallel-max 3— caps the number of concurrent curl requests at 3
This is the cleanest way to run a parallel curl command when you just have a handful of URLs and don't need a separate scripting layer.
3. curl multiple urls with -O / -o
A simpler everyday case: you just want to download several files with one curl command instead of looping. curl can take multiple URLs directly, and -O saves each one using its remote filename.
curl -O https://example.com/file1.zip -O https://example.com/file2.zip -O https://example.com/file3.zip
If you want to control the output filenames instead of using the remote name, use -o with the #1, #2 numbering syntax against a globbed URL:
curl -o "file_#1.html" "https://example.com/page[1-5].html"
This expands to page1.html through page5.html and saves each one as file_1.html, file_2.html, etc. Combine it with --parallel to fetch them all at once instead of one after another:
curl --parallel --parallel-max 5 -o "file_#1.html" "https://example.com/page[1-5].html"
This single line covers both "curl multiple urls" and "curl parallel" in one shot — no loop required.
4. curl in a for loop
We can use a for loop to run multiple curl commands at once. We can simulate a parallel run by using two loops:
for ((request=1;request<=5;request++))— from 1 to 5for i in $(seq 2)— two parallel calls of curl per iteration- both ways to generate iterations are almost the same
for ((request=1; request<=5; request++))
do
for i in $(seq 2)
do
time curl http://example.com & sleep 2
done
done
The trailing & backgrounds each curl call so the two inner-loop requests fire close together, and sleep 2 gives them a moment to complete before the next outer iteration starts. This pattern is handy if you want to send multiple curl requests on a schedule rather than all at once — for example, simulating "curl repeat every second" style polling with a controlled pace instead of an uncontrolled flood.
5. curl --parallel with an input config file
We can use a file with URLs as the source to send multiple curl requests:
curl --parallel --parallel-immediate --parallel-max 10 --config source.txt
In this case we send 10 parallel curl requests against the URLs from the file source.txt. The file format looks like this:
url = "example.com"
url = "example.com"
url = "example.com"
This scales well: drop a few hundred URLs into source.txt, set --parallel-max to whatever your target server (or your own bandwidth) can tolerate, and curl handles the queueing for you.
6. Multiple sequential curl requests + proxy
Finally, we can combine everything above to run a large batch of curl requests — based on a file or an array of values — sequentially in controlled batches, while also routing through a proxy to reach another site or subdomain.
http://proxy.example.com:7878— proxy site and portproxy_pass="user-${country}-${sidnum}:pass"— username + password (or other proxy auth) built from variables- we use the country as a parameter and generate a random number used as a session ID
jq -c .— convert JSON to JSON Lines>> data_$country.csv— append the JSON Lines output to a file
#!/bin/bash
for country in US BR FR;
do
for ((request=1; request<=100; request++))
do
for ((r=1; r<=10; r++))
do
sidnum=$(shuf -i 0-999999 -n 1)
proxy_pass="user-${country}-${sidnum}:pass"
echo "$proxy_pass"
curl -x http://proxy.example.com:7878 --proxy-user "$proxy_pass" -L "https://example.com/" | jq -c . >> "data_$country.csv" & sleep 1
done
done
done
Running the code above sends 1,000 curl requests per country, 10 of them in parallel at any time — effectively a curl loop 100 times nested with a 10-way parallel inner batch, repeated for each country in the list.
Example output for the first two iterations of the loop:
user-US-246150:pass
user-US-766402:pass
user-BR-623033:pass
user-BR-71104:pass
user-FR-412842:pass
user-FR-653389:pass
7. curl parallel + seq + xargs combined
In this example we'll cover how to run curl in parallel and pass parameters with xargs, combining a country-based loop with an inner xargs-driven parallel batch:
#!/bin/bash
for country in US BR FR;
do
for i in $(seq 100);
do
proxy_pass="user-${country}:pass"
#echo "$proxy_pass"
seq 1 30 | xargs -I{} -P15 -- curl -x http://proxy.example.com:7878 --proxy-user "$proxy_pass" -L "https://example.com/" | jq -c . >> "data_$country.csv" & sleep 3
done
done
for country in US BR FR;— array of countries used as inputfor i in $(seq 100);— repeat the parallel batch 100 timesproxy_pass="user-${country}:pass";— proxy credentials per countryseq 1 30— generates 30 parallel curl requests per batchxargs -I{} -P15— runs 15 of them at once| jq -c .— converts JSON to JSON Linesdata_$country.csv— writes results to file as they complete
If you need to keep track of the parallel count inside the parallel executions with xargs, you can do:
seq 1 4 | xargs -I{} -P2 -- echo {}
This will produce:
1
2
3
4
Frequently asked questions
How do I run multiple curl requests in parallel?
Use xargs -P with seq (see section 1), curl's native --parallel flag (section 2), or background a for loop with & (section 4). For most cases, curl --parallel is the simplest starting point since it needs no extra tools.
How can I run a curl command in a loop 100 times?
Pipe seq 1 100 into a while read loop, or use a C-style bash loop: for ((i=1; i<=100; i++)); do curl http://example.com; done. Add xargs -P or a trailing & if you want those 100 requests to run concurrently instead of one at a time.
How do I send multiple curl requests to different URLs at once?
Either list the URLs directly — curl -O url1 -O url2 -O url3 — or use the [1-5] globbing syntax with -o "file_#1" to generate a range of URLs from a pattern (section 3). Add --parallel to fetch them concurrently.
How can I run multiple curl requests processed sequentially?
Use a plain for loop without the trailing &, or set curl --parallel-max 1 if you want to keep the --parallel syntax but force one-at-a-time behavior.
How do you automate curl commands?
Wrap them in a bash script with a loop (or xargs), feed it a file of URLs via --config, and schedule it with cron if it needs to run repeatedly — for example, on an interval like "curl repeat every second."
How do you pass multiple headers in curl?
Repeat the -H flag once per header: curl -H "Accept: application/json" -H "Authorization: Bearer TOKEN" https://example.com.
Summary
In this article we covered how to run multiple curl commands in parallel, plus a few related techniques: sequential runs, the --parallel flag, -O/-o for multiple URLs at once, parallel runs with parameters, proxy setup, and writing results to file as they complete.
We also answered common questions about curl parallel requests, including:
- How do I run multiple curl requests in parallel?
- How can I run a curl loop 100 times?
- How do I send multiple curl requests simultaneously to different URLs?
- How can I run multiple curl requests processed sequentially?
- How do you automate curl commands?
- How do you pass multiple headers in curl?
Other topics which were discussed briefly:
- curl parallel requests and parallel curl commands
- curl --parallel --parallel-immediate
- curl -o multiple urls example
- curl multiple post requests
- curl repeat every second
- curl parallel download
- curl --parallel --parallel-max