个人图标云边服务

这是一个用于获取网站图标的云边服务,支持多种获取方式,适用于各种网络环境。

API使用统计

加载中...

使用方法

1. 获取网站图标

基本URL格式: /favicon?domain=example.com

指定大小: /favicon?domain=example.com&size=128

example.com 替换为您想要获取图标的网站域名。

可选参数 size 用于指定图标大小(像素),范围16-512,默认为256。

2. 通用云边

URL格式: /?url=https://example.com/image.png

https://example.com/image.png 替换为您想要获取的URL。

注意: 图标服务会自动尝试多种图标源,包括:

  1. Google的高质量图标服务
  2. 中国大陆可访问的图标服务
  3. 如果以上都失败,会生成一个基于域名首字母的SVG图标

快速示例

代码示例

在HTML中使用

在您的HTML中,可以这样使用:

<img src="https://your-service.workers.dev/favicon?domain=example.com" alt="网站图标">

在JavaScript中使用

在您的JavaScript代码中,可以这样使用:

const domain = 'example.com';
const iconUrl = 'https://your-service.workers.dev/favicon?domain=' + domain;
document.getElementById('icon').src = iconUrl;
×

搜索网站图标

最近搜索