搜索

Clearbit Logo API

该API提供公司Logo搜索服务,可快速查找企业标识并嵌入到项目中。支持按公司名称、域名等多种方式检索,返回高质量的透明背景Logo图像。

查看官方文档 ↗

接入教程

1. 注册Clearbit账号获取API密钥
2. 通过公司名称或域名构造API请求URL
3. 调用接口获取Logo图像数据
4. 可选择尺寸和格式参数进行定制
5. 将返回的图像URL嵌入到项目中使用

通过域名获取公司Logo

python
import requests

url = 'https://logo.clearbit.com'
domain = 'example.com'
response = requests.get(f'{url}/{domain}')
if response.status_code == 200:
    with open('logo.png', 'wb') as f:
        f.write(response.content)
    print('Logo downloaded successfully')
else:
    print('Logo not found')

使用API密钥验证获取Logo

php
<?php
$api_key = 'YOUR_API_KEY';
$domain = 'example.com';
$url = 'https://logo.clearbit.com/' . urlencode($domain);

$options = [
    'http' => [
        'header' => "Authorization: Bearer $api_key\r\n"
    ]
];

$context = stream_context_create($options);
$image_data = file_get_contents($url, false, $context);

if ($image_data !== false) {
    file_put_contents('company_logo.png', $image_data);
    echo 'Logo saved successfully';
} else {
    echo 'Failed to retrieve logo';
}
?>

在网页中动态加载Logo

javascript
const domain = 'example.com';
const apiKey = 'YOUR_API_KEY';
const logoUrl = `https://logo.clearbit.com/${domain}`;

async function loadCompanyLogo() {
    try {
        const response = await fetch(logoUrl, {
            headers: {
                'Authorization': `Bearer ${apiKey}`
            }
        });
        
        if (response.ok) {
            const logoImg = document.createElement('img');
            logoImg.src = logoUrl;
            logoImg.alt = `${domain} logo`;
            document.getElementById('logo-container').appendChild(logoImg);
        } else {
            console.log('Logo not available');
        }
    } catch (error) {
        console.error('Error loading logo:', error);
    }
}

// Call function when page loads
window.addEventListener('DOMContentLoaded', loadCompanyLogo);

常见问题

该API支持哪些格式的Logo图像?

Clearbit Logo API主要返回PNG格式的图像,支持透明背景,确保在各种背景下都能良好显示。大多数Logo提供多种尺寸选项,可通过URL参数指定所需尺寸。

是否需要API密钥才能使用?

基础查询功能通常无需API密钥即可使用,但高级功能、更高请求频率或商业用途需要注册获取API密钥。建议查阅官方文档了解当前的具体认证要求。

如何提高Logo搜索的准确率?

为提高搜索准确率,建议使用完整的公司域名(如google.com而非google),避免使用缩写。如搜索结果不准确,可尝试使用公司法定名称或品牌名称进行搜索。API也支持通过公司名称直接检索。

相似接口推荐

Amazon Kinesis Firehose

Amazon Kinesis Data Firehose 是一项全托管服务,可将实时流数据传输到 Amazon S3、Amazon OpenSearch Service、Amazon Redshift、Splunk 等多

待确认
MarkerAPI

MarkerAPI提供全球商标搜索服务,允许开发者通过API查询商标注册信息、检查商标可用性,并获取商标法律状态等数据。

待确认
慈善搜索

该API提供非营利慈善机构的数据查询服务,帮助用户快速查找和验证慈善组织信息,支持基于名称、地点和分类的搜索。

待确认
Crossref元数据搜索

Crossref元数据搜索提供学术出版物(如图书和文章)的元数据查询服务。通过该API,用户可以检索包括标题、作者、摘要、出版日期等在内的详细信息。它支持多种搜索参数和过滤条件,便于快速定位所需学术资源。

免费