URLBuild["path",{"param1"val1,"param2"val2,…}]
builds a URL with the specified path and query parameters and values parami and vali.
URLBuild[{"path1","path2",…}]
builds a URL from the path components pathi.
URLBuild[path,params]
builds a URL from a specification of a path and query parameters.
URLBuild[assoc]
builds a URL from an association of components.
URLBuild[assoc,params]
builds a URL from an association of components, plus query parameters and values.
URLBuild
URLBuild["path",{"param1"val1,"param2"val2,…}]
builds a URL with the specified path and query parameters and values parami and vali.
URLBuild[{"path1","path2",…}]
builds a URL from the path components pathi.
URLBuild[path,params]
builds a URL from a specification of a path and query parameters.
URLBuild[assoc]
builds a URL from an association of components.
URLBuild[assoc,params]
builds a URL from an association of components, plus query parameters and values.
Details and Options
- URLBuild[URL["path"],…] and URLBuild[CloudObject["path"],…] are also supported.
- In a list of rules for queries, the vali can be strings or numbers, or the following special forms:
-
None,Null,Missing "" True "true" False "false" {e1,e2,…} e1, e2, … - In URLBuild[assoc], the Association assoc can contain the following elements:
-
"Scheme" URL scheme "User" user information "Domain" domain name or host "Port" port number (as an integer) "Path" path list or string "Query" query string or list of parameter-value pairs "Fragment" fragment specification (given after #) - If queries are specified both in assoc and with a list of rules, the queries are concatenated.
- Strings from assoc or from query parameters or values are percent-encoded.
- URLBuild has the option CharacterEncoding, which specifies what type of character encoding to use for the output. The default is "UTF-8".
Examples
open all close allBasic Examples (3)
URLBuild[{"www.wolfram.com", "solutions"}]URLBuild[{"https://www.google.com", "search"}, {"q" -> "Mathematica"}]Create a URL string from an association:
URLBuild[<|"Scheme" -> "https", "Domain" -> "www.wolframalpha.com", "Path" -> "examples"|>]Scope (6)
URLBuild[{"https://www.wolframalpha.com", "examples", "Engineering.html"}]URLBuild[{"https://www.wolframalpha.com", "input"}, {"i" -> "Doppler Shift 300Hz at 75 mph"}]Nested lists in query parameters are flattened:
URLBuild["https://example.com", <|"n" -> {1, 2, 3}|>]Existing query parameters are preserved:
URLBuild["https://example.com/?a=2", <|"n" -> {1, 2, 3}|>]Use a URL object for the base:
URLBuild[URL["https://www.example.com/?i=1"], <|"x" -> 2|>]Use a CloudObject for the base:
URLBuild[CloudObject[], <|"input" -> 2|>]Generalizations & Extensions (1)
URLBuild[<|"Scheme" -> "https", "User" -> "user:info", "Domain" -> "www.domain.com", "Port" -> "80", "Path" -> {"path", "to", "resource"}, "Query" -> {"param1" -> "val2", "param2" -> "val2"}, "Fragment" -> "fragment"|>]Query can either be a string or a list of rules:
URLBuild[<|"Path" -> "path/to/dir", "Query" -> "x=3"|>]URLBuild[<|"Path" -> "path/to/dir", "Query" -> {"x" -> 3}|>]Path can be a list or a list of paths:
URLBuild[<|"Path" -> "path/to/dir"|>]URLBuild[<|"Path" -> {"path", "to", "dir"}|>]Options (3)
CharacterEncoding (1)
RemoveEmptyQueries (1)
Applications (1)
Properties & Relations (1)
The parameter values are encoded using URLQueryEncode:
URLBuild[{"https://www.wolframalpha.com", "input"}, {"i" -> "Integral of Sin x^2"}]Possible Issues (1)
Repeated keys are not supported by Association:
URLBuild["https://example.com", <|"value" -> 1, "value" -> 2|>]To specify multiple values, collect them in a list:
URLBuild["https://example.com", <|"value" -> {1, 2}|>]Alternatively, use a list of rules:
URLBuild["https://example.com", {"value" -> 1, "value" -> 2}]Related Workflows
- Create a Short URL ▪
- Deploy a Web API
Text
Wolfram Research (2014), URLBuild, Wolfram Language function, https://reference.wolfram.com/language/ref/URLBuild.html (updated 2016).
CMS
Wolfram Language. 2014. "URLBuild." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/URLBuild.html.
APA
Wolfram Language. (2014). URLBuild. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/URLBuild.html
BibTeX
@misc{reference.wolfram_2026_urlbuild, author="Wolfram Research", title="{URLBuild}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/URLBuild.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_urlbuild, organization={Wolfram Research}, title={URLBuild}, year={2016}, url={https://reference.wolfram.com/language/ref/URLBuild.html}, note=[Accessed: 13-June-2026]}