# agent402.tools Favicon Grab

> agent402.tools Favicon Grab is a paid API for AI agents from agent402.tools, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Fetches a website's favicon/logo by parsing its HTML link tags, selecting the largest declared icon, and returning the image bytes as base64

## Facts

- Endpoint: POST https://agent402.tools/api/favicon-grab
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-favicon-grab-a19f09a2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9ReHW9eka0FCOr_Z8-BK7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-favicon-grab-a19f09a2 -d '<json body>'
```

Example prompt: Can you grab the favicon for github.com and give me the image bytes as base64 so I can display it in my app?

## When to prefer this

Use this endpoint when you need to programmatically retrieve a website's favicon or brand icon as raw image bytes (base64), especially when you want the largest available declared icon rather than a guess at /favicon.ico. Prefer this over manual HTML parsing when you need a reliable, deterministic icon selection across many sites.

## Known failure modes

- URL is unreachable or returns non-2xx status — endpoint may return an error or fall back to /favicon.ico
- Site has no declared icon tags and /favicon.ico does not exist — returns error or empty response
- Malformed URL input — validation error returned
- Icon file itself returns a non-image content type — may return error or unexpected bytes
- Network timeout fetching the remote site or icon resource

## How this service works

Fetch a site's favicon/logo: reads the page's declared <link rel=icon…> tags (all variants with their sizes and types), deterministically picks the largest declared icon (falling back to /favicon.ico), fetches it, and returns the bytes as a base64 data URI plus the resolved icon URL and content type. Icons over 256KB return the URL and metadata without the inline data URI. SSRF-guarded - private-network hosts are rejected. Sites with no reachable icon return {found:false}.

## Output

Returns the favicon image as base64-encoded bytes, selected deterministically as the largest declared icon from the page's <link rel=icon> tags, falling back to /favicon.ico if no tags are found. Includes icon size and MIME type metadata.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Site URL or bare domain (https:// is assumed when omitted)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://github.com/",
  "bytes": 958,
  "found": true,
  "dataUri": "data:image/png;base64,iVBORw0KGgo…",
  "iconUrl": "https://github.githubassets.com/favicons/favicon.png",
  "declared": [
   {
    "rel": "alternate icon",
    "href": "https://github.githubassets.com/favicons/favicon.png",
    "mask": false,
    "type": "image/png",
    "sizes": null
   }
  ],
  "contentType": "image/png",
  "finalIconUrl": "https://github.githubassets.com/favicons/favicon.png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-favicon-grab-a19f09a2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
