Skip to content

A little documentation for working with vinci API.

Notifications You must be signed in to change notification settings

bifot/vinci-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vinci

A little documentation for working with vinci API.

Usage

Initially, you need to form multipart/form-data with your photo, then send it on http://vinci.camera/preload. After you need to save your results by request http://vinci.camera/process with proxy. In variable filter you can set filter what do you need. Some filters available on website http://vinci.camera/list, but here some hided (see hidden_filters.json, if you need more filters).

const fs = require('fs')
const path = require('path')
const mime = require('mime')
const request = require('request')

const proxy = 'https://cors-pmmlabs.rhcloud.com/'
const filter = 1
const data = {
  file: {
    value: fs.createReadStream('./test/example.jpg'),
    options: {
      filename: path.basename('./test/example.jpg'),
      contentType: mime.lookup('./test/example.jpg')
    }
  }
}

request({
  url: 'http://vinci.camera/preload',
  method: 'post',
  formData: data,
  json: true
}, (err, res, body) => {
  if (!err && res.statusCode === 200 && body.preload) {    
    request(`${proxy}http://vinci.camera/process/${body.preload}/${filter}`)
      .pipe(fs.createWriteStream('./test/vinci.jpg'))
  }
})

There's cool example.

License

MIT.

About

A little documentation for working with vinci API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published