Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drkain/fetch-avatar
An NPM package to fetch avatars from a whole bunch of websites
https://github.com/drkain/fetch-avatar
avatar fetch nodejs npm scrape
Last synced: about 1 month ago
JSON representation
An NPM package to fetch avatars from a whole bunch of websites
- Host: GitHub
- URL: https://github.com/drkain/fetch-avatar
- Owner: DrKain
- License: mit
- Created: 2021-05-22T19:18:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-17T05:39:22.000Z (over 2 years ago)
- Last Synced: 2024-10-10T07:18:31.318Z (about 1 month ago)
- Topics: avatar, fetch, nodejs, npm, scrape
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fetch-Avatar
Fetch avatars from various websites using usernames, IDs or emails.
[![NPM](https://img.shields.io/npm/v/fetch-avatar)](https://www.npmjs.com/package/fetch-avatar) [![NPM](https://img.shields.io/npm/dt/fetch-avatar)](https://www.npmjs.com/package/fetch-avatar) [![NPM](https://img.shields.io/npm/types/fetch-avatar)](https://www.npmjs.com/package/fetch-avatar)
### Install
```
npm install fetch-avatar
```### Usage:
For most providers you can simply pass a username or email.
If the user has an avatar you'll receive a URL, otherwise the response will be `null````ts
import { avatar } from 'fetch-avatar';avatar.github('DrKain').then(console.log);
// https://avatars.githubusercontent.com/u/5300315
```### API Keys:
Some providers will require an API to function. I've tried to avoid this best I can but sometimes it's unavoidable.
When a provider requires an API key. Please visit the GitHub [wiki](https://github.com/DrKain/fetch-avatar/wiki) to see how to use these. Each provider that requires an API key or token has their own page showing how to get one.### Default Avatars
This package will attempt to detect and remove default avatars from providers. If a default avatar is detected the response will be `null`.
#### Supported:
- [x] [DeviantArt](https://www.deviantart.com/)
- [x] [Discord](https://discord.com/) - [Token Required](https://github.com/DrKain/fetch-avatar/wiki/Discord#bot-token)
- [x] [FurAffinity](https://www.furaffinity.net/)
- [x] [GitHub](https://github.com/)
- [x] [GitLab](https://about.gitlab.com/)
- [x] [Gravatar](https://en.gravatar.com/)
- [x] [Last.FM](https://www.last.fm/)
- [x] [NPM](https://www.npmjs.com)
- [x] [Spotify](https://open.spotify.com) - [Token Required](https://github.com/DrKain/fetch-avatar/wiki/Spotify#oauth-token)
- [x] [Steam](https://steamcommunity.com)
- [x] [Trakt.tv](https://trakt.tv)#### Planned:
- [ ] [Youtube](https://youtube.com)
- [ ] [Pixiv](https://www.pixiv.net/en/)
- [ ] [Artstation](https://www.artstation.com/)