How should repeated query parameter names be represented in an HTTP URL?
Quick answer
There is no single URL convention that every API must use for multiple values under one parameter name. An endpoint might specify repeated pairs such as tag=red&tag=blue, a comma-separated value such as tag=red,blue, or another format. Check the documentation for the specific endpoint and operation, then build the request to match it rather than assuming how the server interprets the query.
The question, the details, the next step.
A practical checklist
Identify the exact endpoint and operation you are calling.
Find its stated rule for multiple values, arrays, repeated names, or delimiters.
Compare the rule with an example from that same endpoint.
Build the URL using the documented representation, not a guessed convention.
If unclear, ask the API owner or test safely, then confirm that every value was recognized.
A few more useful answers
Is `?tag=red&tag=blue` always equivalent to `?tag=red,blue`?
No. They are different query strings, and an API may interpret them differently. Use the representation specified for the endpoint.
Does URLSearchParams prove that a server accepts duplicate names?
No. It documents how that browser JavaScript interface appends and serializes pairs; it does not establish how a server handles them. [S2]
What should I do if the documentation gives no answer?
Ask the API owner for the expected format or use a safe test environment if available. Verify that multiple values were actually applied rather than relying only on a successful response.
Sources
References used for this guide.
- [S1] URI query — MDN developer.mozilla.org · Checked
- [S2] URLSearchParams: append() method — MDN developer.mozilla.org · Checked
