NAV
cURL Node.js Python Ruby PHP

Overview

Introduction

This is the official documentation for the Siterelic REST API.

These APIs provide numerous capabilities for important testing and monitoring methods for websites. For instance, website performance, security, DNS, and SEO score are some of the capabilities offered by these APIs.

Getting started

Getting started with Siterelic is very easy. You'd need to register (no credit card required) to gain access to the free tier of Siterelic.

Once you have an API key, you may explore the Postman Collection to test APIs.

Get your API key

API type

The Siterelic is a REST API. That means it works over HTTP and accepts and returns data in the JSON format.

Rate (usage) limits

The Siterelic permits a call rate of 10 API calls per second under premium plan for each client having a valid token.

Proxy county

Many of the Siterelic APIs support request over proxy. In case you need to use this feature, the proxy to be provided as a proxyCountry parameter.

Here's a list of the supported countries:

Country Code
United States us
United Kingdom uk
France fr
Germany de
Canada ca
India in
China cn
Brazil br
Spain es
Japan jp

Request

Authentication

Make sure it's present in your header value when making API calls.

x-api-key YOUR-API-KEY

It expects the API access key to be present in a request header called x-api-key.

Base URL

For all the endpoints listed in this documentation, the base URL is https://api.siterelic.com

Response

The API response follows some common formats for the sake of clarity and consistency. Depending on the request status, the response structures are as given below.

On successful processing of a request, the API returns a response in the following format:

{
  "timestamp": 1610796547300,
  "apiStatus": "success",
  "apiCode": 200,
  "message": "An overview message.",
  "meta": {
    "url": "https://example.com"
  },
  "data": []
}

When the incoming request doesn't have proper authorization, the following response structure is returned:

{
  "message": "Forbidden"
}

If you are under a free plan and try to access a paid-only API like Port Scanner, it would return an error in the following format:

{
  "timestamp": 1658254283953,
  "apiStatus": "failure",
  "apiCode": 403,
  "message": "You are not allowed to access. This is available to premium plan only."
}

If a wrong endpoint or wrong request type (POST instead of GET, for example) is provided, the API returns an error in the following format:

{
  "timestamp": 1657208461046,
  "apiStatus": "failure",
  "apiCode": 404,
  "message": "API not found.",
  "meta": {
    "method": "POST",
    "endpoint": "/helloworld"
  }
}

API Endpoints

The Siterelic is comprised of the following endpoints.

curl --location --request POST 'https://api.siterelic.com/brokenlink' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/brokenlink",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/brokenlink"

payload = json.dumps({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/brokenlink")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/brokenlink', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657109686205,
  "apiStatus": "success",
  "apiCode": 200,
  "message": "No broken links found.",
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "wf0b7yrn05br8xtwple7ngj7hhxzvl2e"
    }
  },
  "data": [
    {
      "link": "https://siterelic.com/",
      "status": 200
    },
    {
      "link": "https://siterelic.com/articles",
      "status": 200
    }
  ]
}

The Broken Link Checker API checks if webpage contains any broken links.

Endpoint

/brokenlink

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

Try it yourself

DNS Records

curl --location --request POST 'https://api.siterelic.com/dnsrecord' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "types": ["A", "MX"]
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  types: ["A", "MX"],
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/dnsrecord",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/dnsrecord"

payload = json.dumps({
  "url": "siterelic.com",
  "types": [
    "A",
    "MX"
  ]
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/dnsrecord")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "types": [
    "A",
    "MX"
  ]
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "types": [
    "A",
    "MX"
  ]
}';
$request = new Request('POST', 'https://api.siterelic.com/dnsrecord', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657112689610,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "types": ["A", "MX"],
    "test": {
      "id": "zmkqoxxu075dwn4u61yoqhq2rwo0029m"
    }
  },
  "data": {
    "A": ["172.67.70.213", "104.26.11.88", "104.26.10.88"],
    "MX": [
      {
        "exchange": "alt3.aspmx.l.google.com",
        "priority": 10
      },
      {
        "exchange": "alt2.aspmx.l.google.com",
        "priority": 5
      },
      {
        "exchange": "alt1.aspmx.l.google.com",
        "priority": 5
      },
      {
        "exchange": "aspmx.l.google.com",
        "priority": 1
      }
    ]
  }
}

The DNS Records API pulls out and displays the DNS records of a given domain name.

Endpoint

/dnsrecord

Parameters

Name Type Description
url string The URL to be checked.
types string[] Type(s) of DNS records.

types parameter supports the following strings.

If you don’t provide the types parameter, it will show all the DNS records.

Try it yourself

DNSSEC

curl --location --request POST 'https://api.siterelic.com/dnssec' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/dnssec",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/dnssec"

payload = json.dumps({
  "url": "siterelic.com"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/dnssec")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com"
}';
$request = new Request('POST', 'https://api.siterelic.com/dnssec', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657115589175,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "test": {
      "id": "x4akd0mw0947jdo4c9qqdfru2c1h7maq"
    }
  },
  "data": true
}

The DNSSEC API test if security extension is enabled on the domain.

Endpoint

/dnssec

Parameters

Name Type Description
url string The URL to be tested.

Try it yourself

HTTP Headers

curl --location --request POST 'https://api.siterelic.com/httpheader' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/httpheader",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/httpheader"

payload = json.dumps({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/httpheader")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/httpheader', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657118780944,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "32ca8x3m08oiychu49gx9r3fvrw9t7f7"
    }
  },
  "data": [
    {
      "name": "date",
      "value": "Wed, 06 Jul 2022 14:46:20 GMT"
    },
    {
      "name": "content-type",
      "value": "text/html; charset=UTF-8"
    },
    {
      "name": "connection",
      "value": "close"
    }
  ]
}

The HTTP header API parses the response headers of a given endpoint (or website) and presents the output in JSON format. This can be useful in activities such as monitoring, data collection, etc.

Endpoint

/httpheader

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

Try it yourself

HTTP Protocol Support

curl --location --request POST 'https://api.siterelic.com/httpprotocol' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/httpprotocol",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/httpprotocol"

payload = json.dumps({
  "url": "siterelic.com",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/httpprotocol")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/httpprotocol', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657118991601,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "8b8beh8q03x5t82entwx9npfi1fxj39j"
    }
  },
  "data": {
    "http10": false,
    "http11": true,
    "http2": true,
    "http3": ["h3-29"]
  }
}

While the HTTP spec is constantly evolving, webservers (for want of configuration or capability) aren't always able to keep up. This API tests an HTTP endpoint and reports which HTTP versions are currently supported by that endpoint.

Endpoint

/httpprotocol

Parameters

Name Type Description
url string The URL to be checked.
followRedirect boolean Follow redirection.

Try it yourself

Lighthouse

curl --location --request POST 'https://api.siterelic.com/lighthouse' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": true,
  "parameters": ["--only-categories=seo", "--output=csv"]
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  device: "desktop",
  proxyCountry: "us",
  followRedirect: true,
  parameters: ["--only-categories=seo", "--output=csv"],
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/lighthouse",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/lighthouse"

payload = json.dumps({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": True,
  "parameters": [
    "--only-categories=seo",
    "--output=csv"
  ]
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/lighthouse")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": true,
  "parameters": [
    "--only-categories=seo",
    "--output=csv"
  ]
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": true,
  "parameters": [
    "--only-categories=seo",
    "--output=csv"
  ]
}';
$request = new Request('POST', 'https://api.siterelic.com/lighthouse', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657119087947,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "3zniwkh5067adrro1llpqstdwbtei1va"
    }
  },
  "data": "https://api-assets.siterelic.com/tests/lighthouse/irlqk1082a5iohh56j1f480v.csv"
}

The Lighthouse API provides access to the Google Lighthouse project as an API. Lighthouse is an audit tool for websites to score them on performance, accessibility, SEO, etc., while providing concrete improvement suggestions.

Endpoint

/lighthouse

Parameters

Name Type Description
url string The URL to be checked.
device string The device to be used.
parameters string[] Lighthouse parameters.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

device parameter supports desktop, mobile, and tablet strings. If you don’t provide the device parameter, desktop will be used as a default option.

Advanced mode

The Lighthouse API also runs in an advanced mode, accepting some of the customization parameters recognized by Google's Lighthouse engine:

The --output parameter controls the output format. It's set to json by default, but can be html or csv as well.

In order to use these parameters, pass them in aparameters JSON array in the body of the input. You may refer guide to run Lighthouse API using advanced mode.

Try it yourself

Load Time

curl --location --request POST 'https://api.siterelic.com/loadtime' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/loadtime",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/loadtime"

payload = json.dumps({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/loadtime")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/loadtime', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657119303041,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "zbmzby8v07l4f4vp4po3h0x3c1qqr7bf"
    }
  },
  "data": {
    "dns": 10,
    "connect": 12,
    "tls": 9,
    "send": 19,
    "wait": 86,
    "total": 88
  }
}

The Load Time API provides the total time (in milliseconds) it takes for an HTTP response to complete. This is often used to measure website performance and includes time taken for DNS lookup, waiting for the server to respond, data sent, data received, etc.

By default, the connection is made from servers located in the USA. However, to measure load time from other countries like France, the United Kingdom, China, India, etc., you can use a proxy parameter mentioned below.

Endpoint

/loadtime

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

Try it yourself

Meta Scraping

curl --location -g --request POST 'https://api.siterelic.com/metascraping' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  device: "desktop",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/metascraping",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/metascraping"

payload = json.dumps({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/metascraping")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
})

response = http.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/metascraping', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1663336951774,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "test": {
      "id": "ajfenqnl05l9dd8vh9zb2ffprr5g9k7o"
    }
  },
  "data": {
    "url": "https://siterelic.com/",
    "date": "Thu, 26 Jan 2023 18:58:40 GMT",
    "lang": "en-us",
    "title": "Siterelic - Your trusted source for Technology Resources",
    "description": "Siterelic is an online publication that produces high-quality articles on Technology, Business, and Fintech and makes Tools and APIs to help businesses and people grow.",
    "headline": "Technology Resources",
    "logo": "https://siterelic.com/wp-content/uploads/2020/01/Siterelic-logo.png",
    "image": "https://siterelic.com/wp-content/uploads/2019/06/Siterelic-social.png",
    "author": "Chandan Kumar",
    "publisher": "Siterelic",
    "feed": "https://siterelic.com/feed/"
  }
}

Meta Scraping API lets you extract metadata from any web page. You can extract data from a website using a Desktop, Mobile, or Tablet device.

To avoid getting blocked, you can also use a proxy.

It can extract the following meta data:

Endpoint

/metascraping

Parameters

Name Type Description
url string The URL to be checked.
device string The device to be used.
proxyCountry string Proxy county.

device parameter supports desktop, mobile, and tablet strings. If you don’t provide the device parameter, desktop will be used as a default option.

Try it yourself

Mixed Content

curl --location --request POST 'https://api.siterelic.com/mixedcontent' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/mixedcontent",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/mixedcontent"

payload = json.dumps({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/mixedcontent")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/mixedcontent', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657124909949,
  "apiStatus": "success",
  "apiCode": 200,
  "message": "No mixed content found.",
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "l8r16s8k0agfp31wt5i9y7bfzgfpf4ls"
    }
  },
  "data": [
    "https://siterelic.com/",
    "https://siterelic.com/wp-content/themes/siterelic/dist/site.css",
    "https://siterelic.com/wp-content/themes/siterelic/custom/custom.css",
    "https://siterelic.com/wp-content/themes/siterelic/public/site/section/header/logo.png"
  ]
}

The Mixed Content API checks whether a given website loads one or more static assets as mixed content. The problem of mixed content arises when a website loads its initial response over https but then loads one or more of its resources over http. This is more than a question of hygiene, as mixing non-secure content with secure content is a grave security slip-up and can result in on-path attacks and more.

Endpoint

/mixedcontent

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

Try it yourself

MTR

curl --location --request POST 'https://api.siterelic.com/mtr' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/mtr",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/mtr"

payload = json.dumps({
  "url": "siterelic.com"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/mtr")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com"
}';
$request = new Request('POST', 'https://api.siterelic.com/mtr', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125115104,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "test": {
      "id": "5cvz40fs08ige3jr15srd6ndl1qkndfc"
    }
  },
  "data": [
    {
      "hop": 1,
      "host": "240.192.18.19",
      "asn": "AS???",
      "loss": 0,
      "sent": 2,
      "last": 0.28,
      "avg": 0.29,
      "best": 0.28,
      "worst": 0.3,
      "stdDev": 0.01
    },
    {
      "hop": 2,
      "host": "240.0.60.49",
      "asn": "AS???",
      "loss": 0,
      "sent": 2,
      "last": 0.28,
      "avg": 0.29,
      "best": 0.28,
      "worst": 0.29,
      "stdDev": 0.01
    },
    {
      "hop": 3,
      "host": "240.0.60.34",
      "asn": "AS???",
      "loss": 0,
      "sent": 2,
      "last": 0.27,
      "avg": 0.29,
      "best": 0.27,
      "worst": 0.31,
      "stdDev": 0.03
    }
  ]
}

The MTR API can traceroute domain or IP to check the network path.

Endpoint

/mtr

Parameters

Name Type Description
url string The URL to be checked.

Try it yourself

Port Scanner

curl --location --request POST 'https://api.siterelic.com/openport' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/openport",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/openport"

payload = json.dumps({
  "url": "siterelic.com"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/openport")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com"
}';
$request = new Request('POST', 'https://api.siterelic.com/openport', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657886341929,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "test": {
      "id": "ug7odkom06u6d3fksph5952mvd09iyrz"
    }
  },
  "data": [80, 443, 8080]
}

The Port Scanner API checks TCP ports open to communication on a given IP or site. Nmap powers it, and you have multiple options like scanning for top ports, single ports, or port ranges.

By default, it scans for the top 100 ports, but you have an option to change that as below per requirement. Using the top 5000 ports should be 99% effective in most cases. You can refer to Nmap's official docs for port selection and strategies.

Endpoint

/openport

Parameters

Name Type Description
url string The URL to be checked.
topPorts number Number of top ports to be scanned.
portRanges string Only scan specified ports for port ranges.

topPorts supports 50, 100, 500, 1000, and 5000. If you don’t provide the topPorts parameter, 100 will be used as a default option.

portRanges supports different types of input including single port like 22, multiple ports like 22,80,443, and in a range like 80-444.

Ping

curl --location --request POST 'https://api.siterelic.com/ping' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/ping",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/ping"

payload = json.dumps({
  "url": "siterelic.com"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/ping")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com"
}';
$request = new Request('POST', 'https://api.siterelic.com/ping', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125453687,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "test": {
      "id": "fb3a0b4r09vkc3enmh4p5yq3zii2j5u7"
    }
  },
  "data": {
    "requests": 3,
    "loss": 0,
    "latency": 0.885,
    "min": 0.817,
    "max": 0.885,
    "avg": 0.843,
    "stdDev": 0.029,
    "ip": "104.26.10.88"
  }
}

The Ping API ping domain or IP to check if its reachable and provide latency information. API makes three requests to the target endpoint.

Endpoint

/ping

Parameters

Name Type Description
url string The URL to be checked.

Try it yourself

Screenshot

curl --location --request POST 'https://api.siterelic.com/screenshot' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  device: "desktop",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/screenshot",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/screenshot"

payload = json.dumps({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/screenshot")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "device": "desktop",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/screenshot', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125548273,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "test": {
      "id": "qit3lw7b08esp9l3fd1wu42ii2jfrqw6"
    }
  },
  "data": "https://api-assets.siterelic.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png"
}

The Screenshot API grabs a full-page screenshot of a website from a given device and location. This helps in knowing rendering correctness and performance of a website from the perspective of geographically distributed users having different devices.

Endpoint

/screenshot

Parameters

Name Type Description
url string The URL to be checked.
type string File type to be output.
device string Device to be used.
fullPage boolean Take full-page screenshot.
blockAds boolean Block ads.
hideCookie boolean Hide cookie popups.
skipCaptcha boolean Try to bypass captcha.
addTimestamp boolean Add timestamp watermark.
proxyCountry string Proxy county.
page.height number Height of the page.
viewport.width number Width of the viewport.
viewport.height number Height of the viewport.

type parameter supports png, and jpeg strings. If you don’t provide the type parameter, png will be used as a default option.

device parameter supports desktop, mobile, and tablet strings. If you don’t provide the device parameter, desktop will be used as a default option.

page parameter is an object type that supports the height property. If you don't provide the viewport parameter, {"height": 1080} will be used as default.

viewport parameter is an object type that supports the width and height properties. If you don't provide the viewport parameter, {"width": 1920, "height": 1080} will be used as default.

Try it yourself

TLS Scan

curl --location --request POST 'https://api.siterelic.com/tlsscan' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/tlsscan",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/tlsscan"

payload = json.dumps({
  "url": "siterelic.com"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/tlsscan")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com"
})

response = https.request(request)
puts response.read_body

<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com"
}';
$request = new Request('POST', 'https://api.siterelic.com/tlsscan', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125629493,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "test": {
      "id": "40zt4but04y07ccn4pov5fiolzrxbxdg"
    }
  },
  "data": {
    "protocols": {
      "tls10": false,
      "tls11": false,
      "tls12": true,
      "tls13": true
    },
    "certificate": {
      "commonName": "sni.cloudflaressl.com",
      "subjectAltName": "DNS:*.siterelic.com, DNS:sni.cloudflaressl.com, DNS:siterelic.com",
      "issuer": {
        "country": "US",
        "organization": "Cloudflare, Inc.",
        "commonName": "Cloudflare Inc ECC CA-3"
      },
      "expiry": "Jun  6 23:59:59 2023 GMT"
    }
  }
}

The TLS Scan API provides info about the supported TLS versions as well as the deployed certificate info for a given domain.

Endpoint

/tlsscan

Parameters

Name Type Description
url string The URL to be checked.

Try it yourself

Time to First Byte (TTFB)

curl --location --request POST 'https://api.siterelic.com/ttfb' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/ttfb",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/ttfb"

payload = json.dumps({
  "url": "siterelic.com",
  "followRedirect": True
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/ttfb")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "followRedirect": true
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.siterelic.com/ttfb', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125711631,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "irfdgwvw08mvdaqjyxvkp8apgqzxkyjj"
    }
  },
  "data": 156
}

The TTFB API measures how fast a web resource starts loading when connected. It can be thought of as a way to measure response times (in milliseconds), loosely speaking.

Endpoint

/ttfb

Parameters

Name Type Description
url string The URL to be checked.
followRedirect boolean Follow redirection.

Try it yourself

Site Status (Is site up or down?)

curl --location --request POST 'https://api.siterelic.com/up' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "followRedirect": true,
  "proxyCountry": "us"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  followRedirect: true,
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/up",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/up"

payload = json.dumps({
  "url": "siterelic.com",
  "followRedirect": True,
  "proxyCountry": "us"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/up")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "followRedirect": true,
  "proxyCountry": "us"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "followRedirect": true,
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/up', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1657125793379,
  "apiStatus": "success",
  "apiCode": 200,
  "message": "Site is up.",
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://siterelic.com/",
    "test": {
      "id": "fsxm0vyw06ztnvbtllwwvimajytf2s8d"
    }
  },
  "data": {
    "statusCode": 200,
    "reasonPhrase": "OK"
  }
}

The Site Status API provides info about whether the given URL is up or not. Almost exclusively, this API is meant to work with websites. Checking the status of an infrastructure (whose entry point is the given URL) isn't recommended and may provide wrong results.

Endpoint

/up

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.
followRedirect boolean Follow redirection.

Try it yourself

URL Redirection Checker

curl --location --request POST 'https://api.siterelic.com/redirectcheck' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/redirectcheck",
  headers: {
    "x-api-key": "YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/redirectcheck"

payload = json.dumps({
  "url": "siterelic.com",
  "proxyCountry": "us"
})
headers = {
  'x-api-key': 'YOUR-API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/redirectcheck")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = "YOUR-API-KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "proxyCountry": "us"
})

response = https.request(request)
puts response.read_body

<?php
$client = new GuzzleHttp\Client();
$headers = [
  'x-api-key' => 'YOUR-API-KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/redirectcheck', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1661757454309,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "proxyCountry": "United States",
    "test": {
      "id": "667zexrk0aaiabz2rx95b2cxm0khc2s0"
    }
  },
  "data": [
    {
      "url": "http://siterelic.com/",
      "status": 301,
      "headers": [
        {
          "name": "date",
          "value": "Mon, 29 Aug 2022 07:17:31 GMT"
        },
        {
          "name": "location",
          "value": "https://siterelic.com/"
        }
      ]
    },
    {
      "url": "https://siterelic.com/",
      "status": 200,
      "headers": [
        {
          "name": "date",
          "value": "Mon, 29 Aug 2022 07:17:34 GMT"
        },
        {
          "name": "content-type",
          "value": "text/html; charset=UTF-8"
        }
      ]
    }
  ]
}

Check the redirection on a given page with their status code and response headers. It will be handy to troubleshoot how the URL follows the redirection from the multiple locations and what HTTP status codes and response headers are being returned.

Endpoint

/redirectcheck

Parameters

Name Type Description
url string The URL to be checked.
proxyCountry string Proxy county.

Try it yourself

PDF Generator

curl --location --request POST 'https://api.siterelic.com/url2pdf' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "device": "desktop",
  "format": "letter",
  "orientation": "landscape",
  "margin": {"top": 25.4, "bottom": 25.4},
  "scale": 1.5,
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  device: "desktop",
  format: "letter",
  orientation: "landscape",
  margin: {
    top: 25.4,
    bottom: 25.4,
  },
  scale: 1.5,
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/url2pdf",
  headers: {
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/url2pdf"

payload = json.dumps({
  "url": "siterelic.com",
  "device": "desktop",
  "format": "letter",
  "orientation": "landscape",
  "margin": {
    "top": 25.4,
    "bottom": 25.4
  },
  "scale": 1.5,
  "proxyCountry": "us"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/url2pdf")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "device": "desktop",
  "format": "letter",
  "orientation": "landscape",
  "margin": {
    "top": 25.4,
    "bottom": 25.4
  },
  "scale": 1.5,
  "proxyCountry": "us"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "device": "desktop",
  "format": "letter",
  "orientation": "landscape",
  "margin": {
    "top": 25.4,
    "bottom": 25.4
  },
  "scale": 1.5,
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/url2pdf', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1662121034090,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "device": "desktop",
    "format": "letter",
    "orientation": "landscape",
    "margin": {
      "top": 25.4,
      "bottom": 25.4
    },
    "scale": 1.5,
    "test": {
      "id": "v6cu1pky047wrdkyd1xz8n68f9wtb2xs"
    }
  },
  "data": "https://api-assets.siterelic.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf"
}

The PDF Generator API converts any URL to PDF. You can set the file orientation to landscape or portrait, set margins, scale down, and it supports Proxy.

Endpoint

/url2pdf

Parameters

Name Type Description
url string The URL to be checked.
device string Device to be used.
format string Format of the paper.
orientation string Orientation of the paper.
margin object Margins of the paper.
scale number Rendering scale.
hideCookie boolean Hide cookie popups.
skipCaptcha boolean Try to bypass captcha.
addTimestamp boolean Add timestamp watermark.
proxyCountry string Proxy county.

format parameter supports letter, legal, a0, a1, a2, a3, a4, a5, and a6 strings. If you don’t provide the format parameter, a4 will be used as a default option.

orientation parameter supports portrait, and landscape strings. If you don’t provide the orientation parameter, portrait will be used as a default option.

margin parameter is optional, and supports the top, right, bottom, and left properties in millimeter.

scale parameter supports a value between 0 to 2. If you don’t provide the scale parameter, 1 will be used as a default option.

device parameter supports desktop, mobile, and tablet strings. If you don’t provide the device parameter, desktop will be used as a default option.

Try it yourself

Web Scraping

curl --location --request POST 'https://api.siterelic.com/webscraping' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "siterelic.com",
  "device": "desktop",
  "output": "file",
  "blockAds": false,
  "renderJS": false,
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "siterelic.com",
  device: "desktop",
  output: "file",
  blockAds: false,
  renderJS: false,
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.siterelic.com/webscraping",
  headers: {
    "Content-Type": "application/json",
  },
  data: data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
import requests
import json

url = "https://api.siterelic.com/webscraping"

payload = json.dumps({
  "url": "siterelic.com",
  "device": "desktop",
  "output": "file",
  "blockAds": False,
  "renderJS": False,
  "proxyCountry": "us"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://api.siterelic.com/webscraping")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "siterelic.com",
  "device": "desktop",
  "output": "file",
  "blockAds": false,
  "renderJS": false,
  "proxyCountry": "us"
})

response = https.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "siterelic.com",
  "device": "desktop",
  "output": "file",
  "blockAds": false,
  "renderJS": false,
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.siterelic.com/webscraping', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

The above snippet returns JSON response like this:

{
  "timestamp": 1663337686600,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "siterelic.com",
    "device": "desktop",
    "output": "file",
    "blockAds": false,
    "renderJS": false,
    "proxyCountry": "United States",
    "test": {
      "id": "mxqx9v9y0742lap6altwdteqd28t23nq"
    }
  },
  "data": "https://api-assets.siterelic.com/tests/web-scraping/9bulgk075ed9m3vhua5vcrp0.html"
}

Web Scraping API lets you extract data from any web page. You have an option to extract data using a Desktop, Mobile, or Tablet device, and it supports javascript rendering.

To avoid getting blocked, you can also use a proxy. The default option will return the raw HTML content, but you can also output it to an HTML file.

Endpoint

/webscraping

Parameters

Name Type Description
url string The URL to be checked.
device string The device to be used.
output string Format of the output.
blockAds boolean Whether advertisements should be blocked or not.
renderJS boolean Whether JavaScript should be rendered or not.
proxyCountry string Proxy county.

device parameter supports desktop, mobile, and tablet strings. If you don’t provide the device parameter, desktop will be used as a default option.

output parameter supports inline, and file strings. If you don’t provide the output parameter, inline will be used as a default option.

Try it yourself