← Back to Home

URL Analyzer

/url-analyze/:url
Parse and analyze URLs - extract protocol, domain, port, path, query parameters, authentication, and more. Provides detailed analysis including security indicators, encoding detection, and normalized variants.
▼ Try it now

Parameters

url path or query
URL to analyze (should be properly encoded)

Examples

curl
# Basic URL analysis
curl https://tcpdata.com/url-analyze/https://tcpdata.com/path?foo=bar

# Complex URL with authentication and port
curl 'https://tcpdata.com/url-analyze?url=https://user:pass@example.com:8080/api/v1/users?page=2%26limit=10%23results'

# URL with fragment
curl https://tcpdata.com/url-analyze/https://example.com/docs%23section-2

# IPv4 URL
curl https://tcpdata.com/url-analyze/http://192.168.1.1:8080/admin

# File URL with extension
curl https://tcpdata.com/url-analyze/https://cdn.example.com/images/photo.jpg?size=large
JavaScript (fetch)
// Analyze URL
const url = 'https://api.example.com:8443/v1/users?page=1&limit=10#top';
const response = await fetch(`https://tcpdata.com/url-analyze?url=${encodeURIComponent(url)}`);
const analysis = await response.json();

console.log('Protocol:', analysis.parsed.protocol);
console.log('Hostname:', analysis.parsed.hostname);
console.log('Port:', analysis.parsed.port);
console.log('Path segments:', analysis.analysis.path_segments);
console.log('Query params:', analysis.query_parameters);
console.log('Is secure:', analysis.analysis.is_secure);

// Check if URL has authentication
if (analysis.analysis.has_authentication) {
  console.log('Auth:', analysis.components.userinfo);
}
Python (requests)
import requests
from urllib.parse import quote

# Analyze URL
url_to_analyze = 'https://user:pass@example.com:8080/api/users?active=true'
response = requests.get(f'https://tcpdata.com/url-analyze/{quote(url_to_analyze, safe="")}')
data = response.json()

print('Original:', data['original'])
print('Protocol:', data['parsed']['protocol'])
print('Hostname:', data['parsed']['hostname'])
print('Port:', data['parsed']['port'])
print('Path:', data['parsed']['pathname'])
print('Query params:', data['query_parameters'])
print('Has auth:', data['analysis']['has_authentication'])
print('Is HTTPS:', data['analysis']['is_secure'])
print('Decoded URL:', data['normalized']['decoded'])

Notes

Returns detailed breakdown including: parsed components, URL analysis flags, query parameters, and normalized variants

Analysis includes: is_secure, is_ipv4, is_ipv6, has_authentication, has_query_params, has_fragment, has_encoding, file_extension

Normalized variants provided: decoded, without_query, without_fragment, domain_only

Automatically detects IPv4 and IPv6 addresses

Extracts userinfo (username:password) if present in URL

Port defaults to 443 for https:// and 80 for http:// if not specified

Path segments are split and returned as array

URL should be properly encoded when passed as parameter