An open API service indexing awesome lists of open source software.

https://github.com/micartey/grepcon

Get the favicon of a website using a RESTapi
https://github.com/micartey/grepcon

favicon java web

Last synced: 22 days ago
JSON representation

Get the favicon of a website using a RESTapi

Awesome Lists containing this project

README

          

# grepcon













Introduction
Getting started
Troubleshooting

## 📚 Introduction

`grepcon` is a RESTapi to get the favicon from websites. This project was especially made for [nura-pwa](https://github.com/nura-vault/nura-pwa) to eventually replace the unofficial google api which is currently used. The google api sadly doesn't work for many websites and therefore is not sutible for my usecase.

## 📝 Getting started

Using `grepcon` is fairly easy. Firstly, clone the repository and use Docker to build and run the application

```shell
$ docker-compose up
```

Afterwards you can access the api via following RESTapi

```shell
$ curl https://localhost:8080/api/v1/favicon/list?url{URL}?fallback={FALLBACK_URL}
```

After invoking the endpoint, an array with urls to the different favicons will be returned.

Example:

```
[
"https://www.google.com/favicon.ico"
]
```

### Get Image as Response

You can also get an image as an response. This is especially useful for saving images in a serviceworker or prevent cors errors.

```
$ curl https://localhost:8080/api/v1/favicon?url={URL}?fallback={FALLBACK_URL}
```

### Current Limitations

- Currently `grepcon` is not checking for resolution
- URLs are not always corrected