Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scientanl/brandr-api
logo and style extractor api
https://github.com/scientanl/brandr-api
api logo nodejs
Last synced: 10 days ago
JSON representation
logo and style extractor api
- Host: GitHub
- URL: https://github.com/scientanl/brandr-api
- Owner: ScientaNL
- License: mit
- Created: 2019-03-29T08:02:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T12:21:09.000Z (5 months ago)
- Last Synced: 2024-08-19T14:22:58.597Z (5 months ago)
- Topics: api, logo, nodejs
- Language: JavaScript
- Homepage: https://brandr.app
- Size: 1.26 MB
- Stars: 21
- Watchers: 6
- Forks: 10
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BRANDr API
BRANDr is an API which retrieves the logos and branding colors of a website. You can use it to obtain branding information of a website based on a URL.The project utilizes [Puppeteer](https://github.com/GoogleChrome/puppeteer) in order to load a website and perform strategies to assert what the logo and branding colors of a website could be. There are various strategies deployed:
- DOM parsing
- Meta parsing
- Social data parsing
- Color usage parsing## Deploying the BRANDr API
Checkout the repository, create your own `.env` file (the defaults should be fine) and deploy the BRANDr API Docker container using `docker-compose`:```shell
docker-compose -f docker-compose.yml up -d --force-recreate \
&& docker-compose -f docker-compose.yml logs -f
```This command uses `docker logs` to monitor the container usage and debug information.
## Using the API
Check out the API with your favorite REST request tool, such as Postman.### Request
Fire a x-form-urlencoded POST request to BRANDr endpoint| Item | Value |
|-------------|-----------------------------------|
| Endpoint | *endpoint specified in .env file* |
| Method | POST |
| Body | x-form-urlencoded form parameters |
| - endpoint | `<>` |### Response
A response could like the result displayed below. The logo array contains our guess. The other properties are the best guesses for their respective strategy.```json
{
"uri": "https://www.scienta.nl",
"extractions": {
"logo": [
"<>/520582509e2936254f0bb430d0da3a46.png",
"<>/aadc84c2b34d58618564d8ab721f8f7d.jpg",
"<>/39766a4fd1f3d8149ea1f266c8a8a996.png"
],
"dom-logo": "<>/520582509e2936254f0bb430d0da3a46.png",
"social-logo": "<>/aadc84c2b34d58618564d8ab721f8f7d.jpg",
"meta-logo": "<>/6816a7546d517431aa9d5894f27c0c42.png",
"site-style": [
{
"colors": [
"rgb(230, 81, 0)"
],
"grays": [
"rgb(51, 51, 51)",
"rgb(0, 0, 0)"
]
}
]
}
}
```## Contributing
For an effortless local development setup, execute the command below:```shell
cd app && \
npm install && \
docker-compose -f docker-compose.local.yml up -d --force-recreate && \
docker-compose -f docker-compose.local.yml logs -f
```Thank you for your interest in contributing to the BRANDr API!