https://github.com/yeemachine/screenshot-api
https://github.com/yeemachine/screenshot-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yeemachine/screenshot-api
- Owner: yeemachine
- Created: 2018-09-05T02:36:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-15T18:48:31.000Z (almost 8 years ago)
- Last Synced: 2025-01-28T11:49:08.840Z (over 1 year ago)
- Language: JavaScript
- Size: 22 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Node Webshot to Base64 API
==========================
This simple API uses [Node-Webshot](https://github.com/brenden/node-webshot) to take a screenshot of a given URL and then converts it into a Base64 Data URI. It also uses [Node-Vibrant](https://github.com/akfish/node-vibrant/) to give back dominant colors. Created for [VR-Browser](https://github.com/yeemachine/vr-browser).
**Options**
This simplified version takes 2 parameters: a URL and a screen width (optional).
```
https://screenshot-api.herokuapp.com/webshot?url=google.com&width=1440
```
Option
Default Value
Description
url
'google.com'
The website URL. No need for headers. Takes a string. If given an invalid URL, it will return a screenshot of a Google image search of the string.
width
1000
The dimension of the browser window width. Takes a value.
**Example Response**
```
color:{
DarkMuted: {_rgb: Array(3), _population: 1, _hsl: Array(3)}
DarkVibrant: {_rgb: Array(3), _population: 0}
LightMuted: {_rgb: Array(3), _population: 89, _hsl: Array(3)}
LightVibrant: {_rgb: Array(3), _population: 15, _hsl: Array(3)}
Muted: {_rgb: Array(3), _population: 59, _hsl: Array(3)}
Vibrant: {_rgb: Array(3), _population: 27, _hsl: Array(3)}
},
dimensions: {
width: 1440,
height: 768,
type: "png"
},
image: "data:image/jpg;base64"
```