Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tineye-api

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tineye-api

TinEye API node.js library

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
decreased by-32.04%
Maintainers
1
Weekly downloads
 
Created
Source

tineye-api

tineye-api is the official Node.js library for the TinEye API. The TinEye API is TinEye's paid reverse image search solution for professional, commercial or high-volume users. See https://api.tineye.com/ for more information.

Contents

Installation

Install the latest version of the library using npm:

$ npm install tineye-api

Getting started

After installation, require the library to start using it:

var TinEye = require('tineye-api')

Now that you've required the library, you can use it to create an instance of the API object.

var api = new TinEye('https://api.tineye.com/rest/', <public_key>, <private_key>);

Be sure to populate public_key and private_key with your own keys. You can test your code with our API sandbox keys, but you won't get real search results until you start using your real keys.

Once you have an api object, you can start searching. You can submit an image using either an image URL or by submitting image data by uploading an image file. You can also check the number of remaining searches in your account or check the number of images in the TinEye index.

Methods

Search using an image URL

var url = 'https://tineye.com/images/meloncat.jpg';
var params = {
  'offset': 0,
  'limit': 10,
  'sort': 'score',
  'order': 'desc'
};
api.searchUrl(url, params)
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });

Search using image data

var img = fs.readFileSync('/Users/Mypath/image.jpg');
var params = {
  'offset': 0,
  'limit': 10,
  'sort': 'size',
  'order': 'asc'
};
api.searchData(img, params)
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });

Get remaining searches

api.remainingSearches()
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });

Get number of indexed images

api.imageCount()
  .then(function(response) {
    console.log(response);
  })
  .catch(function(error) {
    console.log(error);
  });

Release history

1.1.0

  • Changed tests from BusterJS to Jest
  • Removed BlueBird and switched to native promises
  • Switch library for making GET requests from Requests to Axios

1.0.2

  • Switched hashing algorithm from SHA1 to SHA256
  • Switched README from reStructuredText to Markdown

1.0.1

  • Cleaning up some code and comments
  • Some error handling fixes

1.0.0

  • Adding promises
  • Better error handling
  • Switched method names to camelCasing
  • searchUrl and searchData now take an option array

0.1.0

  • Initial release

Keywords

FAQs

Package last updated on 16 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc