NAV
cURL Node.js Python Ruby PHP

Übersicht

Introduction

Dies ist die offizielle Dokumentation für die Geekflare-REST-API.

Diese APIs bieten zahlreiche Funktionen für wichtige Test- und Überwachungsmethoden für Websites. Beispielsweise sind Website-Leistung, Sicherheit, DNS und SEO-Score einige der Funktionen, die diese APIs bieten.

Getting started

Der Einstieg in die Geekflare-API ist sehr einfach. Sie müssen sich registrieren (keine Kreditkarte erforderlich), um Zugriff auf die kostenlose Stufe von Geekflare zu erhalten.

Sobald Sie einen API-Schlüssel haben, können Sie den erkunden Postboten-Sammlung um APIs zu testen.

Holen Sie sich Ihren API-Schlüssel

API type

Die Geekflare-API ist a REST API. Das bedeutet, dass es über HTTP funktioniert und Daten in akzeptiert und zurückgibt JSON Format.

Rate (usage) limits

Die Geekflare-API erlaubt eine Aufrufrate von 25 API-Aufrufen pro Sekunde im Premium-Plan für jeden Client mit einem gültigen Token.

Proxy county

Viele der Geekflare-APIs Support-Anfrage über Proxy. Falls Sie diese Funktion verwenden müssen, muss der Proxy als bereitgestellt werden proxyCountry Parameters.

Hier ist eine Liste der unterstützten Länder:

Land Code
Vereinigte Staaten us
United Kingdom uk
Frankreich fr
Deutschland de
Kanada ca
India in
China cn
Brasil br
Spanien es
Japan jp

Request

Beglaubigung

Stellen Sie sicher, dass es in Ihrem Header-Wert vorhanden ist, wenn Sie API-Aufrufe tätigen.

x-api-key YOUR-API-KEY

Es erwartet, dass der API-Zugriffsschlüssel in einem aufgerufenen Anforderungsheader vorhanden ist x-api-key.

Basis-URL

Für alle in dieser Dokumentation aufgeführten Endpunkte lautet die Basis-URL https://api.geekflare.com

Response

Die API-Antwort folgt aus Gründen der Klarheit und Konsistenz einigen gängigen Formaten. Abhängig vom Anfragestatus sind die Antwortstrukturen wie unten angegeben.

Bei erfolgreicher Verarbeitung einer Anfrage gibt die API eine Antwort im folgenden Format zurück:

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

Wenn die eingehende Anfrage keine ordnungsgemäße Autorisierung hat, wird die folgende Antwortstruktur zurückgegeben:

{
  "message": "Forbidden"
}

Wenn Sie einen kostenlosen Plan haben und versuchen, auf eine kostenpflichtige API wie Port Scanner zuzugreifen, wird ein Fehler im folgenden Format zurückgegeben:

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

Wenn ein falscher Endpunkt oder ein falscher Anforderungstyp (z. B. POST statt GET) angegeben wird, gibt die API einen Fehler im folgenden Format zurück:

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

API-Endpunkte

Die Geekflare-API besteht aus den folgenden Endpunkten.

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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
    }
  ]
}

Die Broken Link Checker API prüft, ob die Webseite defekte Links enthält.

Endpunkt

/brokenlink

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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
      }
    ]
  }
}

Die API für DNS-Einträge zieht die DNS-Einträge eines bestimmten Domänennamens heraus und zeigt sie an.

Endpunkt

/dnsrecord

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
types string[] Typ(en) von DNS-Einträgen.

types -Parameter unterstützt die folgenden Zeichenfolgen.

Wenn Sie das nicht angeben types Parameter, es werden alle DNS-Einträge angezeigt.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

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

Der DNSSEC-API-Test, ob die Sicherheitserweiterung für die Domäne aktiviert ist.

Endpunkt

/dnssec

Parameter

Name Typ Beschreibung
url string Die zu testende URL.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
    }
  ]
}

Die HTTP-Header-API analysiert die Antwortheader eines bestimmten Endpunkts (oder einer bestimmten Website) und präsentiert die Ausgabe im JSON-Format. Dies kann bei Aktivitäten wie Überwachung, Datenerfassung usw. nützlich sein.

Endpunkt

/httpheader

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"]
  }
}

Während sich die HTTP-Spezifikation ständig weiterentwickelt, können Webserver (mangels Konfiguration oder Fähigkeiten) nicht immer mithalten. Diese API testet einen HTTP-Endpunkt und meldet, welche HTTP-Versionen derzeit von diesem Endpunkt unterstützt werden.

Endpunkt

/httpprotocol

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
}

Die Lighthouse-API bietet Zugriff auf das Google Lighthouse-Projekt als API. Lighthouse ist ein Audit-Tool für Websites, um sie hinsichtlich Leistung, Zugänglichkeit, SEO usw. zu bewerten und gleichzeitig konkrete Verbesserungsvorschläge zu machen.

Endpunkt

/lighthouse

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
device string Das zu verwendende Gerät.
parameters string[] Leuchtturmparameter.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

device Parameter unterstützt desktop, mobile und tablet Saiten. Wenn Sie den Geräteparameter nicht angeben, desktop wird als Standardoption verwendet.

Fortgeschrittener Modus

Die Lighthouse-API wird auch in einem erweiterten Modus ausgeführt und akzeptiert einige der Anpassungsparameter, die von Googles Lighthouse-Engine erkannt werden:

Das --output Parameter steuert das Ausgabeformat. Es ist eingestellt json standardmäßig, kann aber sein html or csv .

Um diese Parameter zu verwenden, übergeben Sie sie in aparameters JSON-Array im Hauptteil der Eingabe. Sie können sich darauf beziehen Anleitung zum Ausführen der Lighthouse-API im erweiterten Modus.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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
  }
}

Die Ladezeit-API stellt die Gesamtzeit (in Millisekunden) bereit, die für den Abschluss einer HTTP-Antwort benötigt wird. Dies wird häufig verwendet, um die Website-Leistung zu messen und umfasst die Zeit für die DNS-Suche, das Warten auf die Antwort des Servers, gesendete Daten, empfangene Daten usw.

Standardmäßig erfolgt die Verbindung von Servern in den USA. Um jedoch die Ladezeit aus anderen Ländern wie Frankreich, Großbritannien, China, Indien usw. zu messen, können Sie einen unten genannten Proxy-Parameter verwenden.

Endpunkt

/loadtime

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

Meta Scraping

curl --location -g --request POST 'https://api.geekflare.com/metascraping' \
  --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/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.geekflare.com/metascraping"

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/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": "geekflare.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": "geekflare.com",
  "device": "desktop",
  "proxyCountry": "us"
}';
$request = new Request('POST', 'https://api.geekflare.com/metascraping', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "timestamp": 1663336951774,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "geekflare.com",
    "device": "desktop",
    "proxyCountry": "United States",
    "test": {
      "id": "ajfenqnl05l9dd8vh9zb2ffprr5g9k7o"
    }
  },
  "data": {
    "url": "https://geekflare.com/",
    "date": "Thu, 26 Jan 2023 18:58:40 GMT",
    "lang": "en-us",
    "title": "Geekflare - Your trusted source for Technology Resources",
    "description": "Geekflare 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://geekflare.com/wp-content/uploads/2020/01/Geekflare-logo.png",
    "image": "https://geekflare.com/wp-content/uploads/2019/06/Geekflare-social.png",
    "author": "Chandan Kumar",
    "publisher": "Geekflare",
    "feed": "https://geekflare.com/feed/"
  }
}

Mit der Meta Scraping API können Sie Metadaten von jeder Webseite extrahieren. Sie können Daten von einer Website mit einem Desktop-, Mobil- oder Tablet-Gerät extrahieren.

Um nicht blockiert zu werden, können Sie auch einen Proxy verwenden.

Es kann die folgenden Metadaten extrahieren:

Endpunkt

/metascraping

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
device string Das zu verwendende Gerät.
proxyCountry string Proxy-Landkreis.

device Parameter unterstützt desktop, mobile und tablet Saiten. Wenn Sie den Geräteparameter nicht angeben, desktop wird als Standardoption verwendet.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
  ]
}

Die Mixed Content API prüft, ob eine bestimmte Website ein oder mehrere statische Assets als Mixed Content lädt. Das Problem gemischter Inhalte entsteht, wenn eine Website ihre erste Antwort überlädt https lädt dann aber eine oder mehrere seiner Ressourcen über http. Dies ist mehr als eine Frage der Hygiene, denn das Mischen von nicht sicheren Inhalten mit sicheren Inhalten ist ein schwerwiegender Sicherheitsfehler und kann zu On-Path-Angriffen und mehr führen.

Endpunkt

/mixedcontent

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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
    }
  ]
}

Die MTR-API kann Domain oder IP nachverfolgen, um den Netzwerkpfad zu überprüfen.

Endpunkt

/mtr

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

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

Die Port-Scanner-API überprüft TCP-Ports, die für die Kommunikation auf einer bestimmten IP oder Site geöffnet sind. Nmap treibt es an, und Sie haben mehrere Optionen wie das Scannen nach Top-Ports, einzelnen Ports oder Portbereichen.

Standardmäßig scannt es nach den 100 wichtigsten Ports, aber Sie haben die Möglichkeit, dies je nach Anforderung wie unten zu ändern. Die Nutzung der Top 5000 Ports sollte in den meisten Fällen zu 99 % effektiv sein. Sie können sich darauf beziehen Nmaps offizielle Dokumentation für Portauswahl und Strategien.

Endpunkt

/openport

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
topPorts number Anzahl der zu scannenden oberen Ports.
portRanges string Scannen Sie nur bestimmte Ports nach Portbereichen.

topPorts unterstützt 50, 100, 500, 1000 und 5000. Wenn Sie den topPorts-Parameter nicht angeben, 100 wird als Standardoption verwendet.

portRanges unterstützt verschiedene Arten von Eingaben, einschließlich Single-Port-like 22, mehrere Ports wie 22,80,443, und in einem Bereich wie 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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
  }
}

Die Ping-API pingt die Domäne oder IP, um zu überprüfen, ob sie erreichbar ist, und um Latenzinformationen bereitzustellen. Die API stellt drei Anforderungen an den Zielendpunkt.

Endpunkt

/ping

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
}

Die Screenshot-API erfasst einen ganzseitigen Screenshot einer Website von einem bestimmten Gerät und Standort. Dies hilft dabei, die Korrektheit und Leistung einer Website aus der Perspektive geografisch verteilter Benutzer mit unterschiedlichen Geräten zu kennen.

Endpunkt

/screenshot

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
device string Zu verwendendes Gerät.
fullPage boolean Machen Sie einen ganzseitigen Screenshot.
blockAds boolean Werbung blockieren.
hideCookie boolean Cookie-Popups ausblenden.
skipCaptcha boolean Versuchen Sie, Captcha zu umgehen.
addTimestamp boolean Zeitstempel-Wasserzeichen hinzufügen.
proxyCountry string Proxy-Landkreis.

device Parameter unterstützt desktop, mobile und tablet Saiten. Wenn Sie den Geräteparameter nicht angeben, desktop wird als Standardoption verwendet.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
    }
  }
}

Die TLS-Scan-API bietet Informationen zu den unterstützten TLS-Versionen sowie Informationen zu bereitgestellten Zertifikaten für eine bestimmte Domäne.

Endpunkt

/tlsscan

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

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

Die TTFB-API misst, wie schnell eine Webressource zu laden beginnt, wenn sie verbunden ist. Man kann es sich grob gesagt als eine Möglichkeit vorstellen, Reaktionszeiten (in Millisekunden) zu messen.

Endpunkt

/ttfb

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
  }
}

Die Site-Status-API liefert Informationen darüber, ob die angegebene URL aktiv ist oder nicht. Diese API ist fast ausschließlich für die Arbeit mit Websites gedacht. Das Überprüfen des Status einer Infrastruktur (deren Einstiegspunkt die angegebene URL ist) wird nicht empfohlen und kann falsche Ergebnisse liefern.

Endpunkt

/up

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.
followRedirect boolean Weiterleitung folgen.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
        }
      ]
    }
  ]
}

Überprüfen Sie die Weiterleitung auf einer bestimmten Seite mit ihrem Statuscode und den Antwortheadern. Es ist praktisch, Fehler zu beheben, wie die URL der Umleitung von den mehreren Standorten folgt und welche HTTP-Statuscodes und Antwortheader zurückgegeben werden.

Endpunkt

/redirectcheck

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
proxyCountry string Proxy-Landkreis.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
}

Die PDF Generator API wandelt jede URL in PDF um. Sie können die Dateiausrichtung auf Quer- oder Hochformat einstellen, Ränder festlegen, verkleinern und Proxy unterstützen.

Endpunkt

/url2pdf

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
device string Zu verwendendes Gerät.
format string Format des Papiers.
orientation string Ausrichtung des Papiers.
margin object Ränder des Papiers.
scale number Rendering-Skala.
hideCookie boolean Cookie-Popups ausblenden.
skipCaptcha boolean Versuchen Sie, Captcha zu umgehen.
addTimestamp boolean Zeitstempel-Wasserzeichen hinzufügen.
proxyCountry string Proxy-Landkreis.

format Parameter unterstützt letter, legal, a0, a1, a2, a3, a4, a5 und a6 Saiten. Wenn Sie den Formatparameter nicht angeben, a4 wird als Standardoption verwendet.

orientation Parameter unterstützt portrait und landscape Saiten. Wenn Sie den Ausrichtungsparameter nicht angeben, portrait wird als Standardoption verwendet.

margin Der Parameter ist optional und unterstützt die top, right, bottom und left Eigenschaften in Millimeter.

scale Parameter unterstützt einen Wert zwischen 0 zu 2. Wenn Sie den Skalierungsparameter nicht angeben, 1 wird als Standardoption verwendet.

device Parameter unterstützt desktop, mobile und tablet Saiten. Wenn Sie den Geräteparameter nicht angeben, desktop wird als Standardoption verwendet.

Versuch es selber

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();

Das obige Snippet gibt die JSON-Antwort wie folgt zurück:

{
  "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"
}

Mit der Web-Scraping-API können Sie Daten von jeder Webseite extrahieren. Sie haben die Möglichkeit, Daten mit einem Desktop-, Mobil- oder Tablet-Gerät zu extrahieren, und es unterstützt Javascript-Rendering.

Um nicht blockiert zu werden, können Sie auch einen Proxy verwenden. Die Standardoption gibt den rohen HTML-Inhalt zurück, aber Sie können ihn auch in eine HTML-Datei ausgeben.

Endpunkt

/webscraping

Parameter

Name Typ Beschreibung
url string Die zu überprüfende URL.
device string Das zu verwendende Gerät.
output string Format der Ausgabe.
blockAds boolean Ob Werbung blockiert werden soll oder nicht.
renderJS boolean Ob JavaScript gerendert werden soll oder nicht.
proxyCountry string Proxy-Landkreis.

device Parameter unterstützt desktop, mobile und tablet Saiten. Wenn Sie den Geräteparameter nicht angeben, desktop wird als Standardoption verwendet.

output Parameter unterstützt inline und file Saiten. Wenn Sie den Geräteparameter nicht angeben, inline wird als Standardoption verwendet.

Versuch es selber