開放介面
開放 API
品牌後設資料、向量原始碼與柵格圖均可直接讀取。介面全部為只讀公共資源,無需註冊、無需金鑰。
端點協議HTTPS · GET
https://logohub.afengblog.com/api統一返回 application/json; charset=utf-8,按來源 IP 限流 20 請求/秒
介面一覽
GET https://logohub.afengblog.com/api/search?q=&category=&sort=&order=&limit=&offset=&lang=關鍵詞檢索,支援中文名(簡繁體)、英文名、拼音全拼與拼音首字母;q 必填,單次最多返回 20 條,sort 取 latest / name,order 取 asc / desc(預設時最近更新為新→舊、名稱為 A→Z)GET https://logohub.afengblog.com/api/logos/:slug?lang=單個品牌後設資料,包含內聯 SVG 原始碼、資源 URL 與同類推薦GET https://logohub.afengblog.com/api/logos?q=&category=&sort=&order=&limit=&offset=&lang=列表與篩選,預設不含 SVG 原始碼;limit 上限 20,sort 與 order 取值同檢索介面GET https://logohub.afengblog.com/api/stats收錄總量、各分類計數與最近入庫時間GET https://logohub.afengblog.com/api/health服務與資料庫健康狀態,資料庫未就緒時返回 503多語言
檢索、列表與詳情介面接受可選參數 lang,取值 zh-CN / zh-TW / ja / en,大小寫不敏感,預設為 zh-CN。
locale回應頂層與每條結果都帶 locale,標明本次返回內容的語言版本name, enName該語言的品牌主名與副名;nameZhCN 始終保留簡體原名,便於跨語言對齊categoryName, description, tags該語言的分類名、描述與標籤;標籤不做翻譯,繁體只轉換字形urls.page該語言的詳情頁地址,例如 /ja/logo/{slug}alternates全部語言版本詳情頁的完整地址,鍵為語言代碼lang 取值不在列表內時返回 400,回應體為 { "error": "invalid_locale", "supported": [...] }。
資源 URL
每條 logo JSON 附帶 urls 欄位,直接在回應內給出下列地址,無需自行拼接路徑。
pagehttps://logohub.afengblog.com/logo/{slug} 品牌詳情頁(帶 lang 時為對應語言的地址)svghttps://logohub.afengblog.com/logos/{svgFile} 原始向量檔案,靜態直出pnghttps://logohub.afengblog.com/logos/{slug}.png 1024×1024 透明 PNGjpghttps://logohub.afengblog.com/logos/{slug}.jpg 1024×1024 白底 JPEGwebphttps://logohub.afengblog.com/logos/{slug}.webp 1024×1024 透明 WebP柵格圖按 slug 即時生成,固定等比裝入 1024×1024。PNG 與 WebP 保留透明通道,JPEG 為白底,回應頭帶 Cache-Control: public, max-age=31536000,可安全長期快取。
限流
- https://logohub.afengblog.com/api/*、https://logohub.afengblog.com/mcp 與柵格圖按來源 IP 限制 20 請求/秒。
- 超限返回 429 與 Retry-After,回應頭攜帶 X-RateLimit-Limit 與 X-RateLimit-Remaining。
- HTML 頁面與靜態向量檔案不限流。
示例
拼音檢索
curl "https://logohub.afengblog.com/api/search?q=zhifubao&limit=5"單品牌詳情(日語版本)
curl "https://logohub.afengblog.com/api/logos/alipay?lang=ja"分類列表
curl "https://logohub.afengblog.com/api/logos?category=school&limit=5"下載 1024px PNG
curl -o alipay.png "https://logohub.afengblog.com/logos/alipay.png"使用範圍
全部品牌標誌與商標的智慧財產權歸原權利人所有。內容依據《中華人民共和國著作權法》第二十四條僅供個人學習、學術交流、技術研發與設計鑑賞,禁止未經授權的商業使用。 侵權下架申請