Favicon API
The Favicon API returns the current favicon URL for a site and updates automatically when the website favicon changes. It is useful when you want to track the latest favicon rather than fetching a static file.
Response Format
All successful responses are returned in JSON format.
{
"credit": "API Data from <a href='https://dev.tylermwise.uk/v2/favicon'>tylermwise.com</a>",
"url": "https://example.com/favicon.ico",
"extension": "ico"
}
Response Fields:
credit(string) - Attribution text for the API source, returned as HTML.url(string) - The current favicon URL.extension(string) - The detected file extension for the favicon.
Authentication Methods
This endpoint is publicly accessible and does not require authentication.
Characteristics:
- No authentication required
- JSON response format
- Tracks the current favicon URL
- Automatically updates when the source favicon changes
Usage:
Endpoint
GET /v2/favicon
Example Request
Example Response
{
"credit": "API Data from <a href='https://dev.tylermwise.uk/v2/favicon'>tylermwise.com</a>",
"url": "https://example.com/favicon.ico",
"extension": "ico"
}
PHP Usage
Fetch API Data
<?php
$contents = file_get_contents("https://api.tylermwise.uk/v2/favicon?url=tylermwise.uk");
$data = json_decode($contents);
?>
Output Common Values
Output Favicon URL
Output File Extension
Output API Credit
Response Fields
| Field | Type | Description |
|---|---|---|
credit | string | Attribution text for the API source. |
url | string | Current favicon URL. |
extension | string | Detected favicon file extension. |
Notes
- The endpoint updates automatically when the target site favicon changes.
- The response currently includes
urlandextension. - The source example mentions
type, but the example JSON usesextension, soextensionis the field documented here. - You can embed the returned favicon URL directly in an
<img>tag if needed.
HTTP Status Codes
Standard responses may include:
200- Success.400- Bad Request.429- Too Many Requests.500- Internal Server Error.
Versioning
This page documents version 2 of the Favicon API, available under the /v2/ path.