其他

URLScan.io

URLScan.io是一个用于扫描和分析URL的API服务,它能够检测网页内容、识别威胁并提供详细的扫描报告,帮助用户评估网站安全性。

查看官方文档 ↗

接入教程

1. 访问URLScan.io官网注册账号并获取API密钥
2. 使用API密钥在请求头中进行身份验证
3. 向扫描端点提交需要分析的URL
4. 等待扫描完成并获取返回的扫描结果
5. 解析JSON格式的报告数据并提取所需信息

使用Python提交URL扫描请求

python
import requests
import json

url = 'https://api.urlscan.io/v1/scan/'
headers = {
    'API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}
payload = {
    'url': 'https://example.com',
    'visibility': 'public'
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
if response.status_code == 200:
    result = response.json()
    print(f'扫描提交成功: {result["uuid"]}')
else:
    print(f'请求失败: {response.status_code}')
    print(response.text)

使用PHP获取扫描结果

php
<?php
$apiKey = 'YOUR_API_KEY';
$scanId = 'scan_uuid_placeholder';
$url = "https://api.urlscan.io/v1/result/$scanId";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'API-Key: ' . $apiKey
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $data = json_decode($response, true);
    echo '扫描状态: ' . $data['verdicts']['overall']['malicious'] ? '恶意' : '安全';
} else {
    echo '获取结果失败,HTTP代码: ' . $httpCode;
}
?>

使用JavaScript搜索历史扫描记录

javascript
const apiKey = 'YOUR_API_KEY';
const query = 'example.com';
const url = `https://api.urlscan.io/v1/search/?q=${encodeURIComponent(query)}`;

fetch(url, {
    method: 'GET',
    headers: {
        'API-Key': apiKey
    }
})
.then(response => {
    if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
    }
    return response.json();
})
.then(data => {
    console.log(`找到 ${data.results.length} 条记录`);
    data.results.forEach(result => {
        console.log(`URL: ${result.page.url}, 扫描时间: ${result.task.time}`);
    });
})
.catch(error => {
    console.error('请求失败:', error);
});

常见问题

URLScan.io API是否需要API密钥?

是的,大部分API端点需要有效的API密钥进行身份验证。您可以在URLScan.io官网注册账户后获取API密钥。免费套餐通常提供有限的请求次数。

扫描一个URL需要多长时间?

扫描时间取决于目标网站的复杂性和当前队列负载,通常需要30秒到2分钟。提交扫描请求后会返回一个任务ID,您可以使用该ID轮询获取扫描结果。

API支持哪些扫描可见性设置?

URLScan.io提供三种可见性选项:'public'(公开,结果对所有人可见)、'unlisted'(未列出,仅通过直接链接可访问)和'private'(私有,仅账户持有者可见)。根据您的需求选择合适的设置。

相似接口推荐

AWS SSO Identity Store

AWS SSO Identity Store是AWS IAM Identity Center(原AWS单点登录)使用的身份存储服务,提供一个统一的位置检索所有身份信息(用户和群组)。该服务简化了身份管理流程,帮助集中管理

待确认
Amazon Honeycode

Amazon Honeycode是一项全托管服务,让您无需编程即可快速为团队构建移动和Web应用。可用于管理项目、客户、运营、审批、资源乃至团队协作等各类事务。

待确认
AWS Glue

AWS Glue 是一项完全托管的提取、转换和加载(ETL)服务,可简化数据准备和集成工作。它自动发现、编目数据,并支持在数据湖和数据仓库之间进行ETL操作。

待确认
亚马逊Glacier

亚马逊S3 Glacier(简称Glacier)是一款针对“冷数据”的存储解决方案。这项超低成本的存储服务为数据备份和归档提供安全、持久且易于使用的存储方案。用户可经济高效地存储数据数月、数年甚至数十年。

待确认