URL/Slug Utilities

Parse Url

Breaks down URLs into structured components like protocol, host, path, and query parameters. Available through MCP in Cursor and other AI editors, or via REST at `/v1/slug/parse-url`. Pass any URL and get back a JSON object with separate fields for each part. Essential for URL validation, routing logic, and parameter extraction in web applications.

API Endpoint

GET /v1/slug/parse-url

Code Examples

curl "https://tinyfn.io/v1/slug/parse-url" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/slug/parse-url', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/slug/parse-url',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's url/slug tools:

{
  "mcpServers": {
    "tinyfn-slug": {
      "url": "https://tinyfn.io/mcp/slug",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What URL components does the parser extract?

Returns protocol, hostname, port, pathname, search parameters, hash fragment, and additional metadata like subdomain detection. Handles both absolute and relative URLs with proper component separation.

Can I parse URLs with special characters or international domains?

Yes, supports Unicode domains, encoded characters, and international URLs. Properly decodes percent-encoded characters and handles punycode for internationalized domain names.

How do I extract query parameters from a URL using MCP?

The parser automatically separates query string into individual key-value pairs. Access them through the returned object's query or searchParams field, depending on the output format.

Does it validate if the URL is properly formatted?

Performs basic validation during parsing and flags malformed URLs. Returns error details for invalid protocols, missing components, or syntactically incorrect URLs.

What's the difference between this and browser URL parsing?

Provides consistent parsing across environments without browser dependencies. Returns standardized output format and handles edge cases that native URL constructors might reject or interpret differently.

Try Parse Url Now

Get your free API key and start using Parse Url in seconds.

Get Free API Key