Back to All Questions
Question 18 of 100
Basic API Testing
Beginner
Q18: What are Query Parameters in API Requests?
🔍Core Concept
What are Query Parameters in API Requests?
Key Takeaways & Architecture Summary
- ✓Appended to the end of the URL string following a question mark (?).
- ✓Used to filter, sort, paginate, or search for resources.
- ✓Formatted as key-value pairs linked by equals (=) and ampersands (&).
Direct Answer Summary
Query Parameters are key-value pairs appended to the end of a URL (after a `?` separator) used to control the search scope, filter outputs, sort attributes, or navigate pages of a resource catalog without altering the primary resource route.
⚠️ Senior Engineering Warning (Red Flag)
Never pass passwords, API keys, or credit cards in query parameters. URLs are frequently logged by internet service providers, corporate firewalls, and server error trackers, leaking data.
💡 STAR Architectural Explanation & Pro Tip
Query parameters do not identify unique resources; they configure the format or slice of data returned, making them excellent for indexing and pagination engines.
RestAssuredTest.java
Rest-Assured + Java// Target URL: https://api.app.com/v1/jobs?status=active&limit=10
RestAssured.given()
.queryParam("status", "active")
.queryParam("limit", 10)
.when()
.get("https://api.careerraah.com/v1/jobs");