The URL Scanner API performs real-time scans of links to identify suspicious URLs. It accurately detects phishing links, malware-infected URLs, viruses, parked domains, and other dubious URLs, assigning real-time risk scores. With industry-leading phishing detection and domain reputation assessments, it offers enhanced insights for more precise decision-making.
You need to use the HTTP POST method, sending your data in the form of a JSON object within the body of the request.
Field | Type | Description |
---|---|---|
apikey | String | Your unique API key that authenticates requests to our services. |
url | String | The URL you want to check |
You can use various tools or libraries to make this POST request. Here’s how you might typically do it using curl, a command-line tool:
curl -X POST 'https://inspector.gridinsoft.com/api/v1/domain/check' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_PRIVATE_APIKEY",
"url": "https://sample-domain.com/path"
}'
Field | Type | Description |
---|---|---|
url | String | The URL that was analyzed. |
title | String | The title of the webpage, as retrieved by the scan. |
description | String | A brief description of the webpage, as retrieved by the scan. |
tags | Array of Strings | Categories or tags that describe the content or nature of the URL based on the analysis. This includes information related to risk levels, content type, and other relevant metadata. |
html | String | The content of the page for the analyzed URL. Available for paid users only. |
Using one of these samples is the easiest way to start using our API.
import requests
def scan_url(api_key, url):
headers = {'Content-Type': 'application/json'}
data = {'apikey': api_key, 'url': url}
try:
response = requests.post("https://inspector.gridinsoft.com/api/v1/url/scan", json=data, headers=headers)
response.raise_for_status() # Check for HTTP request errors
return response.json() # Return the JSON response
except requests.RequestException as e:
print(f"Error: {str(e)}") # Print error message if something goes wrong
def main():
api_key = "YOUR_PRIVATE_APIKEY" # Your actual API key
url = "https://example.com/path" # The URL you want to scan
# Call scan_url function and print the result
result = scan_url(api_key, url)
if result:
print("URL Scan Result:", result)
if __name__ == "__main__":
main()
function Scan-Url {
param(
[string]$apiKey,
[string]$url,
[string]$apiUrl = 'https://inspector.gridinsoft.com/api/v1/url/scan'
)
$body = @{
apikey = $apiKey
url = $url
} | ConvertTo-Json
try {
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $body -ContentType 'application/json'
Write-Output "URL Scan Result: $($response | ConvertTo-Json -Depth 10)"
} catch {
Write-Error "Error: $_"
}
}
# Example usage
Scan-Url -apiKey 'YOUR_PRIVATE_APIKEY' -url 'https://example.com/path'
async function scanUrl() {
const apiKey = "YOUR_PRIVATE_APIKEY"; // Your API key
const urlToScan = "https://example.com/path"; // The URL you want to scan
const apiUrl = "https://inspector.gridinsoft.com/api/v1/url/scan";
try {
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ apikey: apiKey, url: urlToScan })
});
const result = await response.json();
console.log("URL Scan Result:", result);
} catch (error) {
console.error("Error:", error);
}
}
scanUrl(); // Call the function to scan the URL
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
fun scanUrl(apiKey: String, urlToScan: String) {
val client = OkHttpClient()
val mediaType = "application/json; charset=utf-8".toMediaType()
val body = """
{
"apikey": "$apiKey",
"url": "$urlToScan"
}
""".trimIndent().toRequestBody(mediaType)
val request = Request.Builder()
.url("https://inspector.gridinsoft.com/api/v1/url/scan") // Replace with your actual API endpoint
.post(body)
.build()
try {
val response: Response = client.newCall(request).execute()
if (response.isSuccessful) {
val responseString = response.body?.string()
println("URL Scan Result: $responseString")
} else {
println("Failed to scan URL. Status code: ${response.code}")
}
} catch (e: Exception) {
println("Error during URL scan: ${e.message}")
}
}
fun main() {
val apiKey = "YOUR_PRIVATE_APIKEY" // Replace with your actual API key
val urlToScan = "https://example.com/path" // The URL you want to scan
scanUrl(apiKey, urlToScan)
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "YOUR_PRIVATE_APIKEY" // Your actual API key
url := "https://example.com/path" // The URL you want to scan
endpoint := "https://inspector.gridinsoft.com/api/v1/url/scan"
data := map[string]string{
"apikey": apiKey,
"url": url,
}
jsonData, _ := json.Marshal(data)
resp, _ := http.Post(endpoint, "application/json", bytes.NewBuffer(jsonData))
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println("Response:", string(body))
}
#!/bin/bash
url_to_scan="https://example.com/path" # The URL you want to scan
# Making a POST request using curl
response=$(curl -s -X POST "https://inspector.gridinsoft.com/api/v1/url/scan" \
-H "Content-Type: application/json" \
-d "{\"apikey\": \"YOUR_PRIVATE_APIKEY\", \"url\": \"$url_to_scan\"}")
# Check for successful curl execution
if [ $? -eq 0 ]; then
echo "URL Scan Result:"
echo "$response"
else
echo "Error: Failed to connect to the API"
fi
Ruby's standard library includes `net/http`, which is suitable for making HTTP requests.
require 'net/http'
require 'uri'
require 'json'
def scan_url(api_key, url)
api_url = URI.parse('https://inspector.gridinsoft.com/api/v1/url/scan')
http = Net::HTTP.new(api_url.host, api_url.port)
http.use_ssl = true if api_url.scheme == 'https'
request = Net::HTTP::Post.new(api_url, 'Content-Type' => 'application/json')
request.body = { apikey: api_key, url: url }.to_json
begin
response = http.request(request)
result = JSON.parse(response.body)
puts "URL Scan Result: #{result}"
rescue StandardError => e
puts "Error: #{e.message}"
end
end
# Example usage
scan_url('YOUR_PRIVATE_APIKEY', 'https://example.com/path')
function scanUrl($apiKey, $url) {
$apiUrl = 'https://inspector.gridinsoft.com/api/v1/url/scan'; // Replace with your actual API endpoint
$postData = json_encode(['apikey' => $apiKey, 'url' => $url]);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
]);
$response = curl_exec($ch);
if (!$response) {
echo 'CURL error: ' . curl_error($ch);
} else {
echo "URL Scan Result: " . $response;
}
curl_close($ch);
}
// Example usage
scanUrl('YOUR_PRIVATE_APIKEY', 'https://example.com/path');
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
public class Program
{
public static async Task Main()
{
string apiUrl = "https://inspector.gridinsoft.com/api/v1/url/scan";
string apiKey = "YOUR_PRIVATE_APIKEY";
string urlToScan = "https://example.com";
using var client = new HttpClient();
var data = $"{ {\"apikey\": \"{apiKey}\", \"url\": \"{urlToScan}\"} }";
var content = new StringContent(data, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync(apiUrl, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response: " + result);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
#include <iostream>
#include <cpr/cpr.h>
int main() {
std::string api_key = "YOUR_PRIVATE_APIKEY"; // Your actual API key
std::string url_to_scan = "https://example.com/path"; // URL to scan
std::string api_endpoint = "https://inspector.gridinsoft.com/api/v1/url/scan"; // API endpoint
// Create JSON payload
std::string json_payload = "{\"apikey\": \"" + api_key + "\", \"url\": \"" + url_to_scan + "\"}";
// Make POST request
cpr::Response r = cpr::Post(cpr::Url{api_endpoint},
cpr::HeaderContent-Type,
cpr::Body{json_payload});
// Check response status
if (r.status_code == 200) { // HTTP OK
std::cout << "URL Scan Result:" << std::endl;
std::cout << r.text << std::endl; // Output the response text
} else {
std::cout << "Failed to make request or server error occurred." << std::endl;
std::cout << "Status code: " << r.status_code << std::endl;
std::cout << "Error: " << r.error.message << std::endl; // Output any error messages
}
return 0;
}
You need to install the CPR library. If you are using vcpkg (a C++ package manager), you can install CPR with the following command:
vcpkg install cpr
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) {
String apiKey = "YOUR_PRIVATE_APIKEY"; // Your actual API key
String urlToScan = "https://example.com/path"; // The URL you want to scan
String apiUrl = "https://inspector.gridinsoft.com/api/v1/url/scan";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(apiUrl))
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString("{\"apikey\":\"" + apiKey + "\", \"url\":\"" + urlToScan + "\"}"))
.build();
try {
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
System.out.println("Response: " + response.body());
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}
use reqwest::{Client, Error};
use serde_json::{json, Value};
async fn scan_url(api_key: &str, url: &str) -> Result<Value, Error> {
let client = Client::new();
let api_url = "https://inspector.gridinsoft.com/api/v1/url/scan";
let res = client.post(api_url)
.json(&json!({
"apikey": api_key,
"url": url
}))
.send()
.await?
.json::<Value>()
.await;
res
}
#[tokio::main]
async fn main() {
let api_key = "YOUR_PRIVATE_APIKEY";
let url = "https://example.com/path";
match scan_url(api_key, url).await {
Ok(response) => println!("URL Scan Result: {:?}", response),
Err(e) => println!("Error: {}", e),
}
}
import Foundation
func scanURL(apiKey: String, urlToScan: String) {
guard let apiUrl = URL(string: "https://inspector.gridinsoft.com/api/v1/url/scan") else { return }
var request = URLRequest(url: apiUrl)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let bodyData = ["apikey": apiKey, "url": urlToScan]
do {
request.httpBody = try JSONSerialization.data(withJSONObject: bodyData, options: [])
} catch {
print("Error: Unable to encode JSON")
return
}
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil else {
print("Error: \(error?.localizedDescription ?? "No data")")
return
}
if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 {
if let result = String(data: data, encoding: .utf8) {
print("Response: \(result)")
}
} else {
print("HTTP Error: \(response as? HTTPURLResponse)?.statusCode ?? 0)")
}
}
task.resume()
}
// Example usage
let apiKey = "YOUR_PRIVATE_APIKEY"
let urlToScan = "https://example.com/path"
scanURL(apiKey: apiKey, urlToScan: urlToScan)
You have reached the limit of your current plan. Please subscribe to the Pro plan to continue using the service.
Designed for small to medium enterprises requiring regular API access with standard support.
Suited for businesses needing high-volume access and additional API capabilities, along with priority support.
For large organizations requiring full-scale API integration with the highest level of support and customization.
If you would like to discuss custom arrangements, please do not hesitate to contact us. We are always ready to help you find the perfect solution that meets your needs.