URL Inspector

URL Inspector API

Development

Analyze any URL and break it down into components. Extract protocol, hostname, port, pathname, query parameters, and fragments instantly.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

100 requests per minute

Endpoints

1 endpoint available

Overview

The URL Inspector API parses URLs and extracts all components using the native URL API.

Extracted Components

  • href: Full URL string
  • protocol: URL scheme (http:, https:, ftp:)
  • origin: Protocol + host
  • host: Hostname + port
  • hostname: Domain name only
  • port: Port number
  • pathname: Path after domain
  • search: Query string with leading ?
  • hash: Fragment with leading #
  • searchParams: Parsed query parameters as object

Endpoints

POST
/v1/tools/url-inspector
Parse a URL and extract all components

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
url
string
Required
The URL to parse (must be a valid URL with protocol)

Response Example

{
  "success": true,
  "data": {
    "href": "https://example.com:8080/path/to/page?foo=bar&baz=qux#section",
    "protocol": "https:",
    "origin": "https://example.com:8080",
    "host": "example.com:8080",
    "hostname": "example.com",
    "port": "8080",
    "pathname": "/path/to/page",
    "search": "?foo=bar&baz=qux",
    "hash": "#section",
    "searchParams": {
      "foo": "bar",
      "baz": "qux"
    }
  }
}

Error Codes

400
Bad Request - Invalid URL format
401
Unauthorized - Invalid or missing API key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

curl -X POST https://api.opentools.ca/v1/tools/url-inspector \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com:8080/path/to/page?foo=bar&baz=qux#section"
  }'

Ready to get started?

Create an API key to start using the URL Inspector API.