Favicon API Reference

The Favicon API allows you to retrieve website favicons in various formats and sizes.

Retrieve Favicon

Endpoint

bash
01POST https://api.screenshotapi.io/v1/capture

Request Options

ParameterTypeDescription
urlstringThe URL of the website
captureType'favicon'Set to 'favicon' for icon retrieval
format'png' | 'jpeg' | 'webp'Output format for the favicon

Response

typescript
01interface FaviconResponse {
02 favicon_url: string;
03 width: number;
04 height: number;
05 mime_type: string;
06 size: number;
07 created_at: string;
08}

Example

javascript
01const response = await fetch('https://api.screenshotapi.io/v1/capture', {
02 method: 'POST',
03 headers: {
04 'Content-Type': 'application/json',
05 'Authorization': 'Bearer your_api_key'
06 },
07 body: JSON.stringify({
08 url: 'https://example.com',
09 captureType: 'favicon',
10 format: 'png'
11 })
12});
13
14const data = await response.json();
15console.log(data.favicon_url);

Icon Formats

The API supports multiple output formats for favicons:

  • PNG: Lossless format, best for icons with sharp edges
  • JPEG: Lossy format, smaller file size
  • WebP: Modern format with good compression and quality

The API automatically detects and retrieves the highest quality favicon available from the website.

Ready to Get Started?

Get your API key now and start capturing screenshots in minutes.