šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

favicons-scraper

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

favicons-scraper

A fully-typed api wrapper for a favicon scraper

1.3.2
latest
Source
npm
Version published
Weekly downloads
576
66.96%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Favicons-scraper

A fully-typed wrapper for the favicons scraper API
The API returns a list of the favicons from any domain you give it.

Node.js

If you want to implement a favicon scraper in your node (or bun) project, check out this scraper built in node. Its a full scraper instead of just a wrapper for an API. Node Scraper

Demo

www.FaviconScraper

Usage

import { getLogos } from 'favicons-scraper'

const url = 'https://facebook.com/user'
const urlLogos = await getLogos(url)

const domain = 'facebook.com'
const domainLogos = await getLogos(domain)
console.log(urlLogos)
console.log(domainLogos)
/*
[
  {
    size: { width: 120, height: 120 },
    type: 'png',
    mime: 'image/png',
    src: 'https://z-m-static.xx.fbcdn.net/rsrc.php/v3/yO/r/_GHbZfYGSj-.png'
    device: 'desktop'
  }
]
*/

You can get the favicons from a specific device using the options.

const options = {
  devices: 'mobile' // devices accepts a string containing all of the devices you want, eg: 'mobile desktop' for mobile and desktop favicons (default) 
}

const domainLogos = await getLogos('web.dev', options)
/*
[
  {
    size: { width: 180, height: 180 },
    type: 'png',
    mime: 'image/png',
    src: 'https://www.gstatic.com/devrel-devsite/prod/ve5ef9ac7b497e19ece9427facc78d0c59aaab7a2bc6a0f75fdae93f4ee589f67/web/images/touchicon-180.png',
    device: 'mobile'
  }...
]
*/

Keywords

Favicon

FAQs

Package last updated on 17 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts