Constructing an API request by hand
Building a filter or pagination query correctly the first time avoids the encoding bugs that appear only when a value contains a space or an ampersand.
Builds a URL with query parameters safely — correct encoding, no manual mistakes.
Builds a URL with query parameters safely — correct encoding, no manual mistakes.
base: https://api.example.com/search, params: { q: "hello world", page: 2 }https://api.example.com/search?q=hello%20world&page=2
Values are percent-encoded automatically.
The output is a correctly encoded query string.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/query-string-builder" \
-H "Content-Type: application/json" \
-d '{"base":"https://example.com","params":{"a":"1","b":"2"}}'const res = await fetch("https://yas.sh/api/v1/tools/query-string-builder", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"base": "https://example.com",
"params": {
"a": "1",
"b": "2"
}
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/query-string-builder", json={"base":"https://example.com","params":{"a":"1","b":"2"}})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| base | string | Yes | Base URL |
| params | object | No | Query params to append |
{ "result": "https://example.com/?a=1&b=2", "paramsAdded": 2 }Build a URL with query parameters safely.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).The builder assembles a query string using URLSearchParams semantics: each key and value is percent-encoded according to the application/x-www-form-urlencoded rules, pairs are joined with &, and the result is appended after ? — or after & when the base URL already carries a query string. Encoding a value is what keeps a stray &, = or # inside it from being read as structure.
Two conventions differ from plain percent-encoding and catch people out. Space is encoded as + rather than %20 in the form-urlencoded serialization, and repeated keys are legal: a=1&a=2 is not a duplicate to be resolved but an ordered list, which frameworks variously expose as an array, as the first value, or as the last. There is no standard, so the receiving side's behaviour has to be known rather than assumed.
Building a filter or pagination query correctly the first time avoids the encoding bugs that appear only when a value contains a space or an ampersand.
Search terms, names and free text routinely contain characters that break an unencoded query string.
Rebuilding the exact parameter set is how you confirm whether a failing request is malformed or genuinely rejected.
Support and onboarding flows often prefill fields from query parameters; encoding correctly ensures the values arrive intact.
What this tool deliberately does not do, and where it will disagree with other implementations.