URLParse
Details and Options
- Possible components extracted by URLParse include:
-
"Scheme" URL scheme (appearing at the beginning) "User" user information "Domain" domain name or host "Port" port number (appearing after :) "Path" path list (separated by /) "PathString" complete path as a string "AbsoluteDomain" complete domain as a string, including scheme "AbsolutePath" complete path as a string, including scheme and domain "Query" list of parameter-value pairs (appearing after ?) "QueryString" complete query string "Fragment" fragment specification (appearing after #) - If a particular component is not present in the URL, the value returned for that component is None.
- A "Port" component, if present, is returned as an integer.
- A trailing / in the path component of the URL is represented by a last element "" in the "Path" component returned by URLParse.
- URLParse["url"] returns an Association containing the following sequence of keys: "Scheme", "User", "Domain", "Port", "Path", "Query", "Fragment".
- URLParse[{"url1","url2",…},…] gives results for a list of URLs.
- URLParse has option CharacterEncoding, which specifies the encoding of character codes to assume in the URL. The default is "UTF-8".
- URLParse[URL["url"],…] and URLParse[CloudObject["url"],…] also supported.
Examples
open all close allBasic Examples (3)
Parse a URL into its components:
URLParse["http://www.wolfram.com/solutions"]URLParse["http://www.wolframalpha.com/input?i=100+USD+in+EUR", {"Path", "Query"}]URLParse automatically threads over lists:
URLParse[{"http://www.wolfram.com", "http://www.wolframalpha.com"}]Scope (5)
URLParse["http://www.wolframalpha.com/examples", "Domain"]Get the user information from a generic URL:
URLParse["ssh://user:pass@host:port/base2?par1=val1#fragment", "User"]The path is returned as a list:
URLParse["http://www.wolfram.com/solutions/industry/astronomy", "Path"]The full path string can be obtained with "PathString":
URLParse["http://www.wolfram.com/solutions/industry/astronomy", "PathString"]The query is returned as a decoded list of rules:
URLParse["http://www.wolframalpha.com/input/?i=tom+brady+vs+peyton+manning+touchdowns&a=_*NFLPassingTouchdowns-", "Query"]The original query string can be obtained with "QueryString":
URLParse["http://www.wolframalpha.com/input/?i=tom+brady+vs+peyton+manning+touchdowns&a=_*NFLPassingTouchdowns-", "QueryString"]Separating "AbsolutePath" from "Query":
URLParse["http://www.wolframalpha.com/input/?i=tom+brady+vs+peyton+manning+touchdowns&a=_*NFLPassingTouchdowns-", {"AbsolutePath", "Query"}]URL or CloudObject can be used:
URLParse[CloudObject[], "PathString"]URLParse[URL["http://www.wolfram.com"], "Domain"]Related Workflows
- Deploy and Use a Cloud-Based API on the Command Line
Text
Wolfram Research (2014), URLParse, Wolfram Language function, https://reference.wolfram.com/language/ref/URLParse.html (updated 2016).
CMS
Wolfram Language. 2014. "URLParse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/URLParse.html.
APA
Wolfram Language. (2014). URLParse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/URLParse.html
BibTeX
@misc{reference.wolfram_2026_urlparse, author="Wolfram Research", title="{URLParse}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/URLParse.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_urlparse, organization={Wolfram Research}, title={URLParse}, year={2016}, url={https://reference.wolfram.com/language/ref/URLParse.html}, note=[Accessed: 13-June-2026]}