Skip to content

Website response metadata

GET
/website
const url = 'https://api.dazrik.net/website?target=example.com';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Fetches an HTTP or HTTPS URL, follows redirects, and returns the final status and response headers without the page body. The target must resolve to a public IP. A received HTTP response, including a remote 404 or 500, returns API HTTP 200 with ok: true; statusCode contains the website’s status. Connection failures return HTTP 400.

target
required
string

An HTTP/HTTPS URL or hostname. If the scheme is omitted, http:// is used. The value is a URL-encoded query parameter, including any query string in the target URL.

Example

example.com

Response metadata

Media typeapplication/json
object
ok
required
boolean
query
required

The raw target as supplied

string
address
required
string
requestUrl
required

The requested URL, including the default scheme when omitted

string
responseUrl
required

Final URL after redirects

string
statusCode
required

HTTP status returned by the website, independent of the API response status

integer
statusText
required
string
headers
required

Response headers of the final response

object
key
additional properties
string

Example

{
"ok": true,
"query": "example.com",
"address": "93.184.216.34",
"requestUrl": "http://example.com",
"responseUrl": "https://example.com/",
"statusCode": 200,
"statusText": "OK"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

Missing target, validation failure, or the website could not be reached

Media typeapplication/json
object
ok
required
boolean
msg
required
string
query
string
address
string
requestUrl
string

Example

{
"ok": false,
"query": "example.com",
"address": "93.184.216.34",
"requestUrl": "https://example.com",
"msg": "can't connect to the website"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

Target resolves to a private/reserved address

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "target doesn't resolve to a public addr"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

The request limit of 60 requests per minute per client IP was reached, or /connect or /website requests to the same destination are temporarily limited. The per-client request limit includes Retry-After, the number of seconds until the request budget resets. Destination-limit responses omit that header. A destination limit can apply even when RateLimit-Remaining is greater than zero.

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "you're being rate limited, try again later."
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42
Retry-After
integer

Seconds to wait before retrying after the per-client request limit is reached. Destination connection limits can return HTTP 429 without this header.

Example
42

Unexpected server error

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "unknown error"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42