NAV
cURL Node.js Python Ruby PHP

Overview

Introduction

This is the official documentation for the Geekflare 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 Geekflare API is very easy. You'd need to register (no credit card required) to gain access to the free tier of Geekflare.

Get your API key

API type

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

Rate (usage) limits

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

Proxy county

Many of the Geekflare 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.geekflare.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 Geekflare API is comprised of the following endpoints.

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

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/brokenlink"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.com/",
    "test": {
      "id": "wf0b7yrn05br8xtwple7ngj7hhxzvl2e"
    }
  },
  "data": [
    {
      "link": "https://geekflare.com/",
      "status": 200
    },
    {
      "link": "https://geekflare.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.geekflare.com/dnsrecord' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "types": ["A", "MX"]
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  types: ["A", "MX"],
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/dnsrecord"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "types": [
    "A",
    "MX"
  ]
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.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.geekflare.com/dnssec' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/dnssec"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.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.geekflare.com/httpheader' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/httpheader"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.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.geekflare.com/httpprotocol' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/httpprotocol"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.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.geekflare.com/lighthouse' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": true,
  "parameters": ["--only-categories=seo", "--output=csv"]
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  device: "desktop",
  proxyCountry: "us",
  followRedirect: true,
  parameters: ["--only-categories=seo", "--output=csv"],
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/lighthouse"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us",
  "followRedirect": true,
  "parameters": [
    "--only-categories=seo",
    "--output=csv"
  ]
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.com/",
    "test": {
      "id": "3zniwkh5067adrro1llpqstdwbtei1va"
    }
  },
  "data": "https://api-assets.geekflare.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.geekflare.com/loadtime' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/loadtime"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.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 '{{base_url}}/public/metascraping' \
  --header 'Authorization: Bearer {{token}}' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  device: "desktop",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "{{base_url}}/public/metascraping",
  headers: {
    "Authorization": "Bearer {{token}}",
    "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 = "{{base_url}}/public/metascraping"

payload = json.dumps({
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
})
headers = {
  'Authorization': 'Bearer {{token}}',
  '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("{{base_url}}/public/metascraping")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{token}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
})

response = http.request(request)
puts response.read_body
<?php
$client = new GuzzleHttp\Client();
$headers = [
  'Authorization' => 'Bearer {{token}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
}';
$request = new Request('POST', '{{base_url}}/public/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": "geekflare.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "test": {
      "id": "ajfenqnl05l9dd8vh9zb2ffprr5g9k7o"
    }
  },
  "data": {
    "author": null,
    "date": "2022-06-07T14:04:26.000Z",
    "description": "Geekflare produces high-quality technology & finance articles, makes tools, and APIs to help businesses and people grow.",
    "image": "https://geekflare.com/wp-content/uploads/2019/06/Geekflare-social.png",
    "logo": "https://logo.clearbit.com/geekflare.com",
    "publisher": "Geekflare",
    "title": "Home",
    "url": "https://geekflare.com/",
    "lang": "en"
  }
}

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.geekflare.com/mixedcontent' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  proxyCountry: "us",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/mixedcontent"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "proxyCountry": "us",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.com/",
    "test": {
      "id": "l8r16s8k0agfp31wt5i9y7bfzgfpf4ls"
    }
  },
  "data": [
    "https://geekflare.com/",
    "https://geekflare.com/wp-content/themes/geekflare/dist/site.css",
    "https://geekflare.com/wp-content/themes/geekflare/custom/custom.css",
    "https://geekflare.com/wp-content/themes/geekflare/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.geekflare.com/mtr' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/mtr"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.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.geekflare.com/openport' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/openport"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.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.geekflare.com/ping' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/ping"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.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.geekflare.com/screenshot' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  device: "desktop",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/screenshot"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "test": {
      "id": "qit3lw7b08esp9l3fd1wu42ii2jfrqw6"
    }
  },
  "data": "https://api-assets.geekflare.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.
device string 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

TLS Scan

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

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/tlsscan"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "test": {
      "id": "40zt4but04y07ccn4pov5fiolzrxbxdg"
    }
  },
  "data": {
    "protocols": {
      "tls10": false,
      "tls11": false,
      "tls12": true,
      "tls13": true
    },
    "certificate": {
      "commonName": "sni.cloudflaressl.com",
      "subjectAltName": "DNS:*.geekflare.com, DNS:sni.cloudflaressl.com, DNS:geekflare.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.geekflare.com/ttfb' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "followRedirect": true
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  followRedirect: true,
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/ttfb"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "followRedirect": true
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.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.geekflare.com/up' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "followRedirect": true,
  "proxyCountry": "us"
}'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  followRedirect: true,
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/up"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "followRedirect": true,
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "followRedirect": true,
    "redirectedURL": "https://geekflare.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.geekflare.com/redirectcheck' \
  --header 'x-api-key: YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/redirectcheck"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "proxyCountry": "United States",
    "test": {
      "id": "667zexrk0aaiabz2rx95b2cxm0khc2s0"
    }
  },
  "data": [
    {
      "url": "http://geekflare.com/",
      "status": 301,
      "headers": [
        {
          "name": "date",
          "value": "Mon, 29 Aug 2022 07:17:31 GMT"
        },
        {
          "name": "location",
          "value": "https://geekflare.com/"
        }
      ]
    },
    {
      "url": "https://geekflare.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.geekflare.com/url2pdf' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.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: "geekflare.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.geekflare.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.geekflare.com/url2pdf"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.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.geekflare.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": "geekflare.com",
    "device": "desktop",
    "format": "letter",
    "orientation": "landscape",
    "margin": {
      "top": 25.4,
      "bottom": 25.4
    },
    "scale": 1.5,
    "test": {
      "id": "v6cu1pky047wrdkyd1xz8n68f9wtb2xs"
    }
  },
  "data": "https://api-assets.geekflare.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.
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.geekflare.com/webscraping' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "url": "geekflare.com",
  "device": "desktop",
  "output": "file",
  "blockAds": false,
  "renderJS": false,
  "proxyCountry": "us"
}
'
var axios = require("axios");
var data = JSON.stringify({
  url: "geekflare.com",
  device: "desktop",
  output: "file",
  blockAds: false,
  renderJS: false,
  proxyCountry: "us",
});

var config = {
  method: "post",
  url: "https://api.geekflare.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.geekflare.com/webscraping"

payload = json.dumps({
  "url": "geekflare.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.geekflare.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": "geekflare.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": "geekflare.com",
  "device": "desktop",
  "output": "file",
  "blockAds": false,
  "renderJS": false,
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.geekflare.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": "geekflare.com",
    "device": "desktop",
    "output": "file",
    "blockAds": false,
    "renderJS": false,
    "proxyCountry": "United States",
    "test": {
      "id": "mxqx9v9y0742lap6altwdteqd28t23nq"
    }
  },
  "data": "https://api-assets.geekflare.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 device parameter, inline will be used as a default option.

Try it yourself