{"id":18410656,"url":"https://github.com/vfk/swift-favicon","last_synced_at":"2026-07-16T04:32:12.274Z","repository":{"id":77516517,"uuid":"568961557","full_name":"VFK/swift-favicon","owner":"VFK","description":"Get urls to higher quality website icons","archived":false,"fork":false,"pushed_at":"2022-11-21T19:34:33.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T21:51:50.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VFK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-11-21T19:34:07.000Z","updated_at":"2023-10-07T21:40:06.000Z","dependencies_parsed_at":"2023-04-18T03:16:59.288Z","dependency_job_id":null,"html_url":"https://github.com/VFK/swift-favicon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/VFK/swift-favicon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Fswift-favicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Fswift-favicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Fswift-favicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Fswift-favicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VFK","download_url":"https://codeload.github.com/VFK/swift-favicon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2Fswift-favicon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35531123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-16T02:00:06.687Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T03:33:14.026Z","updated_at":"2026-07-16T04:32:12.246Z","avatar_url":"https://github.com/VFK.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Favicon\nGet urls to higher quality website icons than `/favicon.ico`\n\n\n## Usage\nUse with **Package Manager**.\n\n```swift\nimport Favicon\n\nlet url = URL(string: \"https://example.com\")!\nlet favicon = Favicon(url: url)\nlet faviconUrl: URL? = await favicon.url() // Large size by default\n```\n\n### Blacklisting icon extensions\nYou might want to skip icons with certain extensions.\n\nFor example SwiftUI doesn't render SVG images at the time of writing.\n\nUse this constructor:\n```swift\nlet favicon = Favicon(url: url, blacklistedExtensions: [\".svg\"])\n```\n\n## Icon Size Classes\n```swift\nlet smallIconUrl = await favicon.url(size: .small)\nlet mediumIconUrl = await favicon.url(size: .medium)\nlet largeIconUrl = await favicon.url(size: .large)\n```\nReturned result is the highest quality icon within it's class.\n\n### How sizes are determined\nUnless the size is set explicitly (through `sizes` attribute) size class is just an educated guess e.g. `rel=\"icon\"`, \"shortcut icon\" etc. are small, \"apple-touch\" stuff is medium, the rest is large.\n\nIf size is set then everything below 32 pixels is small, up to 180 is medium and the rest is large.\n\nThis seems to give pretty good results but your mileage may vary. Feel free to open an issue if it doesn't work for you.\n\n## Chosing the \"best\" icon manually\nIf you're unhappy with how this library sorts and groups icons you can request all icons that this library could find and pick what you want:\n```swift\nlet icons: [Icon] = await favicon.icons()\n```\n\n```swift\nstruct Icon {\n    let url: URL // Absolute url to the icon\n    let iconClass: IconClass // Enum. Icon source from \"rel\" attribute usually. .appleTouchIcon, .icon etc.\n    let sizeClass: IconSizeClass // Enum. .small, .medium or .large\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Fswift-favicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvfk%2Fswift-favicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Fswift-favicon/lists"}