URL joiner
Resolve relative links such as ../page or ?q=1 against a base URL, following RFC 3986.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/url-join \
-H 'Content-Type: application/json' \
-d '{"input":{"base":"http://a/b/c/d;p?q","references":["g","../g","/g","//g","?y","#s","../../../g"]}}'
import json, urllib.request
body = {'input': {'base': 'http://a/b/c/d;p?q', 'references': ['g', '../g', '/g', '//g', '?y', '#s', '../../../g']}}
request = urllib.request.Request("https://setget.net/v1/tools/url-join", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/url-join", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"base":"http://a/b/c/d;p?q","references":["g","../g","/g","//g","?y","#s","../../../g"]}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "url-join",
"input": {
"base": "http://a/b/c/d;p?q",
"references": [
"g",
"../g",
"/g",
"//g",
"?y",
"#s",
"../../../g"
]
}
}
{
"input": {
"base": "http://a/b/c/d;p?q",
"references": [
"g",
"../g",
"/g",
"//g",
"?y",
"#s",
"../../../g"
]
}
}
Endpoint: POST /v1/tools/url-join. Over MCP: run_tool with slug: "url-join".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
base |
string | yes | The absolute URL the links are relative to. |
references |
array | yes | Relative or absolute links to resolve. |
Examples
The examples from RFC 3986
Input
{
"base": "http://a/b/c/d;p?q",
"references": [
"g",
"../g",
"/g",
"//g",
"?y",
"#s",
"../../../g"
]
}Result
{
"base": "http://a/b/c/d;p?q",
"results": [
{
"reference": "g",
"url": "http://a/b/c/g"
},
{
"reference": "../g",
"url": "http://a/b/g"
},
{
"reference": "/g",
"url": "http://a/g"
},
{
"reference": "//g",
"url": "http://g"
},
{
"reference": "?y",
"url": "http://a/b/c/d;p?y"
},
{
"reference": "#s",
"url": "http://a/b/c/d;p?q#s"
},
{
"reference": "../../../g",
"url": "http://a/g"
}
]
}Input
{
"base": "https://example.com/docs/guide/",
"references": [
"intro.html",
"../img/logo.png"
]
}Result
{
"base": "https://example.com/docs/guide/",
"results": [
{
"reference": "intro.html",
"url": "https://example.com/docs/guide/intro.html"
},
{
"reference": "../img/logo.png",
"url": "https://example.com/docs/img/logo.png"
}
]
}Questions
- Why does the last part of the base disappear?
- A relative link replaces everything after the last slash of the base. End the base with a slash if its last part is a folder.
Related tools
- URL parserSplit a URL into scheme, login, host, port, path, query parameters and fragment.
url-parse - URL normaliserClean a URL into a standard form: lowercase host, no default port, resolved dots, optional tracking removal.
url-normalize - HTML link extractorList every link and image in HTML, with link text, resolved address, rel values and internal or external.
html-extract-links - .gitignore testerCheck which paths a .gitignore file ignores and which line decided each one, using real Git matching rules.
gitignore-test - Cache-Control explainerExplain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.
cache-control-explain - Card number (Luhn) and IBAN validatorCheck a card number with the Luhn checksum and name its network, or check an IBAN by length and mod-97.
luhn-iban-validate