{"id":14130,"library":"tineye-api","title":"TinEye API Node.js Client","description":"The `tineye-api` package is the official Node.js library for interacting with the TinEye API, a commercial reverse image search solution. It enables developers to programmatically search for images using a URL or raw image data, retrieve the number of remaining searches, and query the total indexed image count. The current stable version is 2.0.6, which primarily includes updates to underlying dependencies like Axios and Jest, with no functional changes from 2.0.5. Releases appear to focus on maintenance and dependency updates rather than frequent new features, implying a stable API. Its key differentiator is being the official, supported client for accessing the paid TinEye API, ensuring compatibility and adherence to API specifications for professional and high-volume users. It simplifies authentication and request handling, abstracting away the complexities of HMAC-SHA256 authentication for previous versions, now using a simpler header key.","status":"active","version":"2.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/TinEye/tineye_api_node","tags":["javascript","TinEye","TinEye API","Search by Image","Reverse Image Search","Find Duplicates","Computer Vision"],"install":[{"cmd":"npm install tineye-api","lang":"bash","label":"npm"},{"cmd":"yarn add tineye-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add tineye-api","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for making HTTP requests to the TinEye API.","package":"axios"},{"reason":"Used for constructing multipart/form-data requests when submitting image data.","package":"form-data"}],"imports":[{"note":"The library primarily uses CommonJS `require` syntax as shown in official examples. While `import { TinEye } from 'tineye-api';` may work in ES module environments, the CommonJS pattern is the documented and most reliable approach.","wrong":"import TinEye from 'tineye-api';","symbol":"TinEye","correct":"const TinEye = require('tineye-api');"}],"quickstart":{"code":"const TinEye = require('tineye-api');\nconst fs = require('fs'); // Needed if using searchData with local files\n\n// Your actual API key from TinEye. Recommended to use environment variables.\n// For testing, you can use the sandbox key: \"6mm60lsCNIB,FwOWjJqA80QZHh9BMwc-ber4u=t^\"\nconst apiKey = process.env.TINEYE_API_KEY ?? \"6mm60lsCNIB,FwOWjJqA80QZHh9BMwc-ber4u=t^\"; // Sandbox key for demonstration\nconst apiBaseUrl = \"https://api.tineye.com/rest/\"; // Use \"https://api.tineye.com/rest/\" for production\n\nconst api = new TinEye(apiBaseUrl, apiKey);\n\n// --- Example 1: Search using an image URL ---\nasync function searchByUrl() {\n  const imageUrl = \"https://tineye.com/images/meloncat.jpg\";\n  const params = {\n    offset: 0,\n    limit: 1,\n    sort: \"score\",\n    order: \"desc\"\n  };\n  try {\n    console.log(`\\nSearching for URL: ${imageUrl}`);\n    const response = await api.searchUrl(imageUrl, params);\n    console.log(\"Search by URL results (first item):\", JSON.stringify(response.results[0], null, 2));\n  } catch (error) {\n    console.error(\"Error searching by URL:\", error.message);\n  }\n}\n\n// --- Example 2: Get remaining searches ---\nasync function getRemainingSearches() {\n  try {\n    console.log(\"\\nGetting remaining searches...\");\n    const response = await api.remainingSearches();\n    console.log(\"Remaining searches:\", response.results);\n  } catch (error) {\n    console.error(\"Error getting remaining searches:\", error.message);\n  }\n}\n\n// Run examples\nasync function runExamples() {\n  await searchByUrl();\n  await getRemainingSearches();\n}\n\nrunExamples();","lang":"javascript","description":"Demonstrates how to instantiate the TinEye API client with an API key, perform a reverse image search using a public image URL, and check the remaining search credits for your account."},"warnings":[{"fix":"Update your `TinEye` constructor instantiation from `new TinEye(url, publicKey, privateKey)` to `new TinEye(url, apiKey)` where `apiKey` is your old `privateKey`.","message":"Version 2.0.0 introduced a significant change to the authentication method. The API constructor now accepts a single `api_key` parameter instead of separate `publicKey` and `privateKey` parameters. The value for `api_key` is your previous `privateKey`.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"For production use or to get actual search results, replace the sandbox key with a valid, paid TinEye API key obtained from your account dashboard.","message":"Using the provided sandbox API keys (e.g., \"6mm60lsCNIB,FwOWjJqA80QZHh9BMwc-ber4u=t^\") will allow the API client to function, but it will not return real search results from the TinEye index. It's intended for integration testing only.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Confirm the `apiBaseUrl` parameter in the `TinEye` constructor matches the official documentation, typically `https://api.tineye.com/rest/` for production or `https://sandbox.tineye.com/rest/` for the sandbox environment.","message":"Ensure the correct TinEye API base URL, including the `/rest/` path, is provided during client instantiation. Omitting or incorrectly specifying this path may lead to connection errors or invalid API responses.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2.0.5':77 '2.0.6':60 'abstract':131 'access':106 'adher':114 'api':2,8,20,95,110,116,152 'appear':79 'authent':127,139 'away':132 'axio':69 'chang':75 'client':4,104 'commerci':22 'compat':112 'complex':134 'comput':161 'count':54 'current':56 'data':41 'depend':67,85 'develop':29 'differenti':98 'duplic':160 'enabl':28 'ensur':111 'featur':91 'find':159 'focus':81 'frequent':89 'function':74 'handl':130 'header':147 'high':122 'high-volum':121 'hmac':137 'hmac-sha256':136 'imag':24,34,40,53,155,157 'impli':92 'includ':63 'index':52 'interact':16 'javascript':149 'jest':71 'key':97,148 'librari':14 'like':68 'mainten':83 'new':90 'node.js':3,13 'number':44 'offici':12,102 'packag':9 'paid':108 'previous':141 'primarili':62 'profession':119 'programmat':31 'queri':49 'rather':87 'raw':39 'releas':78 'remain':46 'request':129 'retriev':42 'revers':23,156 'search':25,32,47,153,158 'sha256':138 'simpler':146 'simplifi':126 'solut':26 'specif':117 'stabl':57,94 'support':103 'tiney':1,7,19,109,150,151 'tineye-api':6 'total':51 'under':66 'updat':64,86 'url':37 'use':35,144 'user':124 'version':58,142 'vision':162 'volum':123","created_at":"2026-04-20T01:58:05.605814+00:00","updated_at":"2026-04-20T01:58:05.605814+00:00","problems":[{"fix":"Ensure you are using `const TinEye = require('tineye-api');` at the top of your file for CommonJS modules, or `import { TinEye } from 'tineye-api';` for ES Modules if your environment supports it and the package is configured for it.","cause":"The `TinEye` class was not correctly imported or required.","error":"TypeError: TinEye is not a constructor"},{"fix":"Double-check that your `apiKey` passed to the `TinEye` constructor is correct and active. For versions 2.0.0 and above, ensure you are passing only your `privateKey` as the `apiKey`.","cause":"The API key provided is invalid, missing, or unauthorized for the requested operation.","error":"Error: Request failed with status code 401"},{"fix":"Add `const fs = require('fs');` at the top of your file if you intend to read image data from the local filesystem for `searchData`.","cause":"Attempting to use `api.searchData()` with local file paths (e.g., `fs.readFileSync`) without importing Node.js's built-in `fs` module.","error":"ReferenceError: fs is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://tineye.com","github":"https://github.com/TinEye/tineye_api_node","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/tineye-api","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}