> For the complete documentation index see https://domscan.net/llms.txt. Markdown versions of every docs page are available by appending .md to the page URL.

Source: https://domscan.net/zh/docs/products/logo-image

# 徽标图片 API API 参考

为任意域名获取公司徽标，以 PNG 图片形式返回，可嵌入、缓存和长期保存。 通过本参考选择合适的端点，并准确了解它返回的内容。

[查看产品页](https://domscan.net/zh/logo-api)

## 操作

GET `/v1/logo/:domain` [查看 API 参考](https://domscan.net/zh/docs/products/logo-image#getLogoImage)

## GET `/v1/logo/:domain`

操作: `getLogoImage`
积分和身份验证: 1
需要身份验证

GET /v1/logo/:domain 积分: 1

#### 查询参数

| 参数 | 类型 | 必需 |
| --- | --- | --- |
| domain | string | 必需 |
| size | integer 默认值 `128` | 可选 |
| retina | boolean 默认值 `false` | 可选 |
| greyscale | boolean 默认值 `false` | 可选 |
| theme | string 允许的值 `light`, `dark` | 可选 |
| fallback | string 允许的值 `404`, `monogram` 默认值 `404` | 可选 |
| format | string 允许的值 `png` 默认值 `png` | 可选 |
| variant | string 允许的值 `square`, `wide` 默认值 `square` | 可选 |
| v | string | 可选 |
| token | string | 可选 |

#### 响应字段

| 字段 | 类型 |
| --- | --- |
| `body` | image/png |
| `X-Credits-Charged` | string |
| `X-Credits-Remaining` | string |
| `X-RateLimit-Limit` | string |
| `X-RateLimit-Remaining` | string |
| `X-RateLimit-Reset` | string |
| `Cache-Control` | string |
| `ETag` | string |
| `Last-Modified` | string |
| `X-Logo-Status` | string |
| `X-Logo-Source` | string |
| `X-Logo-Verification` | string |
| `X-Logo-Source-Format` | string |
| `X-Logo-Native-Size` | string |
| `X-Logo-Theme-Adjusted` | string |
| `X-Logo-Variant` | string |
| `X-Logo-Lookup` | string |
| `X-Cache` | string |
| `Cloudflare-CDN-Cache-Control` | string |
| `X-Cache-Age` | string |

#### 请求示例

```bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/logo/example.com?size=128&retina=false&greyscale=false&theme=light&fallback=404&format=png&variant=square&v=example&token=example"
```

```javascript
const response = await fetch("https://domscan.net/v1/logo/example.com?size=128&retina=false&greyscale=false&theme=light&fallback=404&format=png&variant=square&v=example&token=example", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
```

```python
import os
import requests

response = requests.get(
    "https://domscan.net/v1/logo/example.com?size=128&retina=false&greyscale=false&theme=light&fallback=404&format=png&variant=square&v=example&token=example",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/logo/example.com?size=128&retina=false&greyscale=false&theme=light&fallback=404&format=png&variant=square&v=example&token=example", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	data, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status, string(data))
}
```

```ruby
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/logo/example.com?size=128&retina=false&greyscale=false&theme=light&fallback=404&format=png&variant=square&v=example&token=example")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
puts JSON.pretty_generate(JSON.parse(response.body))
```

#### 响应示例

```text
HTTP/2 200
content-type: image/png
x-credits-charged: ...
x-credits-remaining: ...
x-ratelimit-limit: ...
x-ratelimit-remaining: ...
x-ratelimit-reset: ...
cache-control: ...
etag: ...
last-modified: ...
x-logo-status: found
x-logo-source: bimi
x-logo-verification: decoded
x-logo-source-format: ...
x-logo-native-size: ...
x-logo-theme-adjusted: tile
x-logo-variant: wide
x-logo-lookup: ...
x-cache: HIT
cloudflare-cdn-cache-control: ...
x-cache-age: ...
```

#### HTTP 状态码

- `200` 成功
- `304` HTTP 304
- `400` 请求错误
- `401` 未授权
- `402` 需要付款
- `403` 禁止访问
- `404` 未找到
- `429` 请求过多

## 参考资源

[OpenAPI 3.0](https://domscan.net/v1/openapi.json)
[Postman](https://domscan.net/v1/postman.json)
[MCP](https://domscan.net/zh/mcp-domain-checker)
