Requestly
HTTP InterceptorPricingRequestly vs PostmanBlogDocsDownload

Home / Blog / Use Cases

Data-Driven API Testing with Requestly (CSV/JSON)

Running the same API test with different inputs shouldn’t mean rewriting requests again and again. That’s where data-driven testing comes in. With Requestly’s Collection Runner, you can easily run your APIs against multiple datasets directly from a CSV or JSON file.

Let’s see how it works.

What is Data-Driven API Testing?

Data-driven testing lets you use external data sources such as CSV or JSON files to run your API tests multiple times with different input values without modifying your requests each time.

It’s especially useful when:

  • You’re validating multiple user scenarios

  • You need to test APIs with varying payloads or parameters

  • You want automated regression coverage without duplication

In short: one test setup, many test cases.

Why Use Requestly’s Collection Runner for It?

Requestly’s Collection Runner was built for developers and testers who want a simpler, faster, and more flexible way to automate API workflows.
And now, with data-driven runs, you can:

  • Import CSV or JSON test data
  • Automatically inject values into request parameters, headers, or bodies
  • View consolidated results for each data row
  • Combine it with pre-request scripts and post-response tests for complete automation

You can test a full API suite in just a few clicks, with no external scripting required.

How It Works

Here’s a quick breakdown:

1. Create Your Collection

Organize your related API requests into a Collection inside the Requestly API Client.
Each request can include placeholders using variables like {{user_id}}, {{email}}, or {{amount}}.

2. Add Test Data (CSV or JSON)

Upload your dataset when running the collection.
For example, your users.csv might look like:

user_id email amount
101 test1@email.com 500
102 test2@email.com 250
103 test3@email.com 1000

Or, you can use a JSON file like:

[
  { "user_id": 101, "email": "test1@email.com", "amount": 500 },
  { "user_id": 102, "email": "test2@email.com", "amount": 250 },
  { "user_id": 103, "email": "test2@email.com", "amount": 1000 }
]

3. Hit “Run Collection”

When you start the Collection Runner, select your data file.
Requestly automatically substitutes variable values for each row or JSON object, sending requests with dynamic data.

You can also add assertions in post-response scripts to validate expected outputs, like:

rq.test("Status code is 200", () => rq.response.status === 200)
rq.test("Amount matches input", () => rq.response.json().amount === data.amount)

4. Analyze Results

After the run, Requestly displays a summary of all iterations including success and failure counts, response times, and test results for each dataset row.

This gives you a clear view of how your APIs behave across different inputs.

Example Use Cases

Here’s how teams are already using data-driven testing with Requestly:

  • QA engineers validating bulk user creation, order processing, or login APIs

  • Developers stress-testing APIs with hundreds of payloads before deployment

  • Product teams verifying API behavior for different environment configurations

Try It Out

You can try data-driven testing today in the Requestly Desktop App.

  1. Open your API Collection

  2. Click Run Collection

  3. Upload your CSV or JSON test data

  4. Watch your requests run automatically

It’s that simple.

Final Thoughts

APIs power everything, but robust testing powers reliable APIs.
With Requestly’s Collection Runner, you get the power of data-driven testing without the complexity.

Upload your dataset, hit Run, and make your testing effortless.

Data-drive your tests: Feed a CSV or JSON file into Requestly’s Collection Runner to test many cases in a single run. Try Requestly API Client →

Frequently Asked Questions

What is data-driven API testing?

Data-driven testing runs the same requests against many sets of input data, usually from a CSV or JSON file, instead of one hard-coded set of values.

What file formats can I use for test data?

CSV and JSON files, where the columns or keys map to variables that get substituted into each request.

How do I reference data columns in a request?

Use the variable syntax, for example double curly braces around a column name, in the URL, headers, or body. Each iteration substitutes the next row.

How do I run a data-driven test in Requestly?

Attach the CSV or JSON file to the Collection Runner and run the collection. It iterates once per row of data.

Can I assert results per row?

Yes. Post-response tests run on every iteration, so you get a pass or fail result for each row of input data.

Why use data-driven testing?

You get broad coverage, including valid, invalid, and edge-case inputs, from a single collection, with far less duplication than copying requests.

Test any API request visually: import a cURL command or build from scratch in Requestly, the free API client for developers.

Download Free →